Zhang Huangbin avatar 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:
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.