0

I started getting spam backdated by a few years. Is there an easy way to detect and divert these to /dev/null using procmail?

2 Answers2

1

If the date is definitely present then something simple like:


 # The order of the recipes is significant
 #  header format is "Date: Sat, 13 Feb 2010"
 :0
 * ^Date: .*,.*200[0-9]
 /dev/null
PP.
  • 3,316
  • 6
  • 27
  • 31
  • Well, if date is not present, then the mail is not backdated, so it's correct your filter does not match in that case :-). – sleske Jul 25 '10 at 20:11
-1

It's actually independent of procmail, but a cronjob that run at a fixed period could do this:

find /maildirectory -type f -mtime +7 -exec rm -rf {}\;

This would delete mail over a week old.

Coops
  • 6,055
  • 1
  • 34
  • 54
  • -1 The question is about deleting *backdated* mails (i.e. the mail arrives now, but with a date of like "2008"). Your solution would just delete mail that *arrived* more than 7 days ago :-(. – sleske Jul 25 '10 at 20:10