Skip to main content

need to delete incoming emails with a far future date

Comments

4 comments

  • cPRex Jurassic Moderator
    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
  • vanessa
    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
  • vanessa
    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 future
    0
  • cPRex Jurassic Moderator
    Thanks, @vanessa !!!
    0

Please sign in to leave a comment.