[Dovecot] Deleting mail accounts older than 6 monthes
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.
Many thanks for any help.
Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com
On 12/21/06, Najib Abi Fadel nabifadel@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
On 12/21/06, falz me@falz.net wrote:
find /var/something -name dovecot.index -mtime +180
Whoops, this should be -180, not +180.
--falz
--On Thursday, December 21, 2006 12:03 AM -0800 Najib Abi Fadel nabifadel@yahoo.com wrote:
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.
The atime on the folder will tell you, if you haven't attempted to read the file since Dovecot last accessed it.
That means you can't run a verify against the file when backing up the partition. I get around this by remounting my partitions with noatime before doing my verify pass. (The backup is done with dump, which bypasses the filesystem and hence doesn't affect atime. But the verify is done with restore, which does go through the filesystem.)
I guess i am not using dovecot.index and apparently the atime option is not workin for me ! Is there any other way ?
I was considering the option of checking out the login time in the docevot log files in order to detect the users that has not logged in to their accounts during the last 6 monthes .
Kenneth Porter shiva@sewingwitch.com wrote: --On Thursday, December 21, 2006 12:03 AM -0800 Najib Abi Fadel wrote:
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.
The atime on the folder will tell you, if you haven't attempted to read the file since Dovecot last accessed it.
That means you can't run a verify against the file when backing up the partition. I get around this by remounting my partitions with noatime before doing my verify pass. (The backup is done with dump, which bypasses the filesystem and hence doesn't affect atime. But the verify is done with restore, which does go through the filesystem.)
Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com
On 22.12.2006, at 9.26, Najib Abi Fadel wrote:
I guess i am not using dovecot.index and apparently the atime
option is not workin for me ! Is there any other way ?I was considering the option of checking out the login time in the
docevot log files in order to detect the users that has not logged
in to their accounts during the last 6 monthes .
I wrote this page just now: http://wiki.dovecot.org/PostLoginScripting
participants (4)
-
falz
-
Kenneth Porter
-
Najib Abi Fadel
-
Timo Sirainen