将每个邮件列表的副本路由到另一台服务器

将每个邮件列表的副本路由到另一台服务器

我有一个邮件列表服务器在 Postfix 后面运行。我正在升级 ML 软件(在单独的虚拟机上),并希望向其发送生产帖子的副本,以确保一切正常工作。

我已always_bcc在 Postfix(在 ML 主机上)中设置为指向本地用户 (listmail),然后用于/etc/procmailrc将消息发送到测试环境中升级后的主机。

#  send copy of ML posts to lists.test
:0
* ^To:.*[email protected]
[email protected]

这似乎对“测试列表”有用,但是当各个电子邮件从列表服务器发出时,这些也已To:设置为[电子邮件受保护]这将需要检查食谱中的一些其他标题,因为我只想路由初始(OP)帖子。

另一个问题是我不想为我们拥有的每个邮件列表(超过几百个)编写一个配方,然后每次添加或删除列表时都必须更新它 - 所以这意味着添加某种grep或 mysql 查询在 procmail 配方中查看是否To:是有效的 ML。

有一个更好的方法吗?

我已经包括postconf -(n|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-unsubscribe.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:[mx2.mydomain.com]:2525
mydestination = $myhostname, localhost.$mydomain, localhost, $mydomain, lists.test.mydomain.com
mydomain = mydomain.com
myhostname = lists.mydomain.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.mydomain.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}

相关内容