I am having trouble sending email to my relay host. All mail is being directly delivered.
postconf -n
:
alias_database = hash:/etc/aliases
alias_maps = hash:/etc/aliases
append_dot_mydomain = no
biff = no
config_directory = /etc/postfix
inet_interfaces = loopback-only
inet_protocols = all
mailbox_size_limit = 0
mydestination =
myhostname = webserver.example.com
myorigin = /etc/mailname
readme_directory = no
recipient_delimiter = +
relayhost = smtp.example.com
smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache
smtpd_banner = $myhostname ESMTP $mail_name (Ubuntu)
smtpd_relay_restrictions = permit_mynetworks permit_sasl_authenticated defer_unauth_destination
smtpd_tls_cert_file = /etc/ssl/certs/ssl-cert-snakeoil.pem
smtpd_tls_key_file = /etc/ssl/private/ssl-cert-snakeoil.key
smtpd_tls_session_cache_database = btree:${data_directory}/smtpd_scache
smtpd_use_tls = yes
Mailq and log shows the mail trying to connect directly to mail.h-email.net instead of my relay server.
Output of mailq
:
root@webserver:/etc/postfix# mailq
-Queue ID- --Size-- ----Arrival Time---- -Sender/Recipient-------
9F79E60224 382 Thu Jun 25 09:19:49 root@webserver.example.com
(connect to mail.h-email.net[107.21.213.75]:25: Connection timed out)
tguadagnin@gmail.com
-- 0 Kbytes in 1 Request.
Output of mail.log
Jun 25 09:20:20 webserver postfix/smtp[6998]: 9F79E60224: to=<tguadagnin@gmail.com>, relay=none, delay=31, delays=0.02/0/31/0, dsn=4.4.1, status=deferred (connect to mail.h-email.net[107.21.213.75]:25: Connection timed out)
The log shows relay=none
while all my other servers with the exact same configuration send email correctly and report as relay=smtp.example.com
in their logs.
The only difference with this server is that I have it in a different network segment which is one of my DMZ's.
I have placed rules so that the server itself cannot communicate outbound on port 25. The server can commuicate to the relay host via port 25 successfully.
dpkg-reconfigure postfix
and setting the system as a satellite system does not alleviate the issue.
mailutils
package provides the mail
command.
Can anyone help me out? I've been struggling to figure out how to troubleshoot this correctly.