Logo Search packages:      
Sourcecode: zope-maildrophost version File versions

def MaildropHost::MaildropHost::MaildropHost::_load_config (   self  )  [private]

Read the config info and store as object attributes 

Definition at line 76 of file MaildropHost.py.

00076                           :
        """ Read the config info and store as object attributes """
        import Products.MaildropHost
        default_config_path = os.path.join(Products.MaildropHost.__path__[0],
                                           'config')
        config_path = getattr(aq_base(self), 'config_path', default_config_path)
        config = dict(parse_assignments(open(config_path).read()))
        self.active_config_path = config_path
        self.smtp_host = config['SMTP_HOST']
        self.smtp_port = config['SMTP_PORT']
        self.debug = config['DEBUG'] and 'On' or 'Off'
        self._debug_receiver = config.get('DEBUG_RECEIVER', '') 
        self.debug_receiver =  self._debug_receiver or '(not set)'
        self.polling = config['MAILDROP_INTERVAL']
        MAILDROP_HOME = config['MAILDROP_HOME']
        MAILDROP_SPOOL = config.get('MAILDROP_SPOOL', '')
        if MAILDROP_SPOOL:
            MAILDROP_SPOOLS = [x.strip() for x in MAILDROP_SPOOL.split(';')]
        else:
            MAILDROP_SPOOLS = [os.path.join(MAILDROP_HOME, 'spool')]
        self.spool = MAILDROP_SPOOLS[0]

        for spool in MAILDROP_SPOOLS:
            if not os.path.isdir(spool):
                os.makedirs(spool)

        MAILDROP_TLS = config['MAILDROP_TLS']
        self.use_tls = ( (MAILDROP_TLS > 1 and 'Forced') or
                         (MAILDROP_TLS == 1 and 'Yes') or
                         'No' )
        self.login = config['MAILDROP_LOGIN'] or '(not set)'
        self.password = config['MAILDROP_PASSWORD'] and '******' or '(not set)'
        self.add_messageid = config.get('ADD_MESSAGEID', 0) and 'On' or 'Off'
        MAILDROP_LOG_FILE = config.get('MAILDROP_LOG_FILE')
        if not MAILDROP_LOG_FILE:
            MAILDROP_VAR = config.get('MAILDROP_VAR',
                                      os.path.join(MAILDROP_HOME, 'var'))
            MAILDROP_LOG_FILE = os.path.join(MAILDROP_VAR, 'maildrop.log')
        self.maildrop_log_file = MAILDROP_LOG_FILE

    def __setstate__(self, state):


Generated by  Doxygen 1.6.0   Back to index