[Dovecot] Deleting mail accounts older than 6 monthes

falz me at falz.net
Thu Dec 21 14:34:29 UTC 2006


On 12/21/06, Najib Abi Fadel <nabifadel at yahoo.com> wrote:
> Hi,
>
> i have a mail server with many users and i am using dovecot as pop3 server.
> I was wondering if there is a way to detect the last date each user logged
> in to the server for retrieving his mail.
>
> I need to delete the users that has not logged in to their accounts the last
> 6 monthes.

If you're using indexes, you could do a find on wherever you store the
indexes and see what the mtime was on it, which would generally
possibly do what you want. a find command with something like:

    find /var/something -name dovecot.index -mtime +180

which would find and print to screen any dovecot indexes that have a
modification time of 180 days or more.  you could pipe this to a file
or awk and get just the username out, assuming the maildir contains
the user's username. Above is a quick example, you may get multiple
output assuming people are using folders.

--falz


More information about the dovecot mailing list