Well I seem to have managed to figure this out with a bit of searching & testing. Here's what I had to do:
Relaying apparently also bypasses the alias_maps directive, so for aliases to continue working I had to comment out both alias_maps and alias_database, and replace them with virtual_alias_maps. The format of the virutal_alias_map is identical to alias_maps, so that was an easy change to make.
With these changes in place just restart postfix and also run "postmap /etc/postfix/transport" to build transport.db. Now everything addressed to @localhost or @localhost.localdomain is discarded while everything else is relayed through the specified host.
Just figured it out. Need to use Postfix transport maps in order to accomplish this. At least it's working for me!
So, on the Local server I believe I left main.cf alone:
smtpd_relay_restrictions = permit_mynetworks permit_sasl_authenticated defer_unauth_destination
myhostname = server5.domain1.local
alias_maps = hash:/etc/aliases
alias_database = hash:/etc/aliases
myorigin = /etc/mailname
mydestination = server5.domain1.local, localhost.domain1.local, , localhost
relayhost = [10.1.0.10]:587
relay_domains = domain1.com, domain2.com, domain3.com, domain4.info
mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128 10.0.0.0/8
mailbox_command = /usr/bin/procmail-wrapper -o -a $DOMAIN -d $LOGNAME
mailbox_size_limit = 0
recipient_delimiter = +
virtual_alias_maps = hash:/etc/postfix/virtual
sender_bcc_maps = hash:/etc/postfix/bcc
home_mailbox = Maildir/
smtpd_sasl_auth_enable = yes
broken_sasl_auth_clients = yes
smtpd_recipient_restrictions = permit_mynetworks permit_sasl_authenticated reject_unauth_destination
allow_percent_hack = no
On the remote server however, I used transport maps to accomplish this.
Create the transport table:
# touch /etc/postfix/transport
Populate it, in my case, it's:
# vim /etc/postfix/transport
domain1.com smtp:10.0.0.24:587
domain4.info smtp:10.0.0.24:587
domain2.com smtp:10.0.0.24:587
domain3.com smtp:10.0.0.24:587
Save and close.
Edit /etc/postfix/main.cf
and clean it up a bit by removing the relayhost and adding the transport_maps:
smtpd_relay_restrictions = permit_mynetworks permit_sasl_authenticated defer_unauth_destination
myhostname = mail.domain1.com
alias_maps = hash:/etc/aliases
alias_database = hash:/etc/aliases
myorigin = $mydomain
mydestination = $myhostname, localhost.$mydomain
relay_domains = domain1.com, domain2.com, domain4.info, domain3.com
transport_maps = hash:/etc/postfix/transport
mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128 10.0.0.0/8
mailbox_size_limit = 0
recipient_delimiter = +
inet_interfaces = all
inet_protocols = all
Save the file. postmap the transport table:
# postmap /etc/postfix/transport
Restart Postfix on both machines:
# service postfix restart
And should be good to go!
Best Answer
soft_bounce (default: no)
bounce_queue_lifetime (default: 5d)
smtp_fallback_relay