Commits

Zhang Huangbin committed bc642d8

New option for iredapd-rr: bypass_mynetworks. Used to bypass mails sent from postfix mynetworks.

Comments (0)

Files changed (3)

 iRedAPD-1.3.4:
+    * New option for iredapd-rr: bypass_mynetworks. Used to bypass mails sent
+      from postfix mynetworks.
     * Bypass user alias addresses (shadowAddress) if user is allowed to send
       to mail list. Thanks Henri Veldsink for his feedback and testing.
     * Allow to use same logging hander in plugins, print plugin debug message.

etc/iredapd-rr.ini.sample

 # Backend: ldap, mysql.
 backend = ldap
 
+# Bypass clients listed in postfix 'mynetworks': yes, no.
+bypass_mynetworks = no
+
 [ldap]
 # For ldap backend only.
 # LDAP server setting.

src/iredapd-rr.py

             if len(self.plugins) > 0:
 
                 # Get account dn and LDIF data.
-                senderDN, senderLdif = self.__get_sender_dn_ldif(map['sasl_username'])
+                bypass_mynetworks = cfg.get('general', 'bypass_mynetworks', 'no')
+                if bypass_mynetworks == 'yes':
+                    sender = map['sasl_username']
+                else:
+                    sender = map['sender']
+
+                senderDN, senderLdif = self.__get_sender_dn_ldif(sender)
 
                 # Return if recipient account doesn't exist.
                 if senderDN is None or senderLdif is None: