need to delete incoming emails with a far future date
(I was suggested to create a new thread as another thread on this topic was very old.)
Some spammers send a mail to me, that is dated in 2030 trying to appear on top of my incoming mail list. It is an irritation to delete 50-70 such emails every day.
Is there some way to automatically blackhole such emails that are dated more than 2 days in future (to account for time zone issues)?
Thanks in advance!
-
Hey there! Are you using SpamAssassin? I know they have a date_in_future option that will help increase the spam score. What current spam filtering are you using? 0 -
From a quick test, it looks like emails from the future only have a score of about 1.3, which likely isn't enough to mark it as spam for some reason. You can also block them outright by creating a custom SA rule: edit /etc/mail/spamassassin/local.cf Append: score DATE_IN_FUTURE 20
This should mark these emails with a score of 20. Be sure to restart spamd when making changes to its config files. If you don't want to do this server-wide, you can also edit the local SA config: /home/$user/.spamassassin/user_prefs Of course, you need to make sure SpamAssassin is actually enabled.0 -
Here's what I tested for local.cf and seems to work: header FROM_THE_FUTURE Date =~ /20[3-9]\d-[0-1]\d-[0-3]\d [0-2]\d:[0-5]\d:[0-5]\d [A-Za-z]+/i score FROM_THE_FUTURE 20.0 describe FROM_THE_FUTURE Email from the future0 -
Thanks, @vanessa !!! 0
Please sign in to leave a comment.
Comments
4 comments