Article 5188T Postfix: Connection refused when sending to smart host

Postfix: Connection refused when sending to smart host

by
InvalidUserName
from LinuxQuestions.org on (#5188T)
Hello!

I am currently setting up my new mail server at home using postfix and dovecot. The server is connected to the Internet via DSL, i.e. with a dynamic IP. Therefore I got postfix up and running using several smart hosts with the sender dependent auth to forward e-mails to two different mail providers.

However, I just cannot get postfix to send out the e-mails. All mails are just piling up in mailq with status deferred. Unfortunately, mail.log is rather uninformative showing not more than "Connection refused".

Here is the terribly unhelpful mail.log:

Code:607FC1FF8A: from=<user2@example2>, size=599, nrcpt=1 (queue active)
connect to mailgateway.provider[xx.xx.xx.xx]:25: Connection refused
607FC1FF8A: to=<xyz@gmail.com>, relay=none, delay=1174, delays=1174/0.02/0.49/0, dsn=4.4.1, status=deferred (connect to mailgateway.provider[xx.xx.xx.xx]:25: Connection refused)My provider offers (S)SMTP via port 465 or TLS via 25. Going to port 465 I got back the following

Code:SMTPS wrappermode (TCP port 465) requires setting "smtp_tls_wrappermode = yes", and "smtp_tls_security_level = encrypt" (or stronger)
connect to mailgateway.provider[xx.xx.xx.xx]:465: Connection refusedSetting smtp_tls_wrappermode and smtp_tls_security accordingly at main.cf of postfix and I am back to
Code:connect to mailgateway.provider[xx.xx.xx.xx]:465: Connection refusedDoing a openssl s_client -crlf -connect provider:465 runs through without any issues, doing openssl s_client -crlf -connect provider:25 returns
Code:139950738130048:error:0200206F:system library:connect:Connection refused:../crypto/bio/b_sock2.c:110:
139950738130048:error:2008A067:BIO routines:BIO_connect:connect error:../crypto/bio/b_sock2.c:111:connect:errno=111I first thought I had some issues with postfix, but then I found a post suggesting to remove "noplaintext" from smtp_sasl_security_options in main.cf of postfix. That did the trick for the other mail provider but does not turn things with the (main) provider above.

At the same time, I can send e-mails from my computer to the very same mail provider directly via Thunderbird using port 465. At the server, I did not (yet) set up any iptables and there should be nothing else blocking access. Adresses are being mapped from local to the real ones by postfix.

I wish I could provide more log files or at least some with more info, but that is all I got myself.

Appreciate any bit of advice because I really do not know what to do now.
Thank you all in advance.latest?d=yIl2AUoC8zA latest?i=X0N9lOVnMMY:3alqzk6QfPA:F7zBnMy latest?i=X0N9lOVnMMY:3alqzk6QfPA:V_sGLiP latest?d=qj6IDK7rITs latest?i=X0N9lOVnMMY:3alqzk6QfPA:gIN9vFwX0N9lOVnMMY
External Content
Source RSS or Atom Feed
Feed Location https://feeds.feedburner.com/linuxquestions/latest
Feed Title LinuxQuestions.org
Feed Link https://www.linuxquestions.org/questions/
Reply 0 comments