I have the following postfix header_checks
and they have worked well for years:
/^Date: .* 21.*/ REJECT Your email has a date from the far future. Fix your system clock and try again.
/^Date: .* 20[3.*].*/ REJECT Your email has a date from the far future. Fix your system clock and try again.
/^Date: .* 20[2][5-9]/ REJECT Your email has a date from the future. Fix your system clock and try again.
/^Date: .* 20[2][0-3]/ REJECT Your email has a date from the past. Fix your system clock and try again.
/^Date: .* 20[1][0-9]/ REJECT Your email has a date from the past. Fix your system clock and try again.
/^Date: .* 200[0-9]/ REJECT Your email has a date from the past. Fix your system clock and try again.
/^Date: .* 19[0-9][0-9]/ REJECT Your email has a date from the past. Fix your system clock and try again.
I get the following warnings when I run postmap hash://...
with the file:
postmap: warning: //etc/postfix/header_checks, line 1: record is in "key: value" format; is this an alias file?
postmap: warning: //etc/postfix/header_checks, line 2: record is in "key: value" format; is this an alias file?
postmap: warning: //etc/postfix/header_checks, line 3: record is in "key: value" format; is this an alias file?
postmap: warning: //etc/postfix/header_checks.db: duplicate entry: "/^date:"
postmap: warning: //etc/postfix/header_checks, line 4: record is in "key: value" format; is this an alias file?
postmap: warning: //etc/postfix/header_checks.db: duplicate entry: "/^date:"
postmap: warning: //etc/postfix/header_checks, line 5: record is in "key: value" format; is this an alias file?
postmap: warning: //etc/postfix/header_checks.db: duplicate entry: "/^date:"
postmap: warning: //etc/postfix/header_checks, line 6: record is in "key: value" format; is this an alias file?
postmap: warning: //etc/postfix/header_checks.db: duplicate entry: "/^date:"
postmap: warning: //etc/postfix/header_checks, line 7: record is in "key: value" format; is this an alias file?
postmap: warning: //etc/postfix/header_checks.db: duplicate entry: "/^date:"
postmap: warning: //etc/postfix/header_checks, line 8: record is in "key: value" format; is this an alias file?
postmap: warning: //etc/postfix/header_checks.db: duplicate entry: "/^date:"
postmap: warning: //etc/postfix/header_checks, line 9: record is in "key: value" format; is this an alias file?
postmap: warning: //etc/postfix/header_checks, line 10: record is in "key: value" format; is this an alias file?
It seems to work, but I am always cautious with regard to warning on duplicates and this "key value" format warnings.
Any ideas on if these should work to filter out unwanted date-based timestamps? I've never had a problem, but I noticed more 21*
messages lately (and some 1969
messages, which makes no sense except for the fact that you can tell the system to use a time before epoch and usually indicates a more insidious error in the timestamp).
Or ... is there a better way to wrap the date stamps to prevent useless spam from previous or post eras?