1

Topic: a problem with iRedmail+Amavis-new

==== REQUIRED BASIC INFO OF YOUR IREDMAIL SERVER ====
- iRedMail version (check /etc/iredmail-release): 1.0
- Deployed with iRedMail Easy or the downloadable installer? downloadable installer
- Linux/BSD distribution name and version:  Debian GNU/Linux 9 (stretch)
- Store mail accounts in which backend (LDAP/MySQL/PGSQL):  MySQL
- Web server (Apache or Nginx): Nginx
- Manage mail accounts with iRedAdmin-Pro? Yes
- [IMPORTANT] Related original log or error message is required if you're experiencing an issue.
====
Hi!
When I completely disable all features (virus/spam scanning, keep DKIM signing/verification and Disclaimer),
comment out  below lines in Postfix config file /etc/postfix/main.cf:
#content_filter = smtp-amavis:[127.0.0.1]:10024
and
comment out below line in Postfix config file /etc/postfix/master.cf :
#  -o content_filter=smtp-amavis:[127.0.0.1]:10026
everything works fine!
But when I enabling it's in config file /etc/postfix/main.cf:
content_filter = smtp-amavis:[127.0.0.1]:10024
and in config file /etc/postfix/master.cf :
  -o content_filter=smtp-amavis:[127.0.0.1]:10026
and  in config file /etc/amavis/conf.d/50-user:
  bypass_spam_checks_maps => [1],
  bypass_virus_checks_maps => [1],
most mail stops sending whith message :
lost connection with aaa.bbbb.ccc[111.222.333.444] while sending end of data -- message may be sent more than once.
In the detailed log file:
..postfix/smtp[58609]: smtp_connect_addr: trying: aaa.bbb.ccc[111.222.333.444] port 25...
..postfix/smtp[58609]: vstream_tweak_tcp: TCP_MAXSEG 1368
..postfix/smtp[58609]: smtp_stream_setup: maxtime=120 enable_deadline=0
..postfix/smtp[58609]: < aaa.bbb.ccc[111.222.333.444]:25: 220 ***************************************
..postfix/smtp[58609]: > aaa.bbb.ccc[111.222.333.444]:25: EHLO mail.mydomain
..postfix/smtp[58609]: < aaa.bbb.ccc[111.222.333.444]:25: 250-aaa.bbb.ccc Hello ns1.mydomain [555.555.555.555]
! (mail.mydomain and ns1.mydomain it's the same host 555.555.555.555)
..postfix/smtp[58609]: < aaa.bbb.ccc[111.222.333.444]:25: 250-SIZE 52428800
..postfix/smtp[58609]: < aaa.bbb.ccc[111.222.333.444]:25: 250-8BITMIME
..postfix/smtp[58609]: < aaa.bbb.ccc[111.222.333.444]:25: 250-VRFY
..postfix/smtp[58609]: < aaa.bbb.ccc[111.222.333.444]:25: 250-PIPELINING
..postfix/smtp[58609]: < aaa.bbb.ccc[111.222.333.444]:25: 250-AUTH LOGIN PLAIN
..postfix/smtp[58609]: < aaa.bbb.ccc[111.222.333.444]:25: 250-XXXXXXXA
..postfix/smtp[58609]: < aaa.bbb.ccc[111.222.333.444]:25: 250-XXXXXXXB
..postfix/smtp[58609]: < aaa.bbb.ccc[111.222.333.444]:25: 250 XXXC
..postfix/smtp[58609]: server features: 0x100f size 52428800
..postfix/smtp[58609]: Using ESMTP PIPELINING, TCP send buffer size is 1387008, PIPELINING buffer size is 4096
..postfix/smtp[58609]: smtp_stream_setup: maxtime=300 enable_deadline=0
..postfix/smtp[58609]: > aaa.bbb.ccc[111.222.333.444]:25: MAIL FROM:<user1@mydomain> SIZE=4279912 BODY=7BIT
..postfix/smtp[58609]: > aaa.bbb.ccc[111.222.333.444]:25: RCPT TO:<info@recipient.domain>
..postfix/smtp[58609]: > aaa.bbb.ccc[111.222.333.444]:25: DATA
..postfix/smtp[58609]: smtp_stream_setup: maxtime=300 enable_deadline=0
..postfix/smtp[58609]: < aaa.bbb.ccc[111.222.333.444]:25: 250 OK
..postfix/smtp[58609]: smtp_stream_setup: maxtime=300 enable_deadline=0
..postfix/smtp[58609]: < aaa.bbb.ccc[111.222.333.444]:25: 250 Accepted
..postfix/smtp[58609]: smtp_stream_setup: maxtime=240 enable_deadline=0
..postfix/smtp[58609]: < aaa.bbb.ccc[111.222.333.444]:25: 354 Enter message, ending with "." on a line by itself
..postfix/smtp[58609]: smtp_stream_setup: maxtime=600 enable_deadline=0
..postfix/smtp[58609]: smtp_fputs: EOF
..postfix/smtp[58609]: smtp_stream_setup: maxtime=600 enable_deadline=0
..postfix/smtp[58609]: smtp_get: EOF
..postfix/smtp[58609]: connect to subsystem private/defer
..postfix/smtp[58609]: send attr nrequest = 0
..postfix/smtp[58609]: send attr flags = 0
..postfix/smtp[58609]: send attr queue_id = 47c3Ys4VFqz2XTMd
..postfix/smtp[58609]: send attr original_recipient =
..postfix/smtp[58609]: send attr recipient = info@recipient.domain
..postfix/smtp[58609]: send attr offset = 723
..postfix/smtp[58609]: send attr dsn_orig_rcpt = rfc822;info@recipient.domain
..postfix/smtp[58609]: send attr notify_flags = 0
..postfix/smtp[58609]: send attr status = 4.4.2
..postfix/smtp[58609]: send attr diag_type =
..postfix/smtp[58609]: send attr diag_text =
..postfix/smtp[58609]: send attr mta_type =
..postfix/smtp[58609]: send attr mta_mname =
..postfix/smtp[58609]: send attr action = delayed
..postfix/smtp[58609]: send attr reason = lost connection with aaa.bbb.ccc[111.222.333.444] while sending message body
..postfix/smtp[58609]: private/defer socket: wanted attribute: status
..postfix/smtp[58609]: input attribute name: status
..postfix/smtp[58609]: input attribute value: 0
..postfix/smtp[58609]: private/defer socket: wanted attribute: (list terminator)
..postfix/smtp[58609]: input attribute name: (end)
..postfix/smtp[58609]: 47c3Ys4VFqz2XTMd: to=<info@recipient.domain>, relay=aaa.bbb.ccc[111.222.333.444]:25, delay=620, delays=620/0.01/0.01/0.24, dsn=4.4.2, status=deferred (lost connection with aaa.bbb.ccc[111.222.333.444] while sending message body)
..postfix/smtp[58609]: flush_add: site recipient.domain id 47c3Ys4VFqz2XTMd
..postfix/smtp[58609]: match_hostname: fast_flush_domains: recipient.domain ~? mail.mydomain
..postfix/smtp[58609]: match_hostname: fast_flush_domains: recipient.domain ~? localhost
..postfix/smtp[58609]: match_hostname: fast_flush_domains: recipient.domain ~? localhost.localdomain
..postfix/smtp[58609]: match_hostname: fast_flush_domains: recipient.domain ~? proxy:mysql:/etc/postfix/mysql/relay_domains.cf(0,lock|utf8_request)
..postfix/smtp[58609]: connect to subsystem private/proxymap
..postfix/smtp[58609]: send attr request = lookup
..postfix/smtp[58609]: send attr table = mysql:/etc/postfix/mysql/relay_domains.cf
..postfix/smtp[58609]: send attr flags = 524352
..postfix/smtp[58609]: send attr key = recipient.domain
..postfix/smtp[58609]: private/proxymap socket: wanted attribute: status
..postfix/smtp[58609]: input attribute name: status
..postfix/smtp[58609]: input attribute value: 1
..postfix/smtp[58609]: private/proxymap socket: wanted attribute: value
..postfix/smtp[58609]: input attribute name: value
..postfix/smtp[58609]: input attribute value: (end)
..postfix/smtp[58609]: private/proxymap socket: wanted attribute: (list terminator)
..postfix/smtp[58609]: input attribute name: (end)
..postfix/smtp[58609]: dict_proxy_lookup: table=mysql:/etc/postfix/mysql/relay_domains.cf flags=lock|utf8_request key=recipient.domain -> status=1 result=
..postfix/smtp[58609]: send attr request = lookup
..postfix/smtp[58609]: send attr table = mysql:/etc/postfix/mysql/relay_domains.cf
..postfix/smtp[58609]: send attr flags = 524352
..postfix/smtp[58609]: send attr key = domain
..postfix/smtp[58609]: private/proxymap socket: wanted attribute: status
..postfix/smtp[58609]: input attribute name: status
..postfix/smtp[58609]: input attribute value: 1
..postfix/smtp[58609]: private/proxymap socket: wanted attribute: value
..postfix/smtp[58609]: input attribute name: value
..postfix/smtp[58609]: input attribute value: (end)
..postfix/smtp[58609]: private/proxymap socket: wanted attribute: (list terminator)
..postfix/smtp[58609]: input attribute name: (end)
..postfix/smtp[58609]: dict_proxy_lookup: table=mysql:/etc/postfix/mysql/relay_domains.cf flags=lock|utf8_request key=ua -> status=1 result=
..postfix/smtp[58609]: match_list_match: recipient.domain: no match
..postfix/smtp[58609]: flush_add: site recipient.domain id 47c3Ys4VFqz2XTMd status 4
..postfix/smtp[58609]: name_mask: resource
..postfix/smtp[58609]: name_mask: software
..postfix/smtp[58609]: deliver_request_final: send: "lost connection with aaa.bbb.ccc[111.222.333.444] while sending message body" -1
..postfix/smtp[58609]: send attr status = 4.4.2
..postfix/smtp[58609]: send attr diag_type =
..postfix/smtp[58609]: send attr diag_text =
..postfix/smtp[58609]: send attr mta_type =
..postfix/smtp[58609]: send attr mta_mname =
..postfix/smtp[58609]: send attr action =
..postfix/smtp[58609]: send attr reason = lost connection with aaa.bbb.ccc[111.222.333.444] while sending message body
..postfix/smtp[58609]: send attr status = 4294967295
..postfix/smtp[58609]: master_notify: status 1
..postfix/smtp[58609]: connection closed
..postfix/smtp[58609]: proxymap stream disconnect

  Next my step is completely disable all features:
#content_filter = smtp-amavis:[127.0.0.1]:10024     in Postfix config file /etc/postfix/main.cf
and
#  -o content_filter=smtp-amavis:[127.0.0.1]:10026  in Postfix config file /etc/postfix/master.cf
and restart postfix.
   When I give a command
# postfix flush,  I get:
..postfix/smtp[19384]: < aaa.bbb.ccc[111.222.333.444]:25: 250-SIZE 52428800
..postfix/smtp[19384]: < aaa.bbb.ccc[111.222.333.444]:25: 250-8BITMIME
..postfix/smtp[19384]: < aaa.bbb.ccc[111.222.333.444]:25: 250-VRFY
..postfix/smtp[19384]: < aaa.bbb.ccc[111.222.333.444]:25: 250-PIPELINING
..postfix/smtp[19384]: < aaa.bbb.ccc[111.222.333.444]:25: 250-AUTH LOGIN PLAIN
..postfix/smtp[19384]: < aaa.bbb.ccc[111.222.333.444]:25: 250-XXXXXXXA
..postfix/smtp[19384]: < aaa.bbb.ccc[111.222.333.444]:25: 250-XXXXXXXB
..postfix/smtp[19384]: < aaa.bbb.ccc[111.222.333.444]:25: 250 XXXC
..postfix/smtp[19384]: server features: 0x100f size 52428800
..postfix/smtp[19384]: Using ESMTP PIPELINING, TCP send buffer size is 1387008, PIPELINING buffer size is 4096
..postfix/smtp[19384]: smtp_stream_setup: maxtime=300 enable_deadline=0
..postfix/smtp[19384]: > aaa.bbb.ccc[111.222.333.444]:25: MAIL FROM:<user1@mydomain> SIZE=12111 BODY=7BIT
..postfix/smtp[19384]: > aaa.bbb.ccc[111.222.333.444]:25: RCPT TO:<info@recipient.domain>
..postfix/smtp[19384]: > aaa.bbb.ccc[111.222.333.444]:25: DATA
..postfix/smtp[19384]: smtp_stream_setup: maxtime=300 enable_deadline=0
Dec 16 12:58:50 mail postfix/smtp[19384]: < aaa.bbb.ccc[111.222.333.444]:25: 250 OK
Dec 16 12:58:50 mail postfix/smtp[19384]: smtp_stream_setup: maxtime=300 enable_deadline=0
Dec 16 12:58:50 mail postfix/smtp[19384]: < aaa.bbb.ccc[111.222.333.444]:25: 250 Accepted
Dec 16 12:58:50 mail postfix/smtp[19384]: smtp_stream_setup: maxtime=240 enable_deadline=0
Dec 16 12:58:50 mail postfix/smtp[19384]: < aaa.bbb.ccc[111.222.333.444]:25: 354 Enter message, ending with "." on a line by itself
Dec 16 12:58:50 mail postfix/smtp[19384]: smtp_stream_setup: maxtime=600 enable_deadline=0
Dec 16 12:58:50 mail postfix/smtp[19384]: > aaa.bbb.ccc[111.222.333.444]:25: .
Dec 16 12:58:50 mail postfix/smtp[19384]: > aaa.bbb.ccc[111.222.333.444]:25: QUIT
Dec 16 12:58:50 mail postfix/smtp[19384]: smtp_stream_setup: maxtime=600 enable_deadline=0
Dec 16 12:58:50 mail postfix/smtp[19384]: smtp_get: EOF
Dec 16 12:58:50 mail postfix/smtp[19384]: connect to subsystem private/defer
Dec 16 12:58:50 mail postfix/smtp[19384]: send attr nrequest = 0
Dec 16 12:58:50 mail postfix/smtp[19384]: send attr flags = 0
Dec 16 12:58:50 mail postfix/smtp[19384]: send attr queue_id = 47c3Ys4VFqz2XTMd
Dec 16 12:58:50 mail postfix/smtp[19384]: send attr original_recipient =
Dec 16 12:58:50 mail postfix/smtp[19384]: send attr recipient = info@recipient.domain
  Then you have to delete this e-mail from the queue and send it again..
  Help me, please, with this problem. Why the inclusion of a content filter prevents sending most part of e-mails?
  What prevents my server from completing sending a message?
  I also requested a session log from the recipient.domain.
  Thank's you.

Post's attachments

50_user 12.71 kb, 1 downloads since 2019-12-16 

main.cf 13.44 kb, 1 downloads since 2019-12-16 

master.cf 8.98 kb, 1 downloads since 2019-12-16 

You don't have the permssions to download the attachments of this post.

2

Re: a problem with iRedmail+Amavis-new

Looks like caused while restarting amavisd service.

Please try it this way:

- Enable the content filter.
- Run "postqueue -f" and wait for Postfix to send out all queued emails.
- Disable the amavisd integration in Postfix.

----

Does my reply help a little? How about buying me a cup of coffee ($5) as an encouragement?

buy me a cup of coffee

3 (edited by igor 2019-12-18 20:52:48)

Re: a problem with iRedmail+Amavis-new

Ok.
- restart Amavis-new
- Enable the content filter.
- Run "postqueue -f" and wait for Postfix to send out all queued emails.
- Disable the amavisd integration in Postfix.
Result - some letters are sent normally, some are not sent and  and it is not clear why... , but if I disable the amavisd integration in Postfix all work fine.

Post's attachments

mail_18.12.2019.log 248.1 kb, file has never been downloaded. 

You don't have the permssions to download the attachments of this post.

4

Re: a problem with iRedmail+Amavis-new

I have a question: if I completely disable the content filter (amavis-new), will white/gray/black lists work? or not?

5

Re: a problem with iRedmail+Amavis-new

SMTP session based white/black/graylisting will continue working (it's done by iRedAPD). But content-based white/blacklisting will not work because they're done by AMavisd (it calls spamassassin and clamav).

----

Does my reply help a little? How about buying me a cup of coffee ($5) as an encouragement?

buy me a cup of coffee

6

Re: a problem with iRedmail+Amavis-new

Thanks for the quick response.
The white/black/gray lists based on the SMTP session are enough for me.