不希望 Postfix+Dovecot 拒绝 "recipient not found" 封邮件

Don't want that Postfix+Dovecot reject "recipient not found" mails

我正在为 Postfix 编写 Milter,用于处理服务器 (Postfix+Dovecot) 中带有虚拟域和用户的传入消息。 Postfix 和 Milter 之间的通信是通过 Sendmail Milter Protocol V 2

完成的

我真的需要 Dovecot(以及 Postfix 因此)不拒绝收件人无效的邮件,因为我需要 Milter 来做这个检查(并拒绝 weel)。

这是必需的,因为我正在编写一个 PEC 邮件服务器(Pec 代表 Posta Elettronica Certificata,这是一种用于认证邮件的意大利实现)。

当收到收件人不正确的邮件时,我需要以电子邮件的形式出示特定的收据。

但是 Postfix 在这种情况下(由 dovecot 告知)在将邮件发送到 Milter 之前拒绝邮件。

我试图在文档中搜索此内容,但未能找到此特定需求。

我已附加 PostFix 配置....

compatibility_level = 2
queue_directory = /var/spool/postfix
command_directory = /usr/local/sbin
daemon_directory = /usr/local/libexec/postfix
data_directory = /var/db/postfix
mail_owner = postfix
myhostname = me2.andxor.it
mydomain = nessuno
myorigin = $myhostname
mydestination = localhost.$mydomain, localhost, localhost.localdomain
local_recipient_maps =
mynetworks = cidr:$config_directory/mynetworks
    recipient_delimiter = +
home_mailbox = Maildir/
debug_peer_level = 2
debugger_command =
     PATH=/bin:/usr/bin:/usr/local/bin:/usr/X11R6/bin
     ddd $daemon_directory/$process_name $process_id & sleep 5
sendmail_path = /usr/local/sbin/sendmail
newaliases_path = /usr/local/bin/newaliases
mailq_path = /usr/local/bin/mailq
setgid_group = maildrop
html_directory = /usr/local/share/doc/postfix
manpage_directory = /usr/local/man
sample_directory = /usr/local/etc/postfix
readme_directory = /usr/local/share/doc/postfix

inet_protocols = ipv4
meta_directory = /usr/local/libexec/postfix
shlib_directory = /usr/local/lib/postfix
#smtpd_milters = inet:127.0.0.1:10099, { inet:127.0.0.1:11332, default_action=accept}
#smtpd_milters = inet:127.0.0.1:11332, inet:127.0.0.1:10099
#smtpd_milters = { inet:127.0.0.1:11332, default_action=accept }, inet:127.0.0.1:10099
smtpd_milters = inet:127.0.0.1:10099

virtual_mailbox_domains=me2.andxor.it
virtual_mailbox_maps = mysql:$config_directory/mysql-virtual-mailbox-maps.cf
virtual_alias_maps = hash:$config_directory/hash-aliases.txt
virtual_transport = lmtp:unix:private/dovecot-lmtp
lmtp_destination_recipient_limit = 1

smtpd_sasl_auth_enable = yes
smtpd_sasl_type = dovecot
smtpd_sasl_path = private/auth
smtpd_relay_restrictions =
    permit_mynetworks,
    permit_sasl_authenticated,
    reject_unauth_destination
smtpd_sasl_authenticated_header=yes

和鸽舍配置

protocols = imap pop3 lmtp
protocols = imap pop3 lmtp

dict {
  #quota = mysql:/usr/local/etc/dovecot/dovecot-dict-sql.conf.ext
  #expire = sqlite:/usr/local/etc/dovecot/dovecot-dict-sql.conf.ext
}

!include conf.d/*.conf

disable_plaintext_auth=no 

namespace inbox {
  inbox = yes
  location =
  prefix = 
}

passdb {
  driver = sql
  args = /usr/local/etc/dovecot/dovecot-sql.conf.ext
}

userdb {
  driver = static
  args = uid=vmail gid=vmail home=/usr/local/data/mail/domains/%d/%n allow_all_users=yes
}

plugin {
  quota = maildir:User quota
  quota_rule = *:storage=1GB
  # 10% of 1GB = 100MB
  quota_rule2 = Trash:storage=+10%%
  # 20% of 1GB = 200MB
  quota_rule3 = Spam:storage=+20%%
}

service auth {
  unix_listener /var/spool/postfix/private/auth {
    group = wheel
    mode = 0600
    user = postfix
   }
}

service lmtp {
  unix_listener /var/spool/postfix/private/dovecot-lmtp {
    group = wheel
    mode = 0600
    user = postfix
    }
}

service quota-status {
    executable = quota-status -p postfix
    inet_listener {
        port = 12345
        # You can choose any port you want
    }
    client_limit = 1
}


  #quota = mysql:/usr/local/etc/dovecot/dovecot-dict-sql.conf.ext
  #expire = sqlite:/usr/local/etc/dovecot/dovecot-dict-sql.conf.ext
}

我找到了解决方案:

我需要在main.cf

中设置
virtual_mailbox_maps =

并将其留空。