Craig Jackson writes:
Hi,The below script is supposed to delete mail in all IMAP folders older than 60 days. But it deletes more recent email also. Does anyone have an idea as to why this doesn't work? I post to this group because I am using courier-imap and I have no idea why this find command does not work. Does courier-imap change the email files? Thanks, Craig ################## #!/bin/bash DIR=/var/spool/exim/vmail find $DIR -type f -name "[0-9a-zA-Z]*\.[0-9a-zA-Z]*.server.domain.com" -mtime +60 -delete
You should be using -ctime instead of -mtime; however that should not matter 99% of the time. So I think you have something else that's going on.
For starters, you're using a filename pattern obviously in order to avoid deleting files in the main maildir directory. You should not rely on the specific name of message files, instead:
find $DIR/new $DIR/cur -type f -ctime +60
pgpvqj6CIWue2.pgp
Description: PGP signature
------------------------------------------------------------------------- Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys - and earn cash http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________ Courier-imap mailing list [email protected] Unsubscribe: https://lists.sourceforge.net/lists/listinfo/courier-imap
