My company - fred.com - sends internal mail to an external MS Office email exchange, using MailEnableAdmin on Windows, primarily for server alert mail.

The plan is to move away from MailEnableAdmin on Windows to a CentOS server.

I have successfully configured a mail relay with postfix to send internal mail to the MS Office exchange to multiple addressees.

However, we also have a client/customer that we host servers for - mary.com - and they use our existing Windows Relay to redirect messages coming into "invoices@mary.com" to "invoices-internal@mary.com", and redirect emails coming into "payslipemail@mary.com" to payroll@mary.com. I have tried to 'redirect' both addresses to "test@mary.com", so I'm the only one that sees them, but I can't seem to get the redirection to work.

I have tried to set up 'sender_canonical_maps', see below, but the invoices@mary.com (or payslipemail@mary.com) does not get redirected to test@mary.com, it ends up being delivered to the MailEnableAdmin server. What have I missed in the configuration?

#### sender_canonical_maps ####
@fred.local                  @fred.com
invoices@mary.com            test@mary.com
payslipemail@mary.com        test@mary.com

#### 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 =
         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
relay_domains = fred.com, mary.com
smtp_use_tls = yes
smtp_sasl_auth_enable = yes
smtp_sasl_security_options = noanonymous
smtp_sasl_tls_security_options = noanonymous
smtp_tls_security_level = encrypt
smtp_sasl_password_maps = hash:/etc/postfix/relay_passwd
smtp_generic_maps = hash:/etc/postfix/generic
sender_canonical_classes = envelope_sender, header_sender
sender_canonical_maps =  hash:/etc/postfix/sender_canonical_maps
debug_peer_level = 2
debug_peer_list = filter1.fred.com
milter_default_action = accept
milter_protocol = 6
smtpd_milters = unix:/var/run/spamass-milter/spamass-milter.sock
non_smtpd_milters = $smtpd_milters
mailbox_command = /bin/mailx

Your Answer

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

Browse other questions tagged or ask your own question.