0

I have set up postfix and dovecot with roundcube on my Ubuntu 18.04 server and I can now receive emails to my server but I can't seem to send mail to external servers (Mail sent internally works fine).

Postfix Configuration:

alias_database = hash:/etc/aliases
alias_maps = hash:/etc/aliases
append_dot_mydomain = no
biff = no
compatibility_level = 2
inet_interfaces = all
inet_protocols = all
mailbox_size_limit = 0
mydestination = localhost.$mydomain, localhost, localhost.localdomain
myhostname = abc.exampleDomain.com
mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128
myorigin = /etc/mailname
readme_directory = no
recipient_delimiter = +
relayhost =
smtp_tls_security_level = may
smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache
smtp_use_tls = yes
smtpd_banner = $myhostname ESMTP $mail_name
smtpd_relay_restrictions = permit_mynetworks, permit_sasl_authenticated, reject_unauth_destination
smtpd_sasl_auth_enable = yes
smtpd_sasl_path = private/auth
smtpd_sasl_type = dovecot
smtpd_tls_cert_file = /etc/letsencrypt/live/exampleDomain.com/fullchain.pem
smtpd_tls_key_file = /etc/letsencrypt/live/exampleDomain.com/privkey.pem
smtpd_tls_security_level = may
smtpd_tls_session_cache_database = btree:${data_directory}/smtpd_scache
smtpd_use_tls = yes
virtual_mailbox_domains = /etc/postfix/virtual_mailbox_domains
virtual_transport = lmtp:unix:private/dovecot-lmtp

master.cf:

smtp      inet  n       -       y       -       -       smtpd

submission inet n       -       y       -       -       smtpd
  -o smtpd_tls_security_level=encrypt
  -o smtpd_sasl_auth_enable=yes
  -o smtpd_client_restrictions=permit_sasl_authenticated,reject

smtps     inet  n       -       n       -       -       smtpd
  -o smtpd_tls_wrappermode=yes
  -o smtpd_sasl_auth_enable=yes
  -o smtpd_client_restrictions=permit_sasl_authenticated,reject

And the logs (/var/log/mail.log) just shows the following vague connection timeout error message:

Jul 18 20:33:45 abc postfix/smtp[32547]: 7419223465: to=<abcd@example.com>, relay=none, delay=30, delays=0.05/0.02/30/0, dsn=4.4.1, status=deferred (connect to example.com[xx.xx.xx.xx]:25: Connection timed out)

What did I do wrong during the Postfix/Dovecot setup?


Some other info:

telnet 127.0.0.1 25 returns the following:

Trying 127.0.0.1...
Connected to 127.0.0.1.
Escape character is '^]'.
220 abc.exampleDomain.com ESMTP Postfix

ls -l /var/spool/postfix/private returns the following:

srw-rw-rw- 1 postfix postfix 0 Jul 18 10:42 anvil
srw-rw-rw- 1 postfix postfix 0 Jul 18 10:42 auth
srw-rw-rw- 1 postfix postfix 0 Jul 18 10:42 bounce
srw-rw-rw- 1 postfix postfix 0 Jul 18 10:42 bsmtp
srw-rw-rw- 1 postfix postfix 0 Jul 18 10:42 defer
srw-rw-rw- 1 postfix postfix 0 Jul 18 10:42 discard
srw------- 1 postfix postfix 0 Jul 18 10:42 dovecot-lmtp
srw-rw-rw- 1 postfix postfix 0 Jul 18 10:42 error
srw-rw-rw- 1 postfix postfix 0 Jul 18 10:42 ifmail
srw-rw-rw- 1 postfix postfix 0 Jul 18 10:42 lmtp
srw-rw-rw- 1 postfix postfix 0 Jul 18 10:42 local
srw-rw-rw- 1 postfix postfix 0 Jul 18 10:42 maildrop
srw-rw-rw- 1 postfix postfix 0 Jul 18 10:42 mailman
srw-rw-rw- 1 postfix postfix 0 Jul 18 10:42 proxymap
srw-rw-rw- 1 postfix postfix 0 Jul 18 10:42 proxywrite
srw-rw-rw- 1 postfix postfix 0 Jul 18 10:42 relay
srw-rw-rw- 1 postfix postfix 0 Jul 18 10:42 retry
srw-rw-rw- 1 postfix postfix 0 Jul 18 10:42 rewrite
srw-rw-rw- 1 postfix postfix 0 Jul 18 10:42 scache
srw-rw-rw- 1 postfix postfix 0 Jul 18 10:42 scalemail-backend
srw-rw-rw- 1 postfix postfix 0 Jul 18 10:42 smtp
srw-rw-rw- 1 postfix postfix 0 Jul 18 10:42 tlsmgr
srw-rw-rw- 1 postfix postfix 0 Jul 18 10:42 trace
srw-rw-rw- 1 postfix postfix 0 Jul 18 10:42 uucp
srw-rw-rw- 1 postfix postfix 0 Jul 18 10:42 verify
srw-rw-rw- 1 postfix postfix 0 Jul 18 10:42 virtual
AndrewL64
  • 179
  • 18

0 Answers0