Postfix Mail Relay Help

Issues related to applications and software problems
Post Reply
RedWizard75
Posts: 1
Joined: 2020/09/14 23:43:09

Postfix Mail Relay Help

Post by RedWizard75 » 2020/10/27 00:47:04

Hi all,

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, which I'm trying to avoid. What have I missed in the configuration?

To make it more "fun" the client wants the "invoices@mary.com" emails 'stored and forwarded', but the "payslipemail@mary.com" just forwarded on ...
I have created a local 'invoices' user, but that's within the "fred.com" domain name ... (isn't it?) ...

Code: Select all

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

Code: Select all

#### 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
relay_domains = fred.com, mary.com
smtp_use_tls = yes
smtp_tls_CAfile=/etc/pki/tls/certs/ca-bundle.trust.crt
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
smtp_send_dummy_mail_auth=no
smtp_tls_loglevel=1
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
*** ALSO POSTED IN - https://unix.stackexchange.com/question ... relay-help ***

Post Reply

Return to “CentOS 7 - Software Support”