0

我正在为 Postfix 编写一个 Milter,它处理带有虚拟域和用户的服务器(Postfix+Dovecot)中的传入消息。通信 betweend Postfix 和 Milter 使用 Sendmail Milter Protocol V 2 完成

我真的需要 Dovecot(以及由此产生的 Postfix)不会拒绝收件人无效的邮件,因为我需要 Milter 来执行此检查(并拒绝接受)。

这是必需的,因为我正在编写 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
}
4

1 回答 1

0

我找到了一个解决方案:

我需要设置main.cf

virtual_mailbox_maps =

并将其留空。

于 2021-06-01T15:13:34.370 回答