[Dovecot] problems with expire plugin
Hi all,
I'm experiencing problems to set-up the expire plugin in dovecot. This is the relevant part of my dovecot configuration
dict {
expire = mysql:/etc/dovecot/dovecot-dict-expire.conf.ext
}
plugin {
expire = Trash 15 Junk 15
expire_dict = proxy::expire
}
protocol imap {
mail_plugins = quota zlib expire imap_quota
}
File dovecot-dict-expire.conf.ext looks like:
connect = host=127.0.0.1 dbname=virtual_email user=<user> password=<passw>
map {
pattern = shared/expire/$user/$mailbox
table = virtual_expires
value_field = expire_stamp
fields {
username = $user
mailbox = $mailbox
}
}
and the mysql schema for table virtual_expires is:
+--------------+--------------+------+-----+---------+-------+
| Field | Type | Null | Key | Default | Extra |
+--------------+--------------+------+-----+---------+-------+
| username | varchar(75) | NO | PRI | NULL | |
| mailbox | varchar(255) | NO | PRI | NULL | |
| expire_stamp | int(11) | NO | | NULL | |
+--------------+--------------+------+-----+---------+-------+
However, when I delete any mail from the Inbox, the table is not updated, and there are no messages in the log, although mail_debug is set to "yes"
Does anybody has any idea on how to solve this issue?
Regards!
Felix
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
On Sat, 3 Aug 2013, Felix Rubio Dalmau wrote:
I'm experiencing problems to set-up the expire plugin in dovecot. This is the relevant part of my dovecot configuration
Well, one "relevant" part is missing: your Dovecot version. Therefore you should always post the dovecot -n output.
plugin { expire = Trash 15 Junk 15
This is a setting for Dovecot v1. Are you using Dovecot v2? Then see http://wiki2.dovecot.org/Plugins/Expire.
Regards,
Steffen Kaiser -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (GNU/Linux)
iQEVAwUBUf9ENl3r2wJMiz2NAQI/hAf5AQpkY7T/vmHbL/5FN6nyFC7yz8AJk4ta zxXTKC+GNisuwym9n6PVWXVxuQErQ4616U7xP241tZlbJSs9gJnhV9hvuV1SCKY1 uA2c5+u62H5ejKo3RPsqWeidmjopZ/UyQfO1wvbCl10KhT/UsC78yxInGCwHXnoR Dihmb3JCMRZbTrCpApLLmG+T2ouyd88YPW5WFdVstVLXvmCnCE3XPXwhZqk9QebV oEFPNeMgjmEA9ya8PhCB1EVtDtdz1BTpk1MOJlQwlv4vc1C0dNNKPA384Tjen8d7 bEywZfIPsyLa9lEB5CQl2Z0EFuXrLraC6VlMvdYbCbnolsfFNp0miA== =TA9E -----END PGP SIGNATURE-----
Sorry, Steffen. My version of dovecot is
# 2.1.7: /etc/dovecot/dovecot.conf # OS: Linux 3.9.4-15 x86_64 Debian jessie/sid ext4
Sorry for the mistake.
Regards,
Felix
On Monday 05 August 2013 08:20:38 Steffen Kaiser wrote:
On Sat, 3 Aug 2013, Felix Rubio Dalmau wrote:
I'm experiencing problems to set-up the expire plugin in dovecot. This is the relevant part of my dovecot configuration
Well, one "relevant" part is missing: your Dovecot version. Therefore you should always post the dovecot -n output.
plugin { expire = Trash 15 Junk 15
This is a setting for Dovecot v1. Are you using Dovecot v2? Then see http://wiki2.dovecot.org/Plugins/Expire.
Regards,
-- Steffen Kaiser
Sorry, Steffen. My version of dovecot is
# 2.1.7: /etc/dovecot/dovecot.conf # OS: Linux 3.9.4-15 x86_64 Debian jessie/sid ext4
Additionally, I have corrected the plugin parameters as you suggested. Now looks like:
plugin { expire = Trash expire2 = Trash/* expire3 = Junk expire4 = Junk/* expire_dict = proxy::expire }
However, the table is not updated anyway :S
Sorry for the mistake.
Regards,
Felix
On Monday 05 August 2013 08:20:38 Steffen Kaiser wrote:
On Sat, 3 Aug 2013, Felix Rubio Dalmau wrote:
I'm experiencing problems to set-up the expire plugin in dovecot. This is the relevant part of my dovecot configuration
Well, one "relevant" part is missing: your Dovecot version. Therefore you should always post the dovecot -n output.
plugin { expire = Trash 15 Junk 15
This is a setting for Dovecot v1. Are you using Dovecot v2? Then see http://wiki2.dovecot.org/Plugins/Expire.
Regards,
-- Steffen Kaiser
Le 5 août 2013 à 10:34, Felix Rubio Dalmau a écrit :
Sorry, Steffen. My version of dovecot is
# 2.1.7: /etc/dovecot/dovecot.conf # OS: Linux 3.9.4-15 x86_64 Debian jessie/sid ext4
Additionally, I have corrected the plugin parameters as you suggested. Now looks like:
plugin { expire = Trash expire2 = Trash/* expire3 = Junk expire4 = Junk/* expire_dict = proxy::expire }
However, the table is not updated anyway :S
Hello Felix,
Have you enabled the plugin globally (i.e. mail_plugins = expire ...)?
Otherwise, please help us with the output of doveconf -n. ;-)
Axel
Ooook! Here it goes! :-)
Thank you!
Felix
# 2.1.7: /etc/dovecot/dovecot.conf
# OS: Linux 3.9.4-15 x86_64 Debian jessie/sid ext4
auth_cache_size = 1 M
auth_failure_delay = 10 secs
auth_mechanisms = plain login
auth_verbose = yes
auth_verbose_passwords = sha1
auth_worker_max_count = 2
base_dir = /var/run/dovecot/
dict {
expire = mysql:/etc/dovecot/dovecot-dict-expire.conf.ext
}
listen = *
log_timestamp = "%Y-%m-%d %H:%M:%S "
login_greeting = Imap Server ready.
mail_access_groups = vmail
mail_gid = vmail
mail_home = /home/vmail/%d/%n/home
mail_location = maildir:/home/vmail/%d/%n
mail_plugins = quota zlib
mail_privileged_group = vmail
mail_uid = vmail
managesieve_notify_capability = mailto
managesieve_sieve_capability = 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 Drafts {
auto = subscribe
special_use = \Drafts
}
mailbox Junk {
auto = subscribe
special_use = \Junk
}
mailbox Sent {
auto = subscribe
special_use = \Sent
}
mailbox "Sent Messages" {
special_use = \Sent
}
mailbox Trash {
auto = subscribe
special_use = \Trash
}
prefix =
type = private
}
passdb {
args = /etc/dovecot/dovecot-sql.conf.ext
driver = sql
}
plugin {
expire = Trash
expire2 = Trash/*
expire3 = Junk
expire4 = Junk/*
expire_dict = proxy::expire
quota = maildir:User quota
quota_rule = *:storage=200M
quota_rule2 = Trash:storage=+10%%
quota_rule3 = Junk:ignore
quota_warning = storage=95%% quota-warning 95 %u
quota_warning2 = storage=80%% quota-warning 80 %u
sieve = /home/vmail/%d/%n/dovecot.sieve
sieve_default = /home/vmail/sieve/default.sieve
sieve_dir = /home/vmail/%d/%n/sieve
sieve_global_dir = /home/vmail/sieve/global/
zlib_save = gz
zlib_save_level = 6
}
postmaster_address = some@mail.org
protocols = imap sieve lmtp
service auth {
unix_listener /var/spool/postfix/private/auth {
group = postfix
mode = 0660
user = postfix
}
unix_listener auth-userdb {
group = vmail
mode = 0660
}
}
service dict {
unix_listener dict {
group = vmail
mode = 0660
}
}
service imap-login {
inet_listener imaps {
port = 0
}
process_min_avail = 3
service_count = 1
}
service imap {
process_limit = 30
}
service lmtp {
unix_listener /var/spool/postfix/private/dovecot-lmtp {
group = postfix
mode = 0600
user = postfix
}
}
service managesieve-login {
inet_listener sieve {
port = 4190
}
process_min_avail = 0
service_count = 1
vsz_limit = 64 M
}
service pop3-login {
inet_listener pop3 {
port = 0
}
inet_listener pop3s {
port = 0
}
}
ssl_cert = </etc/postfix/ssl/mail.server.pem
ssl_key = </etc/postfix/ssl/mail.server.key
submission_host = 127.0.0.1:587
userdb {
args = /etc/dovecot/dovecot-sql.conf.ext
driver = sql
}
protocol lmtp {
mail_plugins = quota zlib sieve
}
protocol lda {
mail_plugins = quota zlib sieve
}
protocol imap {
mail_max_userip_connections = 10
mail_plugins = quota zlib expire imap_quota
}
protocol sieve {
mail_max_userip_connections = 10
managesieve_implementation_string = Dovecot Pigeonhole
managesieve_max_compile_errors = 5
managesieve_max_line_length = 65536
}
Le 5 août 2013 à 13:15, Felix Rubio Dalmau a écrit :
Ooook! Here it goes! :-)
Thank you!
Felix
# 2.1.7: /etc/dovecot/dovecot.conf # OS: Linux 3.9.4-15 x86_64 Debian jessie/sid ext4 [...] mail_plugins = quota zlib [...]
Thanks too. :-)
The first thing I would try is this one:
mail_plugins = quota zlib expire
Axel
Le 5 août 2013 à 13:28, Axel Luttgens a écrit :
[...]
The first thing I would try is this one:
mail_plugins = quota zlib expire
Moreover, I guess you should also update your lmtp/lda sections:
protocol lmtp {
mail_plugins = quota zlib sieve expire
}
protocol lda {
mail_plugins = quota zlib sieve expire
}
Axel
AWESOME!!!
I'm sorry I missed it! Now the table gets correctly updated. Now the question is: How should I configure the expires to be different for different boxes? I see that the expires plugin keeps the track of the oldest message on the boxes tracked, only. Should I configure cronjobs like this, for each mailbox to be expunged?
doveadm expunge -A mailbox Trash savedbefore <numdays>d
Thank you very much to you all!! :-)
Felix
On Monday 05 August 2013 13:45:18 Axel Luttgens wrote:
Le 5 août 2013 à 13:28, Axel Luttgens a écrit :
[...]
The first thing I would try is this one:
mail_plugins = quota zlib expire
Moreover, I guess you should also update your lmtp/lda sections:
protocol lmtp { mail_plugins = quota zlib sieve expire } protocol lda { mail_plugins = quota zlib sieve expire }
Axel
Le 5 août 2013 à 15:10, Felix Rubio Dalmau a écrit :
[...] Now the question is: How should I configure the expires to be different for different boxes? I see that the expires plugin keeps the track of the oldest message on the boxes tracked, only. Should I configure cronjobs like this, for each mailbox to be expunged?
doveadm expunge -A mailbox Trash savedbefore <numdays>d
Hello Felix,
This might be worth a new thread...
Anyway, I think you are right about the need of having jobs run periodically.
Perhaps could you devise a single job, by ORing your queries as described in the man page for doveadm-search-query(7); you may find an example at http://www.dovecot.org/list/dovecot/2012-August/067983.html.
But I don't know which approach (multiple jobs vs single job) would be the most efficient.
HTH, Axel
participants (3)
-
Axel Luttgens
-
Felix Rubio Dalmau
-
Steffen Kaiser