I setup the email server. I am able to send out mail but when I try to receive mail by sending an email to myself from another email, it doesn't work. The other email I receive a mailer-daemon and this one shows as a reject.
This is the error that i get in (/var/log/mail.log
):
Jun 24 19:17:31 localhost postfix/smtpd[13352]: connect from mail-lb0-f173.google.com[209.85.217.173]
Jun 24 19:17:31 localhost postfix/trivial-rewrite[13329]: warning: do not list domain socialbaked.com in BOTH mydestination and virtual_mailbox_domains
Jun 24 19:17:31 localhost postfix/smtpd[13352]: NOQUEUE: reject: RCPT from mail-lb0-f173.google.com[209.85.217.173]: 550 5.1.1 <[email protected]>: Recipient address rejected: User unknown in local recipient table; from=<[email protected]> to=<[email protected]> proto=ESMTP helo=<mail-lb0-f173.google.com>
Jun 24 19:17:31 localhost postfix/smtpd[13352]: disconnect from mail-lb0-f173.google.com[209.85.217.173]
Jun 24 19:19:38 localhost postfix/master[2102]: daemon started -- version 2.7.0, configuration /etc/postfix
Jun 24 19:19:39 localhost dovecot: Dovecot v1.2.9 starting up (core dumps disabled)
Jun 24 19:19:39 localhost dovecot: auth-worker(default): mysql: Connected to 127.0.0.1 (mail)
Jun 24 19:19:41 localhost postfix/master[2102]: reload -- version 2.7.0, configuration /etc/postfix
The following line from the error log gives valuable info:
Postfix should relay all mail to other servers on the internet, it does not actually receive mail for any domains. As in the error log example.com should be forwarded to the mail server for example.com. The solution, is to remove $mydomain from postfix config /etc/postfix/main.cf in line:
Source: serverfault
For me, the issue was that I also had a DNS issue. To fix this, I used
From within the terminal window and changed the "local networks" field answer to include the IP of my public IP for the server.
Afterwards, I ran
service postfix reload
andservice postfix restart
and all was well.