Postfix 中是否可以同時擁有 shell 帳戶郵件信箱和虛擬信箱?

Postfix 中是否可以同時擁有 shell 帳戶郵件信箱和虛擬信箱?

我剛剛在 Postfix 中設定了我的第一個虛擬郵箱。我想知道是否可以在同一台伺服器上有兩個郵箱,一個是虛擬郵箱,一個是 shell 帳戶,並且在同一個網域內?

[email protected] => goes to /home/first/..
[email protected] => goes to /var/spool/mail/virtual/..

我需要的是使用.forward文件轉發電子郵件,並且僅適用於 shell 帳戶,而不適用於虛擬郵箱。所以我需要兩種類型的郵箱,一種用於存儲,一種用於轉發。

我遇到的問題是,當我將 mydomain.com 新增到mydestination清單時,虛擬郵箱中不會儲存任何電子郵件。 ThunderBird 提示:

An error occurred while sending mail. The mail server responded:  5.1.1 <[email protected]>: Recipient address rejected: User unknown in local recipient table. Please check the message recipient [email protected] and try again.

[更新]

這是我迄今為止所做的但沒有成功的事情:

我的/etc/postfix/main.cf

mydestination = localhost
virtual_mailbox_domains = mydomain.com
virtual_alias_maps = hash:/etc/postfix/valias
virtual_mailbox_base = /var/spool/mail/virtual
virtual_mailbox_maps = hash:/etc/postfix/vmailbox
virtual_minimum_uid = 100
virtual_uid_maps = static:5000
virtual_gid_maps = static:5000

我的/etc/postfix/valias

shell_account shell_account@localhost

我的/etc/postfix/vmailbox

[email protected] mydomain.com/virtual/

然後我就跑了postmap /etc/postfix/valiaspostmap /etc/postfix/vmailbox最後postfix reload。由於我使用 Courier 作為 IMAP 伺服器,因此userdb -show顯示:

virtual

但是當我嘗試發送電子郵件至[電子郵件受保護]、雷鳥提示:

An error occurred while sending mail. The mail server responded:  5.1.1 <[email protected]>: Recipient address rejected: User unknown in virtual mailbox table. Please check the message recipient [email protected] and try again.

[更新]

這是我的mail.log

postfix/smtpd[10098]: connect from localhost[127.0.0.1]
postfix/smtpd[10098]: NOQUEUE: reject: RCPT from localhost[127.0.0.1]: 550 5.1.1 <[email protected]>: Recipient address rejected: User unknown in virtual mailbox table; from=<mehran@localhost> to=<[email protected]> proto=ESMTP helo=<[127.0.0.1]>
postfix/smtpd[10098]: disconnect from localhost[127.0.0.1]

答案1

嗯,我不知道這是否滿足了您的需求。認為

mydestination = local.mydomain.com
virtual_mailbox_domains = mydomain.com

然後在 virtual_alias_maps 上新增別名

virtual_alias_maps = hash:/etc/postfix/virtual_alias

內容/etc/postfix/virtual_alias(已更新)

[email protected] second

這個想法是產生從您的 virtual_mailbox 網域到本機網域的別名,因為 .forward 僅適用於本機網域。

參考:postfix.org

相關內容