Transaction failed 554

postfixsmtp

I created mail server by this tutorial http://www.unixmen.com/install-postfix-mail-server-with-dovecot-and-squirrelmail-on-centos-6-4/

I can send emails to myself it works fine, but when I want to send to another domain mail it shows error:

Message not sent. Server replied:
Transaction failed
554 5.7.1 <info@example.com>: Relay access denied

In that tutorial it says Setup DNS server and add the Mail server MX records. Is it needed ? To send mails to another domain ? Maybe this is a problem ?

Mail logs

Jun 27 07:14:52 mobifor postfix/smtpd[1822]: connect from localhost[::1]
Jun 27 07:14:52 mobifor postfix/smtpd[1822]: NOQUEUE: reject: RCPT from localhost[::1]: 554 5.7.1 <info@example.com>: Relay access denied; from=<nerijus@niceformss.com> to=<info@example.com> proto=ESMTP helo=<[129.233.111.73]>
Jun 27 07:14:52 mobifor postfix/smtpd[1822]: lost connection after RCPT from localhost[::1]
Jun 27 07:14:52 mobifor postfix/smtpd[1822]: disconnect from localhost[::1]

Best Answer

It looks like you are connecting to the wrong SMTP port or you have a bad smtpd_recipient_restrictions.

Most SMTP setups have open ports 25 for other servers delivering mail to local accounts (and 465 for the TLS variant) and an additional port 587 (called submission) for local users sending mail to foreign hosts. You can activate these in the master.cf and apply different configurations. For example, this could be the snippet (not complete, only for this case useful!) for submission in master.cf:

submission inet n       -       -       -       -       smtpd
 -o smtpd_client_restrictions=permit_sasl_authenticated,reject
 -o smtpd_recipient_restrictions=permit_sasl_authenticated,permit_mynetworks,reject

You can see that everyone who's connecting has to authenicate himself (permit_sasl_authenticated) and then can send any mail. This overrides your config in main.cf which prohibits local mail delivery for domains that are not listed in mydestination. But you don't want that in case of sending local mail to others.

For a more specific help, it would be very useful if you could provide your current configuration.