Postix/Dovecot reject: Relay access denied

Ivan asked:

Under CentOS 7, I have set up Postfix and Dovecot. I have setup reverse dns, as sell as MX records, etc.

I am able to send mail to the server fine. However, if I try to send mail from the server, I get this error trail in /var/log/maillog times out:

Jan 21 00:19:49 xxxx postfix/qmgr[19789]: 2812220F96: from=<xxx@xxxxxxxxx.com>, size=1525, nrcpt=1 (queue active)
Jan 21 00:20:19 xxxx postfix/smtp[20328]: connect to gmail-smtp-in.l.google.com[74.125.192.27]:25: Connection timed out
Jan 21 00:20:19 xxxx postfix/smtp[20490]: connect to gmail-smtp-in.l.google.com[74.125.192.27]:25: Connection timed out
Jan 21 00:20:49 xxxx postfix/smtp[20328]: connect to alt1.gmail-smtp-in.l.google.com[64.233.186.26]:25: Connection timed out
Jan 21 00:20:49 xxxx postfix/smtp[20490]: connect to alt1.gmail-smtp-in.l.google.com[64.233.186.26]:25: Connection timed out
Jan 21 00:21:19 xxxx postfix/smtp[20328]: connect to alt2.gmail-smtp-in.l.google.com[209.85.202.26]:25: Connection timed out
Jan 21 00:21:19 xxxx postfix/smtp[20490]: connect to alt2.gmail-smtp-in.l.google.com[209.85.202.26]:25: Connection timed out
Jan 21 00:21:49 xxxx postfix/smtp[20328]: connect to alt3.gmail-smtp-in.l.google.com[74.125.206.27]:25: Connection timed out
Jan 21 00:21:49 xxxx postfix/smtp[20490]: connect to alt3.gmail-smtp-in.l.google.com[74.125.206.27]:25: Connection timed out
Jan 21 00:22:19 xxxx postfix/smtp[20328]: connect to alt4.gmail-smtp-in.l.google.com[74.125.143.27]:25: Connection timed out
Jan 21 00:22:19 xxxx postfix/smtp[20490]: connect to alt4.gmail-smtp-in.l.google.com[74.125.143.27]:25: Connection timed out
Jan 21 00:22:19 xxxx postfix/smtp[20328]: 8B1DA20F91: to=<xxxxxx@gmail.com>, relay=none, delay=893, delays=743/0.01/150/0, dsn=4.4.1, status=deferred (connect to alt4.gmail-smtp-in.l.google.com[74.125.143.27]:25: Connection timed out)
Jan 21 00:22:19 xxxx postfix/smtp[20490]: 2812220F96: to=<xxxxxx@gmail.com>, relay=none, delay=652, delays=502/0.01/150/0, dsn=4.4.1, status=deferred (connect to alt4.gmail-smtp-in.l.google.com[74.125.143.27]:25: Connection timed out)
Jan 21 00:24:49 xxxx postfix/qmgr[19789]: 8065220F97: from=<xxx@xxxxxx.com>, size=1063, nrcpt=1 (queue active)
Jan 21 00:25:19 xxxx postfix/smtp[20686]: connect to gmail-smtp-in.l.google.com[74.125.192.27]:25: Connection timed out
Jan 21 00:25:49 xxxx postfix/smtp[20686]: connect to alt1.gmail-smtp-in.l.google.com[64.233.186.27]:25: Connection timed out
Jan 21 00:26:19 xxxx postfix/smtp[20686]: connect to alt2.gmail-smtp-in.l.google.com[209.85.202.26]:25: Connection timed out
Jan 21 00:26:49 xxxx postfix/smtp[20686]: connect to alt3.gmail-smtp-in.l.google.com[74.125.206.27]:25: Connection timed out
Jan 21 00:27:19 xxxx postfix/smtp[20686]: connect to alt4.gmail-smtp-in.l.google.com[74.125.143.27]:25: Connection timed out
Jan 21 00:27:19 xxxx postfix/smtp[20686]: 8065220F97: to=<xxxxxx@gmail.com>, relay=none, delay=690, delays=540/0.02/150/0, dsn=4.4.1, status=deferred (connect to alt4.gmail-smtp-in.l.google.com[74.125.143.27]:25: Connection timed out)

My answer:


Your email client attempted to connect to Postfix port 25 and send mail. This is not allowed. You need to connect to port 587 and authenticate to the server (and probably also set up authentication, but you didn’t discuss whether you did that).


View the full question and answer on Server Fault.

Creative Commons License
This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.