Commits

Zhang Huangbin committed eae4e7b

Sync.

Comments (0)

Files changed (3)

etc/iredapd.ini

-[general]
-listen_addr     = 127.0.0.1
-listen_port     = 7777
-
-# Background/daemon mode: yes, no.
-# Detach iredapd from terminal. Enable when you're happy
-# that things are working as expected.
-run_as_daemon   = yes
-
-# Path to pid file.
-pid_file        = /var/run/iredapd.pid
-
-# Log type: file, mysql.
-# Note:
-#   - Currently, only 'file' type is supported.
-#   - If log_type is 'file', log_file is required.
-#   - If log_type is 'mysql', sql related info are required.
-log_type        = file
-log_file        = /var/log/iredapd.log
-
-log_sql_server  = 127.0.0.1
-log_sql_port    = 3306
-log_sql_dbname  = iredadmin
-log_sql_dbuser  = iredadmin
-log_sql_dbpass  = your_passwd
-
-# Log level: info, warning, error, debug.
-# 'info' is recommended for product use.
-log_level       = info
-
-# Default action: bypass, reject.
-# If no access policy returned, use this default action.
-default_action  = bypass
-
-[ldap]
-# LDAP server setting.
-# Uri must starts with ldap:// or ldaps:// (TLS/SSL).
-uri         = ldap://127.0.0.1:389
-binddn      = cn=vmail,dc=iredmail,dc=org
-bindpw      = 5NC4VyRJdws3ounpcKJw9zXu0B8ou6
-basedn      = o=domains,dc=iredmail,dc=org
-
-# Attribute name which used to store mail list access policy
-attr_access_policy  = accessPolicy
-
-# LDAP filter used to search mail list
-# Note: placeholder '%(recipient)s' can be used here, will be
-# replaced by mail list address.
-filter_maillist = (&(mail=%(recipient)s)(objectclass=mailList)(accountStatus=active)(enabledService=mail)(enabledService=deliver))
-
-# LDAP filter used to search members of mail list
-# Note:
-# - placeholder '%(recipient)s' can be used here, will be replacd
-#   by mail list address.
-# - placeholder '%(sender)s' can be used here, will be replaced
-#   by sender address.
-filter_member   = (&(memberOfGroup=%(recipient)s)(objectclass=mailUser)(accountStatus=active)(enabledService=mail)(enabledService=deliver)(mail=%(sender)s))
-
-# LDAP filter used to search allowed users.
-# Note:
-# - placeholder '%(recipient)s' can be used here, will be replacd
-#   by mail list address.
-# - placeholder '%(sender)s' can be used here, will be replaced
-#   by sender address.
-filter_allowed_senders = (&(mail=%(recipient)s)(objectclass=mailList)(accountStatus=active)(enabledService=mail)(enabledService=deliver)(listAllowedUser=%(sender)s))

etc/iredapd.ini.sample

+[general]
+# Listen address and port.
+listen_addr     = 127.0.0.1
+listen_port     = 7777
+
+# Background/daemon mode: yes, no.
+# Detach iredapd from terminal. Enable when you're happy
+# that things are working as expected.
+run_as_daemon   = yes
+
+# Path to pid file.
+pid_file        = /var/run/iredapd.pid
+
+# Log type: file.
+# Note:
+#   - Currently, only 'file' type is supported.
+#   - If log_type is 'file', log_file is required.
+#   - If log_type is 'mysql', sql related info are required.
+log_type        = file
+log_file        = /var/log/iredapd.log
+
+log_sql_server  = 127.0.0.1
+log_sql_port    = 3306
+log_sql_dbname  = iredadmin
+log_sql_dbuser  = iredadmin
+log_sql_dbpass  = your_passwd
+
+# Log level: info, warning, error, debug.
+# 'info' is recommended for product use.
+log_level       = info
+
+[ldap]
+# LDAP server setting.
+# Uri must starts with ldap:// or ldaps:// (TLS/SSL).
+uri         = ldap://127.0.0.1:389
+binddn      = cn=vmail,dc=iredmail,dc=org
+bindpw      = 5NC4VyRJdws3ounpcKJw9zXu0B8ou6
+basedn      = o=domains,dc=iredmail,dc=org
+
+# Attribute name which used to store mail list access policy
+attr_access_policy  = accessPolicy
+
+# LDAP filter used to search mail list
+# Note: placeholder '%(recipient)s' can be used here, will be
+# replaced by mail list address.
+filter_maillist = (&(mail=%(recipient)s)(objectclass=mailList)(accountStatus=active)(enabledService=mail)(enabledService=deliver))
+
+# LDAP filter used to search members of mail list
+# Note:
+# - placeholder '%(recipient)s' can be used here, will be replacd
+#   by mail list address.
+# - placeholder '%(sender)s' can be used here, will be replaced
+#   by sender address.
+filter_member   = (&(memberOfGroup=%(recipient)s)(objectclass=mailUser)(accountStatus=active)(enabledService=mail)(enabledService=deliver)(mail=%(sender)s))
+
+# LDAP filter used to search allowed users.
+# Note:
+# - placeholder '%(recipient)s' can be used here, will be replacd
+#   by mail list address.
+# - placeholder '%(sender)s' can be used here, will be replaced
+#   by sender address.
+filter_allowed_senders = (&(mail=%(recipient)s)(objectclass=mailList)(accountStatus=active)(enabledService=mail)(enabledService=deliver)(listAllowedUser=%(sender)s))
 ACTION_ACCEPT = "action=OK"
 ACTION_DEFER = "action=DEFER_IF_PERMIT Service temporarily unavailable"
 ACTION_REJECT = 'action=REJECT Not Authorized'
+ACTION_DEFAULT = ACTION_REJECT
 
 # Get config file.
 if len(sys.argv) != 2:
 cfg = ConfigParser.SafeConfigParser()
 cfg.read(config_file)
 
-ACTION_DEFAULT = cfg.get('general', 'default_action', 'bypass')
-if ACTION_DEFAULT == 'bypass':
-    ACTION_DEFAULT = ACTION_ACCEPT
-elif ACTION_DEFAULT == 'defer':
-    ACTION_DEFAULT = ACTION_DEFER
-elif ACTION_DEFAULT == 'reject':
-    ACTION_DEFAULT = ACTION_REJECT
-
 class apdChannel(asynchat.async_chat):
     def __init__(self, conn, remoteaddr):
         asynchat.async_chat.__init__(self, conn)