1

Topic: Disable greylisting for user do not work / iredAPD 1.7 + iRedAdmin 2.2

==== Required information ====
- iRedMail version (check /etc/iredmail-release): 0.9.3
- Linux/BSD distribution name and version: FreeBSD 9.1
- Store mail accounts in which backend (LDAP/MySQL/PGSQL): Mysql
- Web server (Apache or Nginx):Apache
- Manage mail accounts with iRedAdmin-Pro?yes
- Related log if you're reporting an issue: iredapd.log
====

Hello
Disable greylisting for user do not work ??

i have disabled option "Enable greylisting for this user" in Admin-Pro panel on user Profile
I checked even in the database, and is not active   

+----+---------------------+----------+--------+-----------------+---------+--------+
| id | account             | priority | sender | sender_priority | comment | active |
+----+---------------------+----------+--------+-----------------+---------+--------+
| XX | user@domain.xxx     |        0 | @.     |               0 |         |      0 |


but in iredapd.log and maillog I see that it still works

2016-01-05 15:40:18 INFO [XX.XX.XXX.XXX] RCPT, xxxx@xxx.xxx.xx -> user@domain.xxx, 451 4.7.1 Intended policy rejection, please try again later


I might add that I was unable to find instructions for migrating from policyd-1.8 to iredAPD 1.7
so I do not migrated any old settings.

I only use option "Enable greylisting for this user" to save in database information about this user account

----

Spider Email Archiver: On-Premises, lightweight email archiving software developed by iRedMail team. Supports Amazon S3 compatible storage and custom branding.

2

Re: Disable greylisting for user do not work / iredAPD 1.7 + iRedAdmin 2.2

A bug in iRedAdmin-Pro. Please fix it with patch below:

diff -r 99fba338ed8d -r d98625ecf02e libs/iredapd/greylist.py
--- a/libs/iredapd/greylist.py    Fri Dec 18 22:58:45 2015 +0800
+++ b/libs/iredapd/greylist.py    Fri Dec 18 23:19:58 2015 +0800
@@ -76,7 +76,8 @@
 
     def enable_disable_greylist_setting(self, account, enable=False):
         """Update (or create) greylisting setting of specified account."""
-        if not iredutils.is_valid_amavisd_address(account):
+        account_type = iredutils.is_valid_amavisd_address(account)
+        if not account_type:
             return (False, 'INVALID_ACCOUNT')
 
         active = 0
@@ -84,7 +85,7 @@
             active = 1
 
         gl_setting = {'account': account,
-                      'priority': iredutils.IREDAPD_ACCOUNT_PRIORITIES.get(account, 0),
+                      'priority': iredutils.IREDAPD_ACCOUNT_PRIORITIES.get(account_type, 0),
                       'sender': '@.',
                       'sender_priority': 0,
                       'active': active}

3

Re: Disable greylisting for user do not work / iredAPD 1.7 + iRedAdmin 2.2

Zhang,
    This patch file doesn't work for BSD installations.. looks like the file locations are different.
greylisting.py is in /opt/iredapd/plugins. Before I modify the patch, I'd like to verify that is the only difference.

I'm running it with patch -C to check before modify.

4

Re: Disable greylisting for user do not work / iredAPD 1.7 + iRedAdmin 2.2

Hi @sgroom,

This patch is for iRedAdmin-Pro, not for iRedAPD.