1

Topic: banned email not returned to sender with "user unknown"

==== Required information ====
- iRedMail version (check /etc/iredmail-release): v0.9.6
- Linux/BSD distribution name and version: debian 8.8
- Store mail accounts in which backend (LDAP/MySQL/PGSQL): mysql
- Web server (Apache or Nginx): apache
- Manage mail accounts with iRedAdmin-Pro? yes v2.6.0 (MySQL)
- [IMPORTANT] Related original log or error message is required if you're experiencing an issue.
====

If have configured amavis to inform the sender if his email is banned.
Then sender sends the email, using one of his alias, postfix is unable to inform him of the banned email, because somehow the alias is not recognized.

Jun  2 13:36:22 mail postfix/submission/smtpd[31970]: connect from client.gr [XXXXXXXXX]
Jun  2 13:36:22 mail postfix/submission/smtpd[31970]: Anonymous TLS connection established from client.gr [XXXXXXXXX]: TLSv1.2 with cipher XXX-RSA-XX-GCM-XXX (128/128 bits)
Jun  2 13:36:22 mail postfix/submission/smtpd[31970]: C27C21CC0076: client=client.gr [XXXXXXXXX], sasl_method=PLAIN, sasl_username=full.name@myserver.gr
Jun  2 13:36:22 mail postfix/cleanup[29877]: C27C21CC0076: message-id=<d10c14d5-e755-f08a-6b25-5296a3116000@myserver.gr>
Jun  2 13:36:22 mail postfix/qmgr[29796]: C27C21CC0076: from=<alias.for-full.name@myserver.gr>, size=13114, nrcpt=1 (queue active)
Jun  2 13:36:22 mail amavis[30397]: (!)loading policy bank "ORIGINATING": unknown field "warnbannedrecip"
Jun  2 13:36:22 mail amavis[30397]: (30397-08) (!)loading policy bank "MYNETS": unknown field "warnbannedrecip"
Jun  2 13:36:22 mail postfix/submission/smtpd[31970]: disconnect from client.gr [XXXXXXXXX]
Jun  2 13:36:23 mail postfix/10025/smtpd[31679]: 06BDD1CC0078: client=localhost[127.0.0.1]
Jun  2 13:36:23 mail postfix/cleanup[30599]: 06BDD1CC0078: message-id=<VAtPIILRLmi7-P@mail.myserver.gr>
Jun  2 13:36:23 mail postfix/qmgr[29796]: 06BDD1CC0078: from=<postmaster@myserver.gr>, size=2861, nrcpt=1 (queue active)
Jun  2 13:36:23 mail postfix/10025/smtpd[31679]: disconnect from localhost[127.0.0.1]
Jun  2 13:36:23 mail postfix/10025/smtpd[31660]: connect from localhost[127.0.0.1]
Jun  2 13:36:23 mail postfix/10025/smtpd[31660]: 109DC1CC0079: client=localhost[127.0.0.1]
Jun  2 13:36:23 mail postfix/pipe[31620]: 06BDD1CC0078: to=<postmaster@myserver.gr>, relay=dovecot, delay=0.05, delays=0.01/0/0/0.04, dsn=2.0.0, status=sent (delivered via dovecot service)
Jun  2 13:36:23 mail postfix/qmgr[29796]: 06BDD1CC0078: removed
Jun  2 13:36:23 mail postfix/cleanup[29877]: 109DC1CC0079: message-id=<VStPIILRLmi7-P@mail.myserver.gr>
Jun  2 13:36:23 mail postfix/10025/smtpd[31660]: disconnect from localhost[127.0.0.1]
Jun  2 13:36:23 mail postfix/qmgr[29796]: 109DC1CC0079: from=<>, size=4576, nrcpt=1 (queue active)
Jun  2 13:36:23 mail amavis[30397]: (30397-08) Blocked BANNED (text/plain,.exe,game.py) {BouncedInternal}, ORIGINATING/MYNETS LOCAL [147.102.5.180]:14578 [147.102.5.180] <alias.for-full.name@myserver.gr> -> , Queue-ID: C27C21CC0076, Message-ID: <d10c14d5-e755-f08a-6b25-5296a3116000@myserver.gr>, mail_id: tPIILRLmi7-P, Hits: -, size: 13114, 281 ms
Jun  2 13:36:23 mail postfix/smtp-amavis/smtp[31647]: C27C21CC0076: to=<recipient-of-mail@myserver.gr>, relay=127.0.0.1[127.0.0.1]:10026, delay=0.32, delays=0.02/0/0.01/0.29, dsn=2.5.0, status=sent (250 2.5.0 Ok, id=30397-08, BOUNCE)
Jun  2 13:36:23 mail postfix/qmgr[29796]: C27C21CC0076: removed
Jun  2 13:36:23 mail postfix/pipe[31620]: 109DC1CC0079: to=<alias.for-full.name@myserver.gr>, relay=dovecot, delay=0.05, delays=0.01/0/0/0.04, dsn=5.1.1, status=bounced (user unknown)
Jun  2 13:36:23 mail postfix/qmgr[29796]: 109DC1CC0079: removed

----

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

2

Re: banned email not returned to sender with "user unknown"

And another issue, which i think it is the of the same origin.

If the sender has setup mail forwarding and he send a mail with banned content, the notification of the banned email is not being forwarded, but remains in his mailbox.

3 (edited by nikos.frangakis 2017-06-06 20:39:48)

Re: banned email not returned to sender with "user unknown"

So the problem is apparently the no_address_mappings option.
There are some old threads about similar issues in the forum and also some strike-through (invalid) instructions on the online docs.

Is there an update on this issue? is it resolved in the current version?

p.s. This thread needs to be moved to the iredmail support forum.

4

Re: banned email not returned to sender with "user unknown"

nikos.frangakis wrote:

Jun  2 13:36:22 mail amavis[30397]: (!)loading policy bank "ORIGINATING": unknown field "warnbannedrecip"
Jun  2 13:36:22 mail amavis[30397]: (30397-08) (!)loading policy bank "MYNETS": unknown field "warnbannedrecip"

See this message? Amavisd doesn't support this option anymore.

5

Re: banned email not returned to sender with "user unknown"

I disabled the option warnbannedrecip in amavisd conf file. Now it contains only warnbannesender

The problem remains.

If the sender is an alias, the alias is not translated to the full address and is bounced with user unknown.
Jun  2 13:36:23 mail postfix/pipe[31620]: 109DC1CC0079: to=<alias.for-full.name@myserver.gr>, relay=dovecot, delay=0.05, delays=0.01/0/0/0.04, dsn=5.1.1, status=bounced (user unknown)

6

Re: banned email not returned to sender with "user unknown"

OK, you may need to update /etc/postfix/master.cf, in transport "127.0.0.1:10025", there's an option like this:

    -o receive_override_options=no_header_body_checks,no_unknown_recipient_checks,no_address_mappings

you can try to remove ",no_address_mappings" in this line, restart Postfix and try again.

7 (edited by nikos.frangakis 2017-06-08 17:01:13)

Re: banned email not returned to sender with "user unknown"

ZhangHuangbin wrote:

you can try to remove ",no_address_mappings" in this line, restart Postfix and try again.

Now it seems to work!
I hope this change will not introduce any side effects!

thanks

p.s. for future reference: warnbannedrecip is not supported in the policy banks anymore. It is however supported outside the policy banks with $warnbannedrecip = 1;