For some reason my Postfix mail server running on CentOS 7 stopped working recently, maybe because I updated the modules through Webmin, I don't know. I am able to send out emails but I am not receiving emails. Also, POP3 and IMAP aren't working. I've tried many things but haven't been able to figure it out by myself, so I am looking for some help.
I read a few threads on the topics:
- Fixing 'Relay access denied' in Postfix
- Postfix/Dovecot relay access denied
- Postfix Basic Configuration (Excellent article!)
- Postfix receive email from outside not working
My initial error: Relay access denied
from the file /var/log/maillog
:
Jul 31 11:18:40 myhostname postfix/smtpd[6787]: connect from mail-wm0-f51.google.com[74.125.82.51]
Jul 31 11:18:40 myhostname postfix/smtpd[6787]: NOQUEUE: reject: RCPT from mail-wm0-f51.google.com[74.125.82.51]: 454 4.7.1 <contact@mydomain.com>: Relay access denied; from=<myemail@gmail.com> to=<contact@mydomain.com> proto=ESMTP helo=<mail-wm0-f51.google.com>
Jul 31 11:18:41 myhostname postfix/smtpd[6787]: disconnect from mail-wm0-f51.google.com[74.125.82.51]
My initial setting (/etc/postfix/main.cf
) running the command postconf -n
:
alias_database = hash:/etc/aliases
alias_maps = hash:/etc/aliases
command_directory = /usr/sbin
config_directory = /etc/postfix
daemon_directory = /usr/libexec/postfix
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
html_directory = no
mailq_path = /usr/bin/mailq.postfix
manpage_directory = /usr/share/man
mydestination = $myhostname, localhost.$mydomain, localhost, $mydomain
newaliases_path = /usr/bin/newaliases.postfix
readme_directory = /usr/share/doc/postfix-2.10.1/README_FILES
sample_directory = /usr/share/doc/postfix-2.10.1/samples
sendmail_path = /usr/sbin/sendmail.postfix
setgid_group = postdrop
smtpd_relay_restrictions = permit_mynetworks permit_sasl_authenticated defer_unauth_destination
unknown_local_recipient_reject_code = 550
After reading the articles I mentioned above, I defined mydomain
, myhostname
and mynetworks
; now I get a different error (see below.) Here is the main.cf
settings with the alterations:
alias_database = hash:/etc/aliases
alias_maps = hash:/etc/aliases
command_directory = /usr/sbin
config_directory = /etc/postfix
daemon_directory = /usr/libexec/postfix
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
html_directory = no
mailq_path = /usr/bin/mailq.postfix
manpage_directory = /usr/share/man
mydestination = $myhostname, localhost.$mydomain, localhost, $mydomain
mydomain = mydomain.com
myhostname = 9dok43ksalv.hostname.com
mynetworks = 11.22.33.44/28, 127.0.0.0/8
myorigin = $mydomain
newaliases_path = /usr/bin/newaliases.postfix
readme_directory = /usr/share/doc/postfix-2.10.1/README_FILES
relay_domains = $mydestination
sample_directory = /usr/share/doc/postfix-2.10.1/samples
sendmail_path = /usr/sbin/sendmail.postfix
setgid_group = postdrop
smtpd_relay_restrictions = permit_mynetworks permit_sasl_authenticated defer_unauth_destination
unknown_local_recipient_reject_code = 550
Now the error I got is Recipient address rejected: User unknown in local recipient table;
as shown below:
connect from mail-wm0-f49.google.com[74.125.82.49]
Aug 1 16:22:27 9dok43ksalv postfix/smtpd[2583]: NOQUEUE: reject: RCPT from mail-wm0-f49.google.com[74.125.82.49]: 550 5.1.1 <contact@mydomain.com>: Recipient address rejected: User unknown in local recipient table; from=<myemail@gmail.com> to=<contact@mydomain.com> proto=ESMTP helo=<mail-wm0-f49.google.com>
Aug 1 16:22:28 9dok43ksalv postfix/smtpd[2583]: disconnect from mail-wm0-f49.google.com[74.125.82.49]
Apparently Postfix isn't finding the final destination for the email. I've never had to configure Postfix before, so I am a bit lost now as a first timer; VestaCP
used to take care of this for me, and I never had a problem, until now.
Would someone be kind enough to point me on the right direction. I would really appreciate to receive emails again, and get POP3 & IMAP working.
Thanks in advance. Let me know if you need more information.