![Postfix — virtual_mailbox_domains 被拒绝](https://linux22.com/image/1022709/Postfix%20%E2%80%94%20virtual_mailbox_domains%20%E8%A2%AB%E6%8B%92%E7%BB%9D.png)
我在 Ubuntu 20.04 上运行 Postfix 3.4.13。
我如何打破它:
我尝试为每个子域配置虚拟邮箱(main.cf 和本文下方列出的参考文件)。
- 我从 mydestination= 中删除了 @mydomain.tld
- 我设置了 virtual_mailbox_domains = hash:/etc/postfix/virtual_mailbox_domains
- 我在 virtual_alias_maps= 参数中删除了 Unix 用户。
- 我定义了虚拟邮箱的位置。我在虚拟基目录中根据 maildir 预期布局 (cur new tmp) 创建了目录和子目录。
错误:
创建虚拟邮箱后,发送邮件至[电子邮件保护]来自 Gmail 帐户。
... connect from mail-qt1-f169.google.com[209.85.160.169]
... Anonymous TLS connection established from mail-qt1-f169.google.com[209.85.160.169]
... NOQUEUE: reject: RCPT from mail-qt1-f169.google.com[209.85.160.169]: 554 5.7.1 <[email protected]>: **Relay access denied;** from=<****@gmail.com> to=<[email protected]> proto=ESMTP helo=<mail-qt1-f169.google.com>
... disconnect from mail-qt1-f169.google.com[209.85.160.169] ehlo=2 starttls=1 mail=1 rcpt=0/1 bdat=0/1 quit=1 commands=5/7
如果我进入 /etc/postfix/main.cf 并指定 mydestination=mydomain.tld,则新的错误是:
... connect from mail-qk1-f177.google.com[209.85.222.177]
... Anonymous TLS connection established from mail-qk1-f177.google.com[209.85.222.177]
... NOQUEUE: reject: RCPT from mail-qk1-f177.google.com[209.85.222.177]: 550 5.1.1 <[email protected]>: **Recipient address rejected: User unknown in local recipient table;** from=<***@gmail.com> to=<[email protected]> proto=ESMTP helo=<mail-qk1-f177.google.com>
这让我相信我的虚拟邮箱域不起作用......
我将 /etc/postfix/main.cf 配置如下:
smtpd_tls_cert_file=/etc/ssl/certs/fullchain.pem
smtpd_tls_key_file=/etc/ssl/private/privkey.pem
smtpd_tls_security_level = may
smtp_tls_CApath=/etc/ssl/certs
smtp_tls_security_level = may
smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache
smtpd_relay_restrictions = permit_mynetworks permit_sasl_authenticated defer_unauth_destination
myhostname = localhost
alias_maps = hash:/etc/postfix/aliases
alias_database = hash:/etc/postfix/aliases
myorigin = /etc/mailname
mydestination = lamp, localhost.localdomain, localhost
relayhost =
mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128
mailbox_size_limit = 0
recipient_delimiter = +
inet_interfaces = all
inet_protocols = all
home_mailbox = Maildir/
smtpd_sasl_type = dovecot
smtpd_sasl_path = private/auth
smtpd_sasl_local_domain =
smtpd_sasl_security_options = noanonymous
smtpd_sasl_tls_security_options = noanonymous
broken_sasl_auth_clients = yes
smtpd_sasl_auth_enable = yes
smtpd_recipient_restrictions = permit_sasl_authenticated,permit_mynetworks,reject_unauth_destination
smtp_tls_note_starttls_offer = yes
smtpd_tls_loglevel = 2
smtpd_tls_received_header = yes
smtpd_tls_auth_only=no
smtpd_tls_session_cache_timeout=3600s
tls_random_source=dev:/dev/urandom
virtual_alias_maps = hash:/etc/postfix/virtual
virtual_mailbox_domains = hash:/etc/postfix/virtual_mailbox_domains
virtual_mailbox_base = /var/spool/mail
virtual_mailbox_maps = hash:/etc/postfix/virtual_mailbox_maps
virtual_minimum_uid = 100
virtual_uid_maps = static:5000
virtual_gid_maps = static:5000
- 别名
邮政局长:root
- /etc/邮件名称
我的域名.tld
- /etc/postfix/虚拟
[电子邮件保护]Unix 帐户
- virtual_mailbox_domains = hash:/etc/postfix/virtual_mailbox_domains (我对文件进行了“postmapped”)
虚拟邮箱域名 = mydomain.tld, wordpress.mydomain.tld, sentmail.mydomain.tld, imports.mydomain.tld,www.mydomain.tld
- 虚拟邮箱库 = /var/spool/mail
也许我没有正确创建邮箱?我手动创建了它们,每个邮箱都有一个名为“contact”的子目录。在“contact”中,我创建了“new”、“tmp”和“cur”子目录,并递归地将 /var/spool/mail/domain 所有权更改为 mailuser:mailuser。文件/文件夹的模式为 700。也许这还不够?
- virtual_mailbox_maps = hash:/etc/postfix/virtual_mailbox_maps (我对文件进行了“postmapped”)
[电子邮件保护] mydomain.tld/联系/ [电子邮件保护] wordpress.mydomain.tld/联系/ [电子邮件保护]sentmail.mydomain.tld/联系/ [电子邮件保护] 进口商.mydomain.tld/联系人/ [电子邮件保护] www.mydomain.tld/contact/ @mydomain.tld mydomain.tld/catchall/
- virtual_uid_maps = static:5000 <- 此用户存在。它被称为“mailuser”,并且拥有邮箱。
- virtual_gid_maps = static:5000 <- 该组存在。它被称为“mailuser”,并且拥有邮箱。
我不确定为什么我的虚拟域没有“呈现”。也许我不能使用散列的 virtual_mailbox_domains 和 virtual_mailbox_maps 文件?我将尝试使用未散列的文件...
当然我已经尝试过重新启动 postfix。
编辑:使用未散列的文件没有任何改变。