Email

後綴:virtual_alias_maps 將所有內容傳遞給一個使用者,儘管有新域

  • November 19, 2010

我有一個postfix處理幾個域的郵件的安裝,所有郵件都發送給一個真正的本地使用者(cmb),我想為第二個使用者添加一個新域(我們稱之為example.org),但所有內容都被傳遞到cmb. 這裡是/etc/postfix/virtual

chris@boyle.name cmb
@chris.boyle.name cmb
@cmb.is-a-geek.org cmb
@example.org newperson

這是大部分/etc/postfix/main.cf,完整的文件,應要求提供。我沒有設置luser_relay

myhostname = nova.chris.boyle.name
alias_maps = hash:/etc/aliases
alias_database = hash:/etc/aliases
myorigin = chris.boyle.name
mydestination = chris.boyle.name, nova.chris.boyle.name, nova, localhost.localdomain, localhost
mynetworks_style = host
mailbox_command = procmail -a "$EXTENSION"
virtual_alias_domains   = cmb.is-a-geek.org example.org
virtual_alias_maps      = hash:/etc/postfix/virtual
smtpd_sender_login_maps = hash:/etc/postfix/virtual

這裡是/etc/aliases

# See man 5 aliases for format
postmaster: cmb
root: cmb

請注意,aliases.dbvirtual.db都比它們的純文字版本更新,並且postfix已重新啟動無效。test@example.org用於執行此操作的測試郵件mail.log(我已編輯此日誌提取以創建域example.org)。

Aug 30 12:48:59 nova postfix/smtpd[32520]: 795B53D558: client=goggins.uwcs.co.uk[89.16.166.19]
Aug 30 12:48:59 nova postfix/cleanup[32530]: 795B53D558: message-id=<20090830114859.GA15341@warwickcompsoc.co.uk>
Aug 30 12:48:59 nova dkim-filter[2074]: 795B53D558 external host goggins.uwcs.co.uk attempted to send as uwcs.co.uk
Aug 30 12:48:59 nova dkim-filter[2074]: 795B53D558 ASP query: missing parameter(s) in policy data
Aug 30 12:48:59 nova spamd[2385]: spamd: connection from localhost [127.0.0.1] at port 38371 
Aug 30 12:49:00 nova spamd[2385]: spamd: using default config for test@example.org: /srv/chris.boyle.name/spamassassin/user_prefs 
Aug 30 12:49:00 nova spamd[2385]: spamd: processing message <20090830114859.GA15341@warwickcompsoc.co.uk> for test@example.org:1000 
Aug 30 12:49:05 nova spamd[2385]: spamd: clean message (-5.2/5.0) for test@example.org:1000 in 5.3 seconds, 1002 bytes. 
Aug 30 12:49:05 nova spamd[2385]: spamd: result: . -5 - AWL,BAYES_00,LOCALPART_IN_SUBJECT,RCVD_IN_DNSWL_MED,SPF_PASS,UNPARSEABLE_RELAY scantime=5.3,size=1002,user=test@example.org,uid=1000,required_score=5.0,rhost=localhost,raddr=127.0.0.1,rport=38371,mid=<20090830114859.GA15341@warwickcompsoc.co.uk>,bayes=0.000000,autolearn=ham 
Aug 30 12:49:05 nova postfix/qmgr[32518]: 795B53D558: from=<cmb@warwickcompsoc.co.uk>, size=966, nrcpt=1 (queue active)
Aug 30 12:49:05 nova postfix/smtpd[32520]: disconnect from goggins.uwcs.co.uk[89.16.166.19]
Aug 30 12:49:05 nova postfix/local[32533]: 795B53D558: to=<cmb@chris.boyle.name>, orig_to=<test@example.org>, relay=local, delay=6.1, delays=6.1/0.01/0/0.02, dsn=2.0.0, status=sent (delivered to command: procmail -a "$EXTENSION")
Aug 30 12:49:05 nova postfix/qmgr[32518]: 795B53D558: removed

請注意它在最後傳遞cmb:我真的很想知道為什麼。

Robot101幫我解決了這個問題。訣竅是virtual_alias_maps它將有效地遞歸,直到地址不變,並且地圖右側的不合格本地部分將被限定為myorigin,所以會發生這種情況:

foo@example.org  -> newperson@chris.boyle.name -> cmb@chris.boyle.name

因此,我可以通過更改myoriginnova.chris.boyle.name(並修復我的地址規範化(使用canonical_maps)以@chris.boyle.name在發件人地址中使用)來解決它。這樣,映射到 上foo@nova.chris.boyle.name,地圖不會進一步改變,並且仍然將這台機器作為其最終目的地。或者,我可以使用@nova.chris.boyle.name.

引用自:https://serverfault.com/questions/60543