Topic: doveadm not working as expected run expunge command
==== Provide required information ====
- iRedMail version and backend (LDAP/MySQL/PGSQL): 0.8.0
- Linux/BSD distribution name and version: debian
- Any related log? Log is helpful for troubleshooting.
====
I upgraded to dovecot 2
doveadm expunge -u wells@thedarktimes.us mailbox Trash savedbefore 7d
This does not work
doveadm expunge -u wells@thedarktimes.us mailbox Trash savedbefore 0d
This does work, however it removes everything
doveadm search -A mailbox Trash savedbefore 0d
This does not work
doveadm search -A mailbox Trash savedbefore 0d
This does work
any dovecot command with a savedbefore doesn't seem to work
Troubleshooting:
(a)
I have a expire table in the vmail database, I check the time_stamp and it looked correct, showed in the past.
(b)
doveadm fetch -u wells@thedarktimes.us date.saved mailbox Trash 1
date.saved: 2012-05-23 13:21:42
I think this is suppose to be the oldest deleted email?
If so, this is wrong
(c)
deleted the expire table and recreated it
mysql -u root -p
use vmail;
CREATE TABLE expires ( username varchar(75) not null, mailbox varchar(255) not null, expire_stamp integer not null, primary key (username, mailbox) );
(d)
now the expire table doesn't populate when I delete emails (this is a problem)
(e)
added to dovecot.conf
mail_plugins = $mail_plugins expire
and under each protocol, mail_plugins expire
/etc/dovecot/dovecot-dict-expire.conf
connect = host=127.0.0.1 dbname=vmail user=vmail password=**********************
map {
pattern = shared/expire/$user/$mailbox
table = expires
value_field = expire_stamp
fields {
username = $user
mailbox = $mailbox
}
}
/etc/dovecot/dovecot.conf
# Listen addresses.
# - '*' means all available IPv4 addresses.
# - '[::]' means all available IPv6 addresses.
# Use below setting to listen on all available addresses:
#listen = *, [::]
listen = *
#base_dir = /var/run/dovecot
# Enabled mail protocols.
protocols = pop3 imap sieve
# User/group who owns the message files:
mail_uid = 1001
mail_gid = 1001
# Assign uid to virtual users.
first_valid_uid = 1001
last_valid_uid = 1001
# Global Plugins
mail_plugins = $mail_plugins expire
# Logging. Reference: http://wiki2.dovecot.org/Logging
log_path = /var/log/dovecot.log
mail_debug = no
auth_verbose = no
auth_debug = no
auth_debug_passwords = no
# Possible values: no, plain, sha1.
auth_verbose_passwords = no
# SSL: Global settings.
# Refer to wiki site for per protocol, ip, server name SSL settings:
# http://wiki2.dovecot.org/SSL/DovecotConfiguration
ssl = yes
verbose_ssl = no
# ssl_cert = </etc/ssl/certs/iRedMail_CA.pem
# ssl_key = </etc/ssl/private/iRedMail.key
ssl_cert = </etc/ssl/certs/nm2.abgnetwork.net.pem
ssl_key = </etc/ssl/private/nm2.key
ssl_ca = </etc/ssl/certs/gd_bundle.pem
disable_plaintext_auth = no
# Mail location and mailbox format.
mail_location = maildir:/%Lh/Maildir/:INDEX=/%Lh/Maildir/
# Authentication related settings.
# Append this domain name if client gives empty realm.
#auth_default_realm =
# Authentication mechanisms.
auth_mechanisms = PLAIN LOGIN
service auth {
unix_listener /var/spool/postfix/dovecot-auth {
user = postfix
group = postfix
mode = 0666
}
unix_listener auth-master {
user = vmail
group = vmail
mode = 0666
}
}
# Virtual mail accounts.
userdb {
args = /etc/dovecot/dovecot-mysql.conf
driver = sql
}
passdb {
args = /etc/dovecot/dovecot-mysql.conf
driver = sql
}
plugin {
auth_socket_path = /var/run/dovecot/auth-master
quota = dict:user::proxy::quotadict
quota_rule = *:storage=1G
#quota_rule2 = *:messages=0
#quota_rule3 = Trash:storage=1G
#quota_rule4 = Junk:ignore
# Quota warning.
# If user suddenly receives a huge mail and the quota jumps from
# 85% to 95%, only the 95% script is executed.
quota_warning = storage=85%% quota-warning 85 %u
quota_warning2 = storage=90%% quota-warning 90 %u
quota_warning3 = storage=95%% quota-warning 95 %u
# Plugin: autocreate. Create and subscribe to default IMAP folders.
autocreate = INBOX
autocreate2 = Sent
autocreate3 = Trash
autocreate4 = Drafts
autocreate5 = Junk
autosubscribe = INBOX
autosubscribe2 = Sent
autosubscribe3 = Trash
autosubscribe4 = Drafts
autosubscribe5 = Junk
# Plugin: expire.
expire = Trash 7 Trash/* 7 Junk 30 Sent 30
expire_dict = proxy::expire
# ACL and share folder
acl = vfile
acl_shared_dict = proxy::acl
# Pigeonhole managesieve service.
# Reference: http://wiki2.dovecot.org/Pigeonhole/Sieve/Configuration
# Per-user sieve settings.
sieve_dir = /%Lh/sieve
sieve = /%Lh/sieve/dovecot.sieve
# Global sieve settings.
sieve_global_dir = /var/vmail/sieve
sieve_global_path = /var/vmail/sieve/dovecot.sieve
#sieve_before =
#sieve_after =
}
service quota-warning {
executable = script /usr/local/bin/dovecot-quota-warning.sh
unix_listener quota-warning {
user = vmail
group = vmail
mode = 0660
}
}
service dict {
unix_listener dict {
mode = 0660
user = vmail
group = vmail
}
}
dict {
# expire = db:/var/lib/dovecot/expire/expire.db
expire = mysql:/etc/dovecot/dovecot-dict-expire.conf
quotadict = mysql:/etc/dovecot/dovecot-used-quota.conf
acl = mysql:/etc/dovecot/dovecot-share-folder.conf
}
protocol lda {
# Reference: http://wiki2.dovecot.org/LDA
mail_plugins = quota sieve autocreate expire
auth_socket_path = /var/run/dovecot/auth-master
log_path = /var/log/sieve.log
lda_mailbox_autocreate = yes
postmaster_address = root
}
protocol imap {
imap_client_workarounds = tb-extra-mailbox-sep
mail_plugins = quota imap_quota autocreate expire
}
protocol pop3 {
mail_plugins = quota expire
pop3_client_workarounds = outlook-no-nuls oe-ns-eoh
pop3_uidl_format = %08Xu%08Xv
}
namespace {
type = private
separator = /
prefix =
#location defaults to mail_location.
inbox = yes
}
namespace {
type = shared
separator = /
prefix = Shared/%%u/
location = maildir:/%%Lh/Maildir/:INDEX=/%%Lh/Maildir/Shared/%%u
# this namespace should handle its own subscriptions or not.
subscriptions = yes
list = children
}
----
Spider Email Archiver: On-Premises, lightweight email archiving software developed by iRedMail team. Supports Amazon S3 compatible storage and custom branding.