Postfix:重写中继邮件上的收件人域

Postfix:重写中继邮件上的收件人域

我有一个邮件中继 ( mx2.mycorp.com),它接受 的邮件[email protected]。这些帖子被转发到 Sympa 邮件列表服务器,该服务器接受该mycorp.com域的帖子。

这在旧版本的 Sympa 和 Ubuntu 14.04 上已经运行了相当长一段时间,但问题是两个堆栈都需要升级,并且两个软件的弃用已经破坏了大部分设置。

我从 Ubuntu 18.04 开始,但不太清楚如何让 postfix 传输lists.mycorp.com工作以中继到 Sympa 服务器,以便 sympa 接受邮件列表的发帖。目前,sympa 服务器只是将发帖中继到出口邮件服务器,因为它没有配置为接受“lists.mycorp.com (onlymycorp.com”的邮件。这是出于虚荣的原因而配置的;项目中的利益相关者不希望他们的邮件列表有子域。

有没有办法让 postfix 重写目标域它已经知道需要将信息中继到哪里了吗?

postconf -n和的内容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}

答案1

我不知道我写的文章是否与这个问题有关,但我在升级 ubuntu 22.04 并替换 mailman2 时遇到了类似的问题,所以我必须记录解决方案这里是的,并附有其他解决方案的链接:

相关内容