I am trying to create a CRONjob to delete spam older than x days. I can do this from the command line with non-spam emails by using the following script:
find "/home/account/mail/example.com/username/cur/" -type f -mtime +15 -exec rm {} \;
The problem is that I also want to do this with spam email. The above script does not touch the spam.
I think the catch may be that I am using SpamBox. I'm not sure where SpamAssassin "stores" the emails it marks as spam, hence the issue find
ing it with the above script.
Can anyone help? Should I give this up as a fool's errand?
Note: server is collocated hosting with a cPanel. (I'm reasonably versed on the command line, but this info might be useful to you.)
doveadm
for the answer?dovecot
doesn't route mail, it lets you get at the inbox, but that configuration could still be informative in this case. When I said routing I was thinking aboutsendmail
orpostfix
and there's a good chanceprocmail
is involved. Any of those paths should help you find where the spam is stored. Recursively usingdu
might work too.