Email

在本地投遞郵件和轉發郵件

  • March 23, 2013

我有一個 debian 伺服器,它使用 exim4 作為 mta 和 courier-imap 來允許使用者閱讀 main. 郵件通常要麼在本地傳遞,要麼使用別名文件將郵件轉發到另一個地址。例如

# Local account: foo receives mail for foo@domain.com
somealias: bar@otherdomain.com
otheralias: foo, bar@otherdomain.com # Deliver both locally and remote

我們現在有一個電子郵件地址,我們希望可以通過 imap 訪問它,但也可以轉發到另一個電子郵件地址。這可以通過重命名帳戶並使用別名文件來實現,但是這也可以使用具有相同名稱的本地帳戶嗎?重命名帳戶需要在多個系統中進行相當多的重新配置。

# buz@domain.com needs to be de delivered to both baz@otherdomain.com and the "buz" local account
# Possible solution, rename buz account to buzdummy, but this would case other problems
buz: baz@otherdomain.com, buzdummy

只需執行您在別名文件中開始的操作 - 無需重命名:-)

buz: baz@otherdomain.com, buz

如果別名擴展為自我,則不會再次在循環中擴展而是跳過,因此將郵件轉發到外部並在本地傳遞。(參見 Exim文件)。

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