On 4/30/2015 8:49 AM, Alexei Yu. Batyr' wrote: > Managed Pvt nets wrote on 30.04.2015 13:50: >> All, >> Just a question that I hope you can help me with. I am trying to save >> some disk space, so what I need is to go through all mailboxes and >> finding out those that haven't been accessed in months and perhaps >> deleting some mails or mailboxes. Is there a way perhaps to do this in >> courier? >> > I'm using this script: > > #!/bin/sh - > echo "Mailboxes not checked for 6 months:" > find /home/*/Maildir -group mailusers -name cur -maxdepth 1 -prune > -mtime +180 -print | \ > sed -E "s/(\/home\/)|(\/Maildir\/cur)//g" | > while read usr > do > [ ! -f /home/$usr/Maildir/sqwebmail-timestamp ] && echo $usr && > continue > find /home/$usr/Maildir -name sqwebmail-timestamp -maxdepth 0 > -mtime +180 -exec echo $usr \; > done >
That assumes everyone is using sqwebmail. What I generally do is look for old messages in the "new" folder. If there are old messages there, it indicates that the user has not even looked at the mailbox since the date of the oldest message. -- Bowie ------------------------------------------------------------------------------ One dashboard for servers and applications across Physical-Virtual-Cloud Widest out-of-the-box monitoring support with 50+ applications Performance metrics, stats and reports that give you Actionable Insights Deep dive visibility with transaction tracing using APM Insight. http://ad.doubleclick.net/ddm/clk/290420510;117567292;y _______________________________________________ courier-users mailing list courier-users@lists.sourceforge.net Unsubscribe: https://lists.sourceforge.net/lists/listinfo/courier-users