I'm trying to write a script to feed the mail in my spam folder to Spamassassin's sa-learn and then delete the mails older than 1 day in that spam folder. Here's my current directory listing:

blacklamb> ll /path/to/Maildir/.Spam/cur
total 70
-rw------- 1 user group 6118 Sep 22 02:08 1095844100.98444_0.blacklamb.mykitchentable.net:2,
-rw------- 1 user group 3545 Sep 22 02:21 1095844907.98477_0.blacklamb.mykitchentable.net:2,
-rw------- 1 user group 7408 Sep 22 03:18 1095848327.99825_0.blacklamb.mykitchentable.net:2,
-rw------- 1 user group 6560 Sep 22 03:44 1095849842.99908_0.blacklamb.mykitchentable.net:2,
-rw------- 1 user group 5203 Sep 22 04:57 1095854240.48102_0.blacklamb.mykitchentable.net:2,
-rw------- 1 user group 3313 Sep 22 05:21 1095855688.48172_0.blacklamb.mykitchentable.net:2,
-rw------- 1 user group 5718 Sep 22 06:34 1095860049.48407_0.blacklamb.mykitchentable.net:2,
-rw------- 1 user group 5254 Sep 22 07:22 1095862947.48525_0.blacklamb.mykitchentable.net:2,
-rw-r--r-- 1 user group 23314 Sep 21 18:41 1095863122.M795851P95252V00005B00I0031FB22_1.blacklamb.mykitchentable.net,S=23314:2,S

I'm trying to use the find command to do the deleting but am having trouble with the syntax. For testing, I'm using this command:

blacklamb> find /path/to/Maildir/.Spam/cur \! -newerct 1d -print

It finds nothing. I read in the manual that time specifications don't have much meaning without the '-' or '+' operator so I try adding it:

blacklamb> find /usr/home/tomlinson_dr/Maildir/.Spam/cur \! -newerct -1d -print
find: Can't parse date/time: -1d
blacklamb> find /usr/home/tomlinson_dr/Maildir/.Spam/cur \! -newerct +1d -print
find: Can't parse date/time: +1d

I've also tried a combination of adding ()'s around the expression but that hasn't worked either. What am I missing? Is this an appropriate choice for what I want to do? Is there another command better suited for this task?



Visit The Alchemist's Warehouse
Magic Tricks, DVDs, Videos, Books, & More!


Attachment: smime.p7s
Description: S/MIME Cryptographic Signature

Reply via email to