我正在使用 Postfix 将来自三个不同域的电子邮件汇集到一个集合中,如下所示:
/etc/postfix/virtual
:
@domain1.de [email protected]
@domain2.de [email protected]
@domain3.de [email protected]
发送电子邮件至,[email protected]
结果出现以下标题:
Delivered-To: [email protected]
Return-Path: <[email protected]>
<[email protected]>
Received: from v2.domain1.de by v2.domain1.de with LMTP id pX7HGJd6ZGcVgBIAGUxxBA (envelope-from <[email protected]>) for <[email protected]>; Thu, 19 Dec 2024 19:57:11 +0000
Received: from mba.domain1.de (home.domain1.de [1.2.3.4]) by v2.domain1.de (Postfix) with ESMTP id 5CF148A278 for <[email protected]>; Thu, 19 Dec 2024 19:57:11 +0000 (UTC)
Received: by mba.domain1.de (Postfix, from userid 501) id 29B953B98524; Thu, 19 Dec 2024 20:57:11 +0100 (CET)
通用地址暴露了两次。我该如何避免这种情况,最好用[email protected]
实际收件人替换[email protected]
?
postconf -M :
smtp inet n - y - - smtpd
submission inet n - y - - smtpd -o syslog_name=postfix/submission -o smtpd_tls_security_level=encrypt -o smtpd_sasl_auth_enable=yes -o smtpd_relay_restrictions=permit_sasl_authenticated,reject -o smtpd_recipient_restrictions=permit_sasl_authenticated,reject -o smtpd_sasl_type=dovecot -o smtpd_sasl_path=private/auth
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 -o syslog_name=postfix/$service_name
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
postlog unix-dgram n - n - 1 postlogd
maildrop unix - n n - - pipe flags=DRXhu 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=FRX user=list argv=/usr/lib/mailman/bin/postfix-to-mailman.py ${nexthop} ${user}
postconf -n :
alias_database = hash:/etc/aliases
alias_maps = hash:/etc/aliases
append_dot_mydomain = no
biff = no
compatibility_level = 3.6
inet_interfaces = all
inet_protocols = all
mailbox_command =
mailbox_size_limit = 0
mailbox_transport = lmtp:unix:private/dovecot-lmtp
message_size_limit = 52428800
mydestination = domain1.de,domain2.de,domain3.de,localhost
myhostname = v2.domain1.de
mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128
myorigin = /etc/mailname
readme_directory = no
recipient_delimiter =
relayhost =
smtp_tls_CApath = /etc/ssl/certs
smtp_tls_loglevel = 1
smtp_tls_mandatory_protocols = !SSLv2, !SSLv3, !TLSv1, !TLSv1.1
smtp_tls_protocols = !SSLv2, !SSLv3, !TLSv1, !TLSv1.1
smtp_tls_security_level = may
smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache
smtpd_banner = $myhostname ESMTP $mail_name (Debian/GNU)
smtpd_enforce_tls = yes
smtpd_helo_required = yes
smtpd_helo_restrictions = permit_mynetworks permit_sasl_authenticated reject_invalid_helo_hostname reject_non_fqdn_helo_hostname reject_unknown_helo_hostname
smtpd_recipient_restrictions = reject_invalid_hostname reject_unauth_pipelining reject_unauth_destination permit_mynetworks, permit_sasl_authenticated, check_recipient_access hash:/etc/postfix/rcpt_blacklist
smtpd_relay_restrictions = permit_mynetworks permit_sasl_authenticated defer_unauth_destination
smtpd_sender_restrictions = permit_mynetworks permit_sasl_authenticated reject_unknown_sender_domain reject_unknown_reverse_client_hostname reject_unknown_client_hostname
smtpd_tls_cert_file = /etc/letsencrypt/live/v2.domain1.de-0001/fullchain.pem
smtpd_tls_key_file = /etc/letsencrypt/live/v2.domain1.de-0001/privkey.pem
smtpd_tls_loglevel = 1
smtpd_tls_mandatory_protocols = !SSLv2, !SSLv3, !TLSv1, !TLSv1.1
smtpd_tls_protocols = !SSLv2, !SSLv3, !TLSv1, !TLSv1.1
smtpd_tls_security_level = may
smtpd_tls_session_cache_database = btree:${data_directory}/smtpd_scache
smtpd_use_tls = yes
smtputf8_enable = no
virtual_maps = hash:/etc/postfix/virtual
这是正常且预期的行为。除非您知道自己在做什么,否则不要更改它,而且从您曾经询问过的事实来看,您似乎不知道,所以不要更改它。此外,只有邮件的收件人才能看到它,如果您不太信任收件人,我有一个坏消息要告诉您。访问该邮件的用户可能无论如何都会知道该地址,因为它必须是 IMAP 服务器的用户名,才能在一天结束时访问邮箱,对吗?
这用于抑制重复投递。如果邮件标题中包含地址
Delivered-To
,则不会再次投递到该地址。这是local
投递代理的一项功能,请参阅man 8 local
。您可以使用空来抑制
prepend_delivered_header
它main.cf
:阅读全文:
相反,最好将其更改
frozen_delivered_to
为:no
main.cf
那么它一定不会在别名扩展时更新。不过,我不确定它是如何工作的,从来没有用过它。
第二个实例是在
Received
标题中。同样,如果你碰巧在调试邮件时弄乱了这一点,那就怪你自己吧。即使你拥有所有的信息,这通常也已经够难的了,更不用说当它被故意弄乱或删除时。你可以用 来更改它header_checks
,请参阅此问题。更新:
显然,最后一个(最上面的)
Received
标题不是由 Postfix 制作的:它通过 LMTP 接收,这暗示了这一点。显然它是由 Dovecot 添加的,因为它是本地邮箱的传输设置
main.cf
:我一开始没有注意到这一点。在这种情况下,您需要通过添加该
Received
标头来设置 Dovecot 的行为。我不知道该怎么做,我自己从未使用过 Dovecot。另外,请记住,它可能无法确定原始信封收件人是谁,因为别名扩展或 Postfix 所做的任何操作都是在将邮件转发到 Dovecot 之前发生的。它只知道请求将邮件投递到 catch-all 地址。