Source

iredapd / src / plugins / sql_alias_access_policy.py

Diff from to

src/plugins/sql_alias_access_policy.py

 
 def restriction(dbConn, senderReceiver, smtpSessionData, logger, **kargs):
 
-    sql = '''SELECT accesspolicy, goto, moderators \
-            FROM alias \
-            WHERE address=%s AND domain=%s AND active=1 \
-            LIMIT 1 \
-    ''' % (sqlquote(senderReceiver.get('recipient')), sqlquote(senderReceiver.get('recipient_domain')),)
+    sql = '''SELECT accesspolicy, goto, moderators
+            FROM alias
+            WHERE
+                address=%s
+                AND address <> goto
+                AND domain=%s
+                AND active=1
+            LIMIT 1
+    ''' % (sqlquote(senderReceiver.get('recipient')),
+           sqlquote(senderReceiver.get('recipient_domain')),
+          )
     logger.debug('SQL: %s' % sql)
 
     dbConn.execute(sql)