Do you have IMAP access?
edit: Or is this going to be ran on the email server itself? If so what software are you using?
My client is using MAC Mail which apparently doesn't work very well as far as purging mail after x months.
I'm running this directly on the server. I am not using any software, just direct command line/cron.
I found the path to the folder:
/home/user/mail/domain/account/cur = inbox
/home/user/mail/domain/account/.Sent = sent messages
so now i can just use:
find /path/to/files* -mtime +200 -exec rm {} \;
Sweet.
Cron jobs are a valuable skill to learn if you are going to be working with servers.
I know how to setup cron jobs... I have over 30 running on this server alone. My linux command line and mail folder structure knowledge is what was lacking.