bad headers
Nick Tait
nick at tait.net.nz
Wed Sep 24 08:05:29 CEST 2025
On 24/09/2025 02:47, pns1 at walkerclan.us wrote:
> Just to add a real life example to P at ricks message ...
>
> I have an old UPS that sends status via Email. It doesn't supply
> a Date field. So rejecting Emails of this sort would eliminate these
> status Emails, which would be a problem in my case.
>
> And a [bonus] side note. I am presently migrating my Email system
> to a new server. My MUA doesn't handle these "dateless" Emails very
> well, so I've developed some scan/fix scripts to find the old Emails
> and add a Date field, based on the Received headers.
Ideally you'd want your submission(s) service to clean up emails
originating from your network, including adding Date header if it is
missing. Although depending on how old your UPS is maybe it can only
send emails using (port 25) SMTP?
> On 9/23/25 07:22, Patrick Ben Koetter wrote:
>> * Benny Pedersen <me at junc.eu>:
>>> is it safe to reject based on this in amavisd.conf
>>>
>>> X-Amavis-Alert: BAD HEADER SECTION, Missing required header field:
>>> "Date"
>>>
>>> i don't know how to :/
>> Safe as in "you will not loose legitimate mail"? Personally I
>> wouldn't. Have
>> you considered to do an impact analysis based on the mail flow you
>> might want
>> to filter?
I've been rejecting Date-less emails for quite a few years and haven't
noticed anything legitimate getting blocked. The way I've achieved this
is using OpenDMARC with "RequiredHeaders true" in the configuration.
From "man opendmarc.conf":
RequiredHeaders (Boolean)
If set, the filter will ensure the header of the message
conforms to the basic header field count restrictions laid out in
RFC5322, Section 3.6. Messages failing this test are rejected without
further processing. A From: field from which no domain name could be
extracted will also be rejected.
Nick.
More information about the amavis-users
mailing list