我刚刚在 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/valias
,postmap /etc/postfix/vmailbox
最后运行了postfix reload
。由于我使用 Courier 作为 IMAP 服务器,因此userdb -show
显示:
virtual
但当我尝试发送电子邮件至[电子邮件保护],Thunderbird 提示:
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
这个想法是从您的虚拟邮箱域生成到本地域的别名,因为 .forward 仅适用于本地域。
参考:postfix.org