Najib Abi Fadel
2006-Dec-21 08:03 UTC
[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 -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://dovecot.org/pipermail/dovecot/attachments/20061221/b0eebdef/attachment.html>
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
Kenneth Porter
2006-Dec-21 15:50 UTC
[Dovecot] Deleting mail accounts older than 6 monthes
--On Thursday, December 21, 2006 12:03 AM -0800 Najib Abi Fadel <nabifadel at 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.)