Retrieve general settings with Python (Plone 4.3.15)

Working with Plone 4.3.15 I am trying to find a general way (or just a way) of retrieving via Python the Plone Configuration settings (see the first image) of a Plone instance. As an example, for the Mail Settings I would like to retrieve the values of the fields that can be seen in the second image. And I would like to do the same with all the panels and settings. Thus far I've had no luck. Below are some of my attempts to do so (the most promising ones).

Attempt 1

I have tried using the registry method forInterface with the different Schema interfaces as shown below (where ISomeSchema is a generic name I'm using here but could be, for exampe IMailSchema):

reg = getUtility(IRegistry)
some_settings = reg.forInterface(ISomeSchema)

However, I keep getting the error:

KeyError: 'Interface 'Products.CMFPlone.interfaces.controlpanel.ISomeSchema' defines a field 'some_field', for which there is no record.'

which isn't strange at all, since not all the fields have a record set (although it also gives the same error for some fields which are indeed set. Related: However, when I call the same forInterface method with check=False and then query the different fields all of them are returning None.

Attempt 2

I have also tried using the function getFields from zope.schema:


and I am actually getting back something like:

'field_name', <zope.schema._bootstrapfields.SomeField object at 0x[...]>

However, it seems to me that I am getting something like the definition of the field and I have not being able to retrieve its current value from there.


Is there any way in which I can achieve this? Or could I be pointed in the right direction?

If there is any further information I can provide I will do so willingly. Also, if haven't been clear enough I can try to explain myself better. Thanks in advance!

plone_daemon@ploneprod3:/usr/local/plone-4.3/ploneprod$ bin/client_reserved debug
Starting debugger (the name "app" is bound to the top-level Zope object)

>>> plone=app.Plone
>>> from zope.component.hooks import setSite
>>> setSite(plone)
>>> plone.keys()
['portal_setup', 'MailHost', 'caching_policy_manager', 'content_type_registry', 'error_log', 'plone_utils', 'portal_actionicons', 'portal_actions', 'portal_atct', 'portal_calendar', 'portal_catalog', 'portal_controlpanel', 'portal_css', 'portal_diff', 'portal_factory', 'portal_groupdata', 'portal_groups', 'portal_interface', 'portal_javascripts', 'portal_memberdata', 'portal_membership', 'portal_metadata', 'portal_migration', 'portal_password_reset', 'portal_properties', 'portal_quickinstaller', 'portal_registration', 'portal_skins', 'portal_types', 'portal_uidannotation', 'portal_uidgenerator', 'portal_uidhandler', 'portal_undo', 'portal_url', 'portal_view_customizations', 'portal_workflow', 'translation_service', 'portal_form_controller', 'mimetypes_registry', 'portal_transforms', 'archetype_tool', 'reference_catalog', 'uid_catalog', 'portal_archivist', 'portal_historiesstorage', 'portal_historyidhandler', 'portal_modifier', 'portal_purgepolicy', 'portal_referencefactories', 'portal_repository', 'portal_languages', 'acl_users', 'portal_tinymce', 'portal_registry', 'portal_discussion', 'HTTPCache', 'RAMCache', 'ResourceRegistryCache', 'front-page', 'news', 'events', 'Members', 'essai', 'test-dir']
>>> plone.portal_registry['']
>>> plone.MailHost.smtp_port
>>> plone.portal_tinymce.styles
u'Call-out|p|callout\nCircle|ul|listTypeCircle\nClear floats|div|visualClear\nDefinition description|dd|\nDefinition term|dt|\nDiscreet|span|discreet\nDisc|ul|listTypeDisc\nEven row|tr|even\nHeading cell|th|\nHeading|h2|\nHighlight|span|visualHighlight\nLiteral|pre|\nLower Alpha|ol|listTypeLowerAlpha\nLower Roman|ol|listTypeLowerRoman\nNumbers|ol|listTypeDecimal\nOdd row|tr|odd\nPage break (print only)|div|pageBreak\nPull-quote|blockquote|pullquote\nSquare|ul|listTypeSquare\nSubheading|h3|\nUpper Alpha|ol|listTypeUpperAlpha\nUpper Roman|ol|listTypeUpperRoman'

it's easier with Plone 5 where AFAIK everything is under portal_registry