Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm currently trying to setup an SMTP-relay server to Gmail with Postfix on a CentOS 6.4 machine, so I can send e-mails from my PHP scripts.

I followed this tutorial but I get this error output when trying to do a



tail -f /var/log/maillog

Apr 16 01:25:54 ext-server-dev01 postfix/cleanup[3646]: 86C2D3C05B0: message-id=<20130416082554.86C2D3C05B0@host.local.domain>

Apr 16 01:25:54 ext-server-dev01 postfix/qmgr[3643]: 86C2D3C05B0: from=<root@host.local.domain>, size=297, nrcpt=1 (queue active)

Apr 16 01:25:56 ext-server-dev01 postfix/smtp[3648]: 86C2D3C05B0: to=<>,[]:587, delay=4.8, delays=3.1/0.04/1.5/0.23, dsn=5.5.1, status=bounced (host[] said: 530-5.5.1 Authentication Required. Learn more at 530 5.5.1 qh4sm3305629pac.8 - gsmtp (in reply to MAIL FROM command))

Here is my configuration, I tried a number of different options but nothing seems to work:

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
html_directory = no
inet_interfaces = localhost
inet_protocols = ipv4
mail_owner = postfix
mailq_path = /usr/bin/mailq.postfix
manpage_directory = /usr/share/man
mydestination = $myhostname, localhost.$mydomain, localhost
myhostname = host.local.domain
myorigin = $myhostname
newaliases_path = /usr/bin/newaliases.postfix
queue_directory = /var/spool/postfix
readme_directory = /usr/share/doc/postfix-2.6.6/README_FILES
relayhost = []:587
sample_directory = /usr/share/doc/postfix-2.6.6/samples
sendmail_path = /usr/sbin/sendmail.postfix
setgid_group = postdrop
smtp_sasl_auth_enable = yes
smtp_sasl_password_maps = hash:/etc/postfix/sasl_passwd
smtp_sasl_security_options = noanonymous
smtp_sasl_tls_security_options = noanonymous
smtp_sasl_type = cyrus
smtp_tls_CAfile = /etc/ssl/certs/ca-bundle.crt
smtp_use_tls = yes
smtpd_sasl_path = smtpd
unknown_local_recipient_reject_code = 550

In the /etc/postfix/sasl_passwd files (sasl_passwd & sasl_passwd.db) I got the following (removed the real password, and replaced it with "password"):


To create the sasl_passwd.db file, I did that by running this command:

postmap hash:/etc/postfix/sasl_passwd

Do anybody got an idea why I can't seem to send an e-mail from the server?

Kind Regards Alex

share|improve this question
# telnet 587
Connected to
Escape character is '^]'.
220 ESMTP h52sm28987766eez.3 - gsmtp
ehlo localhost at your service, []
250-SIZE 35882577

there is no auth available. You must use STARTTLS on port 25/587 or use SSL/TLS on port 465

smtp_tls_policy_maps = hash:/etc/postfix/tls_policy
smtp_tls_security_level = secure
smtp_tls_mandatory_protocols = TLSv1
smtp_tls_mandatory_ciphers = high
smtp_tls_secure_cert_match = nexthop

/etc/postfix/tls_policy encrypt protocols=TLSv1 ciphers=high



In the maillog would be something like the following

# swaks -s --helo localhost --to --from

# cat /var/log/maillog | grep 283AC120834
Sep 21 15:43:55 mail postfix/smtpd[28486]: 283AC120834: client=localhost[]
Sep 21 15:43:55 mail postfix/cleanup[28489]: 283AC120834: message-id=<>
Sep 21 15:43:55 mail postfix/qmgr[28481]: 283AC120834: from=<>, size=449, nrcpt=1 (queue active)
Sep 21 15:43:56 mail postfix/smtp[28490]: 283AC120834: to=<>,[]:587, delay=1.7, delays=0.01/0/0.64/1, dsn=2.0.0, status=sent (250 2.0.0 OK 1379792594 y47sm29107298eew.12 - gsmtp)
Sep 21 15:43:56 mail postfix/qmgr[28481]: 283AC120834: removed
share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.