I was following the tutorial http://wiki.centos.org/zh/HowTos/postfix_restrictions

but, when I tried to send a mail with smtp, it returns:

Connected to XXX.XXX.33.22 (XXX.XXX.33.22).
Escape character is '^]'.
220 mail.xxxx.com ESMTP Postfix
HELO mail.xxxx.com
250 mail.xxxx.com
MAIL FROM:<ned@example.com>
250 2.1.0 Ok
RCPT TO:<ned@example.com>
554 5.7.1 <ned@example.com>: Relay access denied

And, the postfix main.cf setting is relay_domains =


If this message is an inbound message and you have accounts setup for ned@example.com, if its a standard non-virtual domain setup, you need to ensure that example.com is on your mydestination line, if it's virtual make sure you have a virtual_mailbox_domains entry, and that it points to a file/hash/database table that contains example.com.

If you're testing email outbound (ie someone on your network trying to send mail to ned@example.com, check that the mynetworks line contains a reference to your networks rfc1918 range (eg or or that you have enabled and are using SASL authentication.

  • Thanks! With the mynetworks setting all works great! – Fu86 May 18 '11 at 9:06

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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