Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

The goal is to accept local emails for two accounts and then forward all other emails to destination mail server. With the current configuration from below I receive error: relay access denied. I tried to set a smart host (relayhost = exmaple.com) but this also didn't help.

  • local1@example.com, local2@example.com -> local delivery
  • *@exmaple.com -> deliver to destination mail server (domain.com)

Details:

CentOS 6.4, Postfix 2.6.6

----- /etc/postfix/main.cf -----

queue_directory = /var/spool/postfix
command_directory = /usr/sbin
daemon_directory = /usr/libexec/postfix
data_directory = /var/lib/postfix
mail_owner = postfix
inet_interfaces = localhost
inet_protocols = all
mydestination = $myhostname, localhost.$mydomain, localhost
unknown_local_recipient_reject_code = 550
alias_maps = hash:/etc/aliases
alias_database = hash:/etc/aliases 
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
sendmail_path = /usr/sbin/sendmail.postfix
newaliases_path = /usr/bin/newaliases.postfix
mailq_path = /usr/bin/mailq.postfix
setgid_group = postdrop
html_directory = no
manpage_directory = /usr/share/man
sample_directory = /usr/share/doc/postfix-2.6.6/samples
readme_directory = /usr/share/doc/postfix-2.6.6/README_FILES
transport_maps = hash:/etc/postfix/transport

----- /etc/postfix/transport -----

local1@exmaple.com local:local
local2@exmaple.com local:local
* smtp:[domain.com]

---- Logs -----

Jan 12 19:22:02 test postfix/smtpd[4997]: warning: XXX.XXX.XXX.XXX: address not listed for hostname domain.com
Jan 12 19:22:02 test postfix/smtpd[4997]: connect from unknown[XXX.XXX.XXX.XXX]
Jan 12 19:22:02 test postfix/smtpd[4997]: NOQUEUE: reject: RCPT from unknown[XXX.XXX.XXX.XXX]: 554 5.7.1 <local@exmaple.com>: Relay access denied; from=<test@test.com> to=<local1@exmaple.com> proto=ESMTP helo=<test.com>
share|improve this question
1  
Add example.com to relay_domains? –  Stefan Förster Jan 13 at 8:12

Your Answer

 
discard

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

Browse other questions tagged or ask your own question.