On Apr 28, 2014, at 8:40 AM, Steffen Kaiser skdovecot@smail.inf.fh-brs.de wrote:
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
On Mon, 28 Apr 2014, Bill Eccles wrote:
correctly. But it's only a matter of time before Dovecot, or something, runs "doveadm index -u (usernames) (mailboxes)" on all of the mailboxes. As it does, it deletes thousands of messages, leaving, for example, the same 17 in INBOX and 3695 in "Deleted Items Archive". And 0 in others,
after you untar the files and before the automagic kicks in, can you run doveadm index -u (usernames) (mailboxes) via dtruss to make sure that command is deleting the messages?
Did you've enabled:
mail_debug=yes enables all kinds of mail related debug logging, such as showing where Dovecot is looking for mails.
http://wiki2.dovecot.org/Plugins/MailLog Maybe your client does that?
- -- Steffen Kaiser
Steffen--
Dtruss showed nothing unusual, and I'll bet you expected that. But this morning, as I was untarring the tarball, I noticed these two processes show up in the ps -ax list:
28445 ?? 0:14.98 find . -name *.shr-xs.mydomain.net* -print0 28446 ?? 0:00.00 xargs -0 rm
Since the mail services were off, hence Dovecot has no processes listed in ps -ax, I'm sure that I'm blaming Dovecot for something it ain't doing.
(dig dig dig... um...)
Ah... well, don't I feel foolish. It's my own sa-learn script at fault!
My script attempts to clean out the spam/ham folders like this:
cd /var/spool/imap/dovecot/mail/public/.Learn\ as\ Spam\ \(Bad\ E-mail\)/cur/ find . -name '*.shr-xs.mydomain.net*' -print0 | xargs -0 rm
and given that these two directories don't exist, it ends up running these commands from /. which cleans the entire hard drive of all items matching the pattern above.
Is there a better way to clean these directories out using native Dovecot commands (so I don't do this again!)?
Thanks for your help! Bill