Linode Forum
https://forum.linode.com/

Make postfix block strange timestamps
https://forum.linode.com/viewtopic.php?f=11&t=7870
Page 1 of 1

Author:  Piki [ Wed Oct 05, 2011 11:24 am ]
Post subject:  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.

Author:  derfy [ Wed Oct 05, 2011 12:10 pm ]
Post subject: 

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)

Author:  Piki [ Wed Oct 05, 2011 12:25 pm ]
Post subject: 

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.

Author:  derfy [ Wed Oct 05, 2011 1:27 pm ]
Post subject: 

http://postgrey.schweikert.ch/

Author:  pclissold [ Wed Oct 05, 2011 3:42 pm ]
Post subject:  Re: Make postfix block strange timestamps

Piki wrote:
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:
Code:
header_checks = pcre:/etc/postfix/header_checks


Create header_checks:
Code:
# 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.

Author:  hoopycat [ Wed Oct 05, 2011 6:08 pm ]
Post subject: 

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

Author:  pclissold [ Wed Oct 05, 2011 6:11 pm ]
Post subject: 

hoopycat wrote:
(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.

Page 1 of 1 All times are UTC-04:00
Powered by phpBB® Forum Software © phpBB Group
http://www.phpbb.com/