Make postfix block strange timestamps

A lot of the spam that comes through to my Linode's email from strange timestamps, e.g. I'll receive emails from as much as 10 years ago and 5 years in the future. It's like I unintentionally created a digital time machine! :lol:

Anyway, these emails are harder to delete (or annoying, at the very least). I'm wandering if it's possible to tell postfix to check the timestamps and throw out any emails that are impossible to have been sent at the time which they come in.

6 Replies

You could probably do this with spamassassin. I'm sure it has rules to handle a date too far in the past/future.

Also worth looking at is greylisting. I don't even check any rbls anymore - I just greylist and 99% of my spam is gone (most spam sent by botnets won't bother retrying)

I'm already running spamassassin, and it does mark them. The problem here is removing them from my inbox so I'm not searching between my emails to remove them.

I've never heard of greylisting.

http://postgrey.schweikert.ch/

@Piki:

I'm wandering if it's possible to tell postfix to check the timestamps and throw out any emails that are impossible to have been sent at the time which they come in.

Add to postfix main.cf:

header_checks = pcre:/etc/postfix/header_checks

Create header_checks:

# Reject mails with dates far in the past or future - 
# they are designed to appear at the top or bottom of your inbox.
/^Date: .* 20[2-9][0-9]/     REJECT Date header is in the distant future.
/^Date: .* 201[2-9]/         REJECT Date header is in the future.
/^Date: .* 2010/             REJECT Date header is from last year.
/^Date: .* 200[0-9]/         REJECT Date header is from the past.
/^Date: .* 19[0-9][0-9]/     REJECT Date header is from the distant past.

(note: don't forget to update it annually)

@hoopycat:

(note: don't forget to update it annually)
Yeah; I usually spend a couple of hours on New Year's Day wondering why nobody emails me any more – then I update it.

Reply

Please enter an answer
Tips:

You can mention users to notify them: @username

You can use Markdown to format your question. For more examples see the Markdown Cheatsheet.

> I’m a blockquote.

I’m a blockquote.

[I'm a link] (https://www.google.com)

I'm a link

**I am bold** I am bold

*I am italicized* I am italicized

Community Code of Conduct