I'm writing a Milter for Postfix, that handles incoming messages in a server (Postfix+Dovecot) with virtual domains and users. Communication beetweend Postfix and the Milter are done with the Sendmail Milter Protocol V 2
I really need that Dovecot (and Postfix by consequence) does not reject messages with invalid recipient, because I need the Milter to do this check (and reject as weel).
This is needed because i'm writing a PEC mail server (Pec stand for Posta Elettronica Certificata, that is an Italian implementation for certified mail).
When receiving mails with incorrect recipient, I need to produce a specific receipt in a form of an e-mail.
But Postfix in this case (told by dovecot) reject the mail BEFORE sending it to the Milter.
I've tried to search this in the documentation, but were not able to find this specific need.
I've attached PostFix configuration....
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
And dovecot configuration
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
}
I've found a solution:
I need to set in main.cf
virtual_mailbox_maps =
and leave it empty.