Linode Forum Index Linode Forum
Linode Community Forums
 


Make postfix block strange timestamps

Click here to go to the original topic

 
       Linode Forum Index -> Email/SMTP Related Forum
Author Message
Piki



Joined: 16 Jun 2011
Posts: 276
Location: Cyberspace

Posted: Wed Oct 05, 2011 10: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.
Back to top  
derfy



Joined: 20 Oct 2010
Posts: 68

Posted: Wed Oct 05, 2011 11:10 am    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)
Back to top  
Piki



Joined: 16 Jun 2011
Posts: 276
Location: Cyberspace

Posted: Wed Oct 05, 2011 11:25 am    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.
Back to top  
derfy



Joined: 20 Oct 2010
Posts: 68

Posted: Wed Oct 05, 2011 12:27 pm    Post subject:  

http://postgrey.schweikert.ch/
Back to top  
pclissold



Joined: 24 Oct 2003
Posts: 877
Location: Netherlands

Posted: Wed Oct 05, 2011 2: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.
Back to top  
hoopycat



Joined: 30 Aug 2008
Posts: 1294
Location: Rochester, New York

Posted: Wed Oct 05, 2011 5:08 pm    Post subject:  

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



Joined: 24 Oct 2003
Posts: 877
Location: Netherlands

Posted: Wed Oct 05, 2011 5: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.
Back to top  
 
       Linode Forum Index -> Email/SMTP Related Forum
Page 1 of 1