[Dovecot] dovecot.index mtime

Benjamin R. Haskell dovecot at benizi.com
Thu Nov 15 01:40:23 EET 2007


On Wed, 14 Nov 2007, Matt wrote:

>> [...]
>>
>> I guess the issues I still think are important:
>>
>> 1. You shouldn't use dovecot.index as your marker file.
>
> I gave up trying to use dovecot.index.  Instead I look at each users
> ./new directory.  If there are any messages over 6 months old I put
> there email address in file that tells exim to reject any new
> messages.  Run the script in cron.daily so if they start using it
> again it will reactivate in 24 hours or less.  Having to look at all
> messages in the ./new folders is significantly more CPU and I/O load
> though.  Having run the script last night it seems to work fine.
> Audited some of email addresses it added to be blocked and none look
> out of place.

Glad to hear you've got something that's working for you.

For what it's worth, I'd look at the newest message in the ./cur folder, 
rather than the oldest in the ./new. (You want the last time the user 
looked at a message, not the first time the user got mail after being 
logged in.) The actual difference in times probably isn't an important 
detail when you're talking O(6 months).

But, the benefit is that you can get the timestamp for the last time the 
user read/deleted a message in ./cur simply by checking the change time of 
the ./cur directory. (rather than going through all its files)

e.g.
$ stat -c '%z (=%Z)' ~/Maildir/cur
2007-11-14 15:26:09.000000000 -0500 (=1195071992)
$ stat -c '%z (=%Z)' ~/Maildir/cur/* | sort | tail -n 1
2007-11-14 15:26:09.000000000 -0500 (=1195071992)

Should make it fast enough to run in cron.hourly, depending on your number 
of users/mailboxes.

Best,
Ben


More information about the dovecot mailing list