I used this and this blog posts to configure postfix to relay mails to a specific server using authentication. The following settings have been made in main.cf:
# sender-dependent sasl authentication
smtp_sender_dependent_authentication = yes
sender_dependent_relayhost_maps = hash:/etc/postfix/sender_relay
# default relayhost setting
relayhost = [fully.qualified.target.server]:587
# smtp authentication settings
smtp_sasl_auth_enable = yes
smtp_sasl_password_maps = lmdb:/etc/postfix/sasl_passwd
smtp_sasl_security_options = noanonymous
smtp_sasl_mechanism_filter = plain
smtp_tls_CAfile = /var/lib/ca-certificates/ca-bundle.pem
smtp_use_tls = yes
smtp_tls_security_level = encrypt
I created /etc/postfix/sender_relay with the following content:
[email protected] [fully.qualified.target.server]:587
[email protected] [fully.qualified.target.server]:587
[email protected] [fully.qualified.target.server]:587
[email protected] [fully.qualified.target.server]:587
and encoded it as lmdb by postmap sender_relay
so that the sender_relay.lmdb was created in /etc/postfix/
I created /etc/postfix/sasl_passwd with the following content:
[email protected] [email protected]:password1
[email protected] [email protected]:password2
[email protected] [email protected]:password3
[email protected] [email protected]:password4
[fully.qualified.target.server]:587 [email protected]:passwordDefault
and encoded it as well using postmap sasl_passwd
.
Now when I try to send an email using that relay I get:
Jan 16 11:57:08 mail postfix/qmgr[12939]: 199FA1206D3: [email protected], size=454, nrcpt=1 (queue active)
Jan 16 11:57:38 mail postfix/smtp[12952]: connect to fully.qualified.target.server[ip.of.target.server]:587: Connection timed out
Jan 16 11:57:38 mail postfix/smtp[12952]: 199FA1206D3: [email protected], relay=none, delay=1062, delays=1032/0.03/30/0, dsn=4.4.1, status=deferred (connect to fully.qualified.target.server[ip.of.target.server]:587: Connection timed out)
Although I edited master.cf to get debugging output, i do not get more information:
smtp inet n - n - - smtpd -v
I checked certificates / connectivity using openssl:
openssl s_client -connect fully.qualified.target.server:587 -starttls smtp -crlf
and no problems where found.
What else can I do to debug this situation?
Platform ist openSuse Leap 15.3