2

I've a Postfix + Dovecot set up in my Parabola (Arch based) installation. It looks like it works, I can send emails to any address and it works, and also receive mails but only from local addresses.

If I do mail [email protected], I get the email (like auto sending me an email). But if I do from another email account, an external one, I simply do not receive it.

All the ports work locally, but if I try to telnet [my_public_IP] 25 (or 587) it fails (I'll ask my ISP what's happening).

More outputs:

$ postconf -n
alias_database = $alias_maps
alias_maps = hash:/etc/postfix/aliases
broken_sasl_auth_clients = yes
command_directory = /usr/bin
compatibility_level = 2
daemon_directory = /usr/lib/postfix/bin
data_directory = /var/lib/postfix
debug_peer_level = 2
debugger_command = PATH=/bin:/usr/bin:/usr/local/bin:/usr/X11R6/bin ddd $daemon_directory/$process_name $process_id & sleep 5
home_mailbox = Maildir/
html_directory = no
inet_interfaces = localhost # I've tried using my IP address, with no luck
inet_protocols = all
mail_owner = postfix
mailbox_size_limit = 134217728
mailq_path = /usr/bin/mailq
manpage_directory = /usr/share/man
message_size_limit = 134217728
meta_directory = /etc/postfix
mydomain = eumela.ga
myhostname = smtp.eumela.ga
myorigin = $mydomain
newaliases_path = /usr/bin/newaliases
queue_directory = /var/spool/postfix
readme_directory = /usr/share/doc/postfix
sample_directory = /etc/postfix
sendmail_path = /usr/bin/sendmail
setgid_group = postdrop
shlib_directory = /usr/lib/postfix
smtp_tls_note_starttls_offer = yes
smtp_tls_security_level = may
smtpd_recipient_restrictions = permit_sasl_authenticated,permit_mynetworks,reject_unauth_destination
smtpd_sasl_auth_enable = yes
smtpd_sasl_local_domain =
smtpd_sasl_path = /var/run/dovecot/auth-client
smtpd_sasl_security_options = noanonymous
smtpd_sasl_type = dovecot
smtpd_tls_cert_file = /etc/letsencrypt/live/eumela.ga/fullchain.pem
smtpd_tls_key_file = /etc/letsencrypt/live/eumela.ga/privkey.pem
smtpd_tls_loglevel = 1
smtpd_tls_received_header = yes
smtpd_tls_security_level = may
unknown_local_recipient_reject_code = 550
virtual_alias_domains = $mydomain
virtual_alias_maps = hash:/etc/postfix/virtual

$ cat /etc/dovecot/dovecot.conf
protocols = imap pop3
auth_mechanisms = plain
passdb {
    driver = sql
    args = /etc/dovecot/dovecot-sql.conf
}
userdb {
    driver = sql
    args = /etc/dovecot/dovecot-sql.conf
}

service auth {
    unix_listener /var/spool/postfix/private/auth {
        group = postfix
        mode = 0660
        user = postfix
    }
    user = root
}
#service auth {
# inet_listener {
#   port = 587
# }
#}
mail_home = /home/vmail/%d/%n
mail_location = maildir:~

ssl_cert = </etc/letsencrypt/live/eumela.ga/fullchain.pem
ssl_key = </etc/letsencrypt/live/eumela.ga/privkey.pem

Output of 10-auth.conf, 10-mail.conf, 10-master.conf, 10-ssl.conf and 20-imap.conf (from /etc/dovecot/conf.d)


Update: Here is the log from today, August 24. It's a combination of mail.log, mail.err and mail.info

5 Answers 5

3
inet_interfaces = localhost # I've tried using my IP address, with no luck`

if you are only listening on localhost your smtp server will not be reachable from the outside. you should probably change this to all. cf. http://www.postfix.org/postconf.5.html#inet_interfaces

after restarting the postfix service you can check with netstat -tulpn on what interfaces and ports your server is listening.

if postfix is listening on all interfaces on port 25 but still not reachable from the outside you should check your firewall settings

1
  • I would give you a +1 if I had enough reputation.... It worked, I can now do telnet mydomain.eg 25 and also with 465 and 587, but I still can't receive emails from outside and set up the account in a client (e.g. Thunderbird in my case). Here's the output of netstat -tulpn
    – Megver83
    Aug 28, 2017 at 17:07
2

thanks to @Stefan's answer, but I had to also do:

$ sudo postconf -e 'mydestination = localhost.$mydomain, localhost, $mydomain'

And now I can receive mails from outside...

P.S: Can I specify 'all' in 'mydestination'?

2
  • Can I specify 'all' in 'mydestination'? no, you can't
    – ALex_hha
    Aug 28, 2017 at 18:04
  • if like to be an open relay sure
    – djdomi
    Sep 30, 2019 at 16:36
0

I had a similar problem for all of our domains and none were receiving emails from external mail clients like outlook and etc. but then I added port 25 to the firewall and since then I started receiving emails.

Do the following check:

  • netstat -tulpn "if you see port 25 means you listening to this port locally"
  • Then, check your firewall, you might be not allowing traffic to this port
  • Add port 25 to your firewall
  • Finally, check your mail log tail -f /var/log/maillog

I hope this helps someone.

0

Add email addresses to /etc/postfix/virtual [email protected] mylocalusername [email protected] mylocalusernam2

Then run postmap /etc/postfix/virtual

Un-comment the line that reads the following. virtual_alias_maps = hash:/etc/postfix/virtual

Restart postfix systemctl restart postfix

Also make sure you server is listening on port 25 for incoming mail. Make sure that the firewall has port 25 open.

1
  • The virtual_alias_maps line is in main.cf Sep 30, 2019 at 16:28
0

In my case (Virtualmin, CentOS 7, mail_version = 2.10.1), for some reason I had in my postfix main.cf

inet_interfaces = loopback-only

I changed it to

inet_interfaces = all

and bingo! Started getting mails immediately...

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .