For days I'm trying to fix my outgoing mail problem. I believe I have seen and tried every possible solution on the internet by now.
This is my last resort
The issue : All outgoing mails stay in the mail queue (referred) with a connection time out.
I tried disabling the Firewall, ClamAV, AMaVIS, Spamassassin.
I opened ports 25, 465, 10024, 10026
I did some Postfix rebuilds, etc...
This is an example of an email in the /var/log/maillog :
Aug 26 14:16:59 p00psc00p postfix/smtpd[435198]: 67FED740213F: client=localhost[127.0.0.1]
Aug 26 14:16:59 p00psc00p postfix/cleanup[435111]: 67FED740213F: message-id=<6465046723fbb34f8cd586083502efd6@c****ge.org>
Aug 26 14:16:59 p00psc00p postfix/qmgr[434249]: 67FED740213F: from=<****@c****ge.org>, size=961, nrcpt=1 (queue active)
Aug 26 14:16:59 p00psc00p postfix/smtp[435112]: 15F337401DDE: to=<red****@proton.me>, relay=127.0.0.1[127.0.0.1]:10024, delay=34, delays=0.07/0.03/0.02/34, dsn=2.0.0, status=sent (250 2.0.0 from MTA(smtp:[127.0.0.1]:10025): 250 2.0.0 Ok: queued as 67FED740213F)
Aug 26 14:19:29 p00psc00p postfix/smtp[435199]: 67FED740213F: to=<red****s@proton.me>, relay=none, delay=150, delays=0.01/0.02/150/0, dsn=4.4.1, status=deferred (connect to mailsec.protonmail.ch[185.70.42.129]:25: Connection timed out)
Aug 26 14:25:43 p00psc00p postfix/qmgr[436451]: 67FED740213F: from=<****@****ge.org>, size=961, nrcpt=1 (queue active)
Aug 26 14:27:49 p00psc00p postfix/pickup[436450]: 481F7740213E: uid=89 from=<****@c****ge.org> orig_id=67FED740213F
Aug 26 14:28:13 p00psc00p postfix/smtp[436454]: 67FED740213F: to=<red****@proton.me>, relay=none, delay=674, delays=524/0.06/150/0, dsn=4.4.1, status=deferred (connect to mailsec.protonmail.ch[185.70.42.129]:25: Connection timed out)
An overview of the related ports
25/tcp 4/- - (576800/root) /usr/libexec/postfix/master -w /usr/libexec/postfix/master
110/tcp 4/- - (449907/root) /usr/sbin/dovecot -F /usr/sbin/dovecot
143/tcp 4/- 1 (449907/root) /usr/sbin/dovecot -F /usr/sbin/dovecot
143/tcp 4/- 1 (598502/dovenull) dovecot/imap-login /usr/libexec/dovecot/imap-login
143/tcp 4/- 1 (599460/dovenull) dovecot/imap-login /usr/libexec/dovecot/imap-login
143/tcp 4/- 1 (599461/dovenull) dovecot/imap-login /usr/libexec/dovecot/imap-login
465/tcp 4/- - (576800/root) /usr/libexec/postfix/master -w /usr/libexec/postfix/master
587/tcp 4/- - (576800/root) /usr/libexec/postfix/master -w /usr/libexec/postfix/master
783/tcp -/- - (446611/root) /usr/bin/perl -T -w /usr/bin/spamd -... /usr/bin/perl
783/tcp -/- - (446628/root) spamd child /usr/bin/perl
783/tcp -/- - (446629/root) spamd child /usr/bin/perl
953/tcp -/- - (601562/named) /usr/sbin/named -u named -c /etc/nam... /usr/sbin/named
993/tcp 4/- 3 (449907/root) /usr/sbin/dovecot -F /usr/sbin/dovecot
993/tcp 4/- 3 (598502/dovenull) dovecot/imap-login /usr/libexec/dovecot/imap-login
993/tcp 4/- 3 (599460/dovenull) dovecot/imap-login /usr/libexec/dovecot/imap-login
993/tcp 4/- 3 (599461/dovenull) dovecot/imap-login /usr/libexec/dovecot/imap-login
995/tcp 4/- - (449907/root) /usr/sbin/dovecot -F /usr/sbin/dovecot
4190/tcp -/- - (449907/root) /usr/sbin/dovecot -F /usr/sbin/dovecot
10024/tcp 4/- - (448858/amavis) /usr/sbin/amavisd (master) /usr/bin/perl
10024/tcp 4/- - (448891/amavis) /usr/sbin/amavisd (ch3-avail) /usr/bin/perl
10024/tcp 4/- - (448892/amavis) /usr/sbin/amavisd (ch3-avail) /usr/bin/perl
At this moment I commented out "#content_filter=smtp-amavis:[127.0.0.1]:10024" in /etc/postfix/main.cf
and also in master.cf
When I send an email to another account on the same server, the message is getting delivered without an issue.