Postfix error when receiving emails: Relay access denied

Issues related to configuring your network
Post Reply
HowardStern
Posts: 1
Joined: 2017/07/31 14:13:44

Postfix error when receiving emails: Relay access denied

Post by HowardStern » 2017/07/31 14:39:49

Hi everyone,

I am running CentOS 7, and recently my email server (using Postfix) stopped working. Emails are going out, but they are not coming in. I never had problems with it before, and it is a mystery why stopped working since I haven't changed anything. Well, I updated a few modules through Webmin and perhaps that affected it.

In /var/log/maillog I have the error:

Code: Select all

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]
After a lot of digging, I tried several things from different threads and sources, including adding the line into my /etc/postfix/main.cf:

Code: Select all

smtpd_relay_restrictions = permit_mynetworks permit_sasl_authenticated defer_unauth_destination
This is what my main.cf looks like now after running the command postconf -n:

Code: Select all

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
I know it is something so simple, maybe I need to define mydomain? I tried explicitly adding my domain here, and it did make a difference, I got a different error. But adding my domain here seems strange, I never had to add it before, and it was working before. I am running Vesta CP, and that should take care of managing what domains I have, who's got email support, what email addresses are registered and so on... With all these questions in mind, i thought it would be better to get help from real experts and get the postfix server working properly. When the mail system was working through WebMail, IMAP and POP3 weren't working, so maybe fixing whatever is going on wrong, will help these other features to work correctly.

Let me know if I can provide more information in order to help solving this, and thanks very much if you got to reading this far :).

Post Reply