I have a mail relay (mx2.mycorp.com
)which accepts mail for somelist@lists.mycorp.com
. These posts are forwarded to a Sympa mailing list server which accepts postings for the mycorp.com
domain.
This has been working for quite some time on an older version of Sympa and Ubuntu 14.04 but the problem is both stacks have needed upgrades and deprecation in both pieces of software have broken much of the setup.
I'm starting over with Ubuntu 18.04 but can't quite figure out how to get postfix transports for lists.mycorp.com
working for relaying to the Sympa server in a way that sympa will accept the posting for the mailing list. Right now the sympa server is simply relaying the posting out to the egress mail server because it's not configured to accept mail for 'lists.mycorp.com(only
mycorp.com`). This was configured for vanity reasons; the stakeholders in the project don't want a subdomain for their mailing lists.
Is there a way to get postfix to rewrite the destination domain after it's figured out where it needs to relay the message?
Contents of postconf -n
and postconf -M
:
# postconf -n
alias_database = hash:/etc/aliases,hash:/etc/mail/sympa/aliases
alias_maps = mysql:/etc/postfix/mysql-sympa-lists-with-exclusions.cf,mysql:/etc/postfix/mysql-sympa-owners.cf,mysql:/etc/postfix/mysql-sympa-request.cf,mysql:/etc/postfix/mysql-sympa-u
nsubscribe.cf,hash:/etc/mail/sympa/aliases,hash:/etc/aliases
biff = no
default_privs = sympa
home_mailbox = .maildir/
inet_interfaces = all
inet_protocols = ipv4
local_recipient_maps =
mailbox_size_limit = 60000000
mailbox_transport = smtp:[mx1.mycorp.com]:2525
mydestination = $myhostname, localhost.$mydomain, localhost, $mydomain, lists.mycorp.com, lists.test.mycorp.com
mydomain = mycorp.com
myhostname = lists.mycorp.com
mynetworks = 127.0.0.0/8 10.140.136.0/23
myorigin = $mydomain
readme_directory = no
recipient_canonical_maps = hash:/etc/postfix/myrecipientmap
recipient_delimiter = +
relay_domains = $mydestination, lists.mycorp.com
smtp_destination_concurrency_limit = 5
smtp_destination_rate_delay = 1s
smtp_extra_recipient_limit = 5
smtp_host_lookup = native,dns
smtpd_banner = $myhostname ESMTP $mail_name (Ubuntu)
smtpd_recipient_restrictions = check_recipient_access hash:/etc/postfix/recipient_access
smtpd_relay_restrictions = permit_mynetworks, permit_sasl_authenticated, defer_unauth_destination
smtpd_sender_restrictions = hash:/etc/postfix/sender_access
sympa_destination_recipient_limit = 1
sympabounce_destination_recipient_limit = 1
transport_maps = regexp:/etc/postfix/transport_regexp
unknown_local_recipient_reject_code = 450
virtual_alias_maps = hash:/etc/postfix/virtual
# postconf -M
smtp inet n - n - - smtpd -v
pickup unix n - y 60 1 pickup
cleanup unix n - y - 0 cleanup
qmgr unix n - n 300 1 qmgr
tlsmgr unix - - y 1000? 1 tlsmgr
rewrite unix - - y - - trivial-rewrite
bounce unix - - y - 0 bounce
defer unix - - y - 0 bounce
trace unix - - y - 0 bounce
verify unix - - y - 1 verify
flush unix n - y 1000? 0 flush
proxymap unix - - n - - proxymap
proxywrite unix - - n - 1 proxymap
smtp unix - - y - - smtp
relay unix - - y - - smtp
showq unix n - y - - showq
error unix - - y - - error
retry unix - - y - - error
discard unix - - y - - discard
local unix - n n - - local
virtual unix - n n - - virtual
lmtp unix - - y - - lmtp
anvil unix - - y - 1 anvil
scache unix - - y - 1 scache
maildrop unix - n n - - pipe flags=DRhu user=vmail argv=/usr/bin/maildrop -d ${recipient}
uucp unix - n n - - pipe flags=Fqhu user=uucp argv=uux -r -n -z -a$sender - $nexthop!rmail ($recipient)
ifmail unix - n n - - pipe flags=F user=ftn argv=/usr/lib/ifmail/ifmail -r $nexthop ($recipient)
bsmtp unix - n n - - pipe flags=Fq. user=bsmtp argv=/usr/lib/bsmtp/bsmtp -t$nexthop -f$sender $recipient
scalemail-backend unix - n n - 2 pipe flags=R user=scalemail argv=/usr/lib/scalemail/bin/scalemail-store ${nexthop} ${user} ${extension}
mailman unix - n n - - pipe flags=FR user=list argv=/usr/lib/mailman/bin/postfix-to-mailman.py ${nexthop} ${user}
sympa unix - n n - - pipe flags=R user=sympa argv=/usr/lib/sympa/bin/queue ${recipient}
sympabounce unix - n n - - pipe flags=R user=sympa argv=/usr/lib/sympa/bin/bouncequeue ${recipient}