Since switching to lmtp in dovecot, mail to user+mailboix at example.com does
not get saved in ?.mailbox? as it did with LDA, instead it gets saved into the
INBOX. If it matters, these are users who do NOT have a ~/.active_sieve file. I
could understand (though it would bene a bit annoying) if the save overrode this
mechanism.
I did add lmtp_save_to_detail_mailbox = yes in the protocol lmtp block
protocol lmtp {
postmaster_address = postmaster at covisp.net # required
mail_plugins = quota sieve
info_log_path = /var/log/dovecot-lmtp.log
lmtp_save_to_detail_mailbox = yes
}
This is the error I am getting when sending to luser+covisp at covisp.net
lmtp(luser at covisp.net)<91193><EqkiJV70A105ZAEAIdGjjQ>: Error:
sieve: msgid=<A3ED963A-97FB-4A1F-9F09-45F2AEA96CF6 at kreme.com>: failed
to store into mailbox 'covisp': Mailbox doesn't exist: covisp
lmtp(luser at covisp.net)<91193><EqkiJV70A105ZAEAIdGjjQ>: Error:
sieve: Execution of script /usr/lib/dovecot/sieve/default.sieve failed with
unsuccessful implicit keep
# cat /usr/lib/dovecot/sieve/default.sieve
[13:32] [/var/log]
require "fileinto";
if header :contains "X-spam-flag" "YES" {
fileinto "Junk";
}
(This file hasn?t changed in a year, so it worked fine with the lda instead of
the lmtp setup. I mean, I can probably just write a sieve to do it. Let me
think?
if header :regex "to" ?+(.*)@" {
fileinto :create ?${1}";
stop;
}
Seems like it should work. Should I add this to default.sieve?
# 2.3.6 (7eab80676): /usr/local/etc/dovecot/dovecot.conf
# Pigeonhole version 0.5.6 (92dc263a)
# OS: FreeBSD 11.2-RELEASE-p10 i386
# Hostname: mail.covisp.net
auth_failure_delay = 5 secs
auth_mechanisms = PLAIN LOGIN
default_client_limit = 4096
default_process_limit = 1024
default_vsz_limit = 768 M
disable_plaintext_auth = no
first_valid_uid = 89
imap_id_log = *
login_log_format_elements = user=<%u> %r %m %c
mail_location = maildir:~/Maildir
mail_max_userip_connections = 90
managesieve_notify_capability = mailto
managesieve_sieve_capability = editheader fileinto reject envelope
encoded-character vacation subaddress comparator-i;ascii-numeric relational
regex imap4flags copy include variables body enotify environment mailbox date
ihave
namespace inbox {
inbox = yes
location =
mailbox Archive {
auto = subscribe
special_use = \Archive
}
mailbox Drafts {
special_use = \Drafts
}
mailbox Junk {
auto = subscribe
special_use = \Junk
}
mailbox Sent {
special_use = \Sent
}
mailbox Trash {
special_use = \Trash
}
prefix =
}
passdb {
args = /usr/local/etc/dovecot/sql.conf
driver = sql
}
plugin {
imapsieve_mailbox1_before = file:/usr/lib/dovecot/sieve/report-spam.sieve
imapsieve_mailbox1_causes = COPY
imapsieve_mailbox1_name = Junk
imapsieve_mailbox2_before = file:/usr/lib/dovecot/sieve/report-ham.sieve
imapsieve_mailbox2_causes = COPY
imapsieve_mailbox2_from = Junk
imapsieve_mailbox2_name = *
imapsieve_mailbox3_before = file:/usr/lib/dovecot/sieve/mark-read.sieve
imapsieve_mailbox3_causes = COPY
imapsieve_mailbox3_name = Archive
quota_rule2 = .EXPUNGED:ignore
sieve = file:~/.sieve;active=~/.active_sieve
sieve_default = /usr/lib/dovecot/sieve/default.sieve
sieve_default_name = spamassassin
sieve_extensions = +editheader
sieve_global_extensions = +vnd.dovecot.pipe +vnd.dovecot.environment
sieve_pipe_bin_dir = /usr/lib/dovecot/sieve
sieve_plugins = sieve_imapsieve sieve_extprograms
sieve_user_log = ~/sieve.log
}
service auth {
unix_listener /var/spool/postfix/private/auth {
mode = 0666
}
}
service imap-login {
inet_listener imaps {
port = 993
ssl = yes
}
}
service lmtp {
unix_listener /var/spool/postfix/private/dovecot-lmtp {
group = postfix
mode = 0600
user = postfix
}
}
service pop3-login {
inet_listener pop3 {
port = 0
}
inet_listener pop3s {
port = 995
ssl = yes
}
}
service stats {
unix_listener stats-reader {
group = dovecot
mode = 0666
user =
}
unix_listener stats-writer {
group = dovecot
mode = 0666
user =
}
}
ssl_cert = </usr/local/etc/dehydrated/certs/covisp.net/fullchain.pem
ssl_dh = # hidden, use -P to show it
ssl_key = # hidden, use -P to show it
ssl_min_protocol = TLSv1.1
userdb {
args = /usr/local/etc/dovecot/sql.conf
default_fields = uid=vpopmail gid=vchkpw
mail_location=maildir:/usr/local/virtual/%u/Maildir
mail=maildir:/usr/local/virtual/%u/Maildir
driver = sql
}
protocol imap {
mail_plugins = " imap_sieve"
}
protocol lmtp {
info_log_path = /var/log/dovecot-lmtp.log
lmtp_save_to_detail_mailbox = yes
mail_plugins = quota sieve
postmaster_address = postmaster at covisp.net
}