On Mon, Jan 06, 2020 at 09:47:24PM +0100, Jos Chrispijn wrote: > Best check your header_checks configuration. It should look like this: > > /^Date: .* [0-1][0-9][0-9][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: .* 201[0-9]/ REJECT Your email has a date from the > past. Fix your system clock and try again. > /^Date: .* 2020/ DUNNO > /^Date: .* 20[2-9][1-9]/ REJECT Your email has a date in the > future. Fix your system clock and try again. > /^Date: .* 2[1-9][0-9][0-9]/ REJECT Your email has a date in the > future. Fix your system clock and try again. > /^Date: .* [3-9][0-9][0-9][0-9]/ REJECT Your email has a date in the > future. Fix your system clock and try again. > > Hope this helps!
Best to not use regular expressions for this at all. If you must perform this sort of check, do it in a pre-queue proxy filter or milter, using a proper date parser and by comparing to the current time. For a another take on misuse of regular expressions, see: https://stackoverflow.com/questions/1732348/regex-match-open-tags-except-xhtml-self-contained-tags/1732454#1732454 -- Viktor.