Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I use postfix, dovecot 2.1 and amavis for my emails.

How can I refuse emails (from other email servers) that date are to old (e.g. >=1 month) or to new (eg. >=1d in the future)?

share|improve this question
up vote 2 down vote accepted

Postfix has a header_check facility to allow you to scan headers and decide what to do with the email at that time.


/^Date: .* (19[0-9][0-9]|200[0-9]|2010)/   REJECT Your email is stuck in a timewarp 

This is an example of a date check. Unfortunately, this is not dynamic.

Postfix does support Sendmail milters. I quickly found a date type milter here:

I suspect you will likely need to use a Milter.

Alternatively, I am not sure if you are using something like Spamassassin, but it too may have rules to help flag emails with bad dates.

share|improve this answer
milter-date is what I looked for. When I start "milter-date" the process exit with return code 0 and no output. :/ – ChristophLSA Aug 19 '13 at 14:20

You can probably do something with header_checks, with the caveat that you'll probably have to manually update the regex to stay current, or you could write your own script to update it, ensuring that part of the script calls postfix reload or postconf <path to the file>. Spamassassin does have checks for these sort of things, but they usually happen after mail has been accepted, which is probably not ideal.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.