Strange enough, some of my mail domain external sender used to send us messages where Message-ID field set to $Null
like this:
...
Date: Tue, 1 Dec 2020 07:16:22 +0000
Message-ID: $Null
Subject: Test
...
(looks like this is due to Exchange + Outlook setup used in their company, but can't find more info).
This is a bit problem until recent times as Apple updated iOS mail client and recent Mail app in iOS messed up all messages list when try to analyze such a message.
The fix I try to implement is simple, I try to add this action to Exim's acl_check_data
:
warn
condition = ${if eq{$h_message-id:}{\$Null}}
remove_header = message-id : message_id : Message-ID : Message_ID
I tried many ways of referencing Message-ID header line but even that condition yields to true
the "remove header" action won't remove the Message-ID header line.
So please advice, how can I remove or (better) replace broken header line of Message-ID with some correct value?
Sorry for that i'm not familiar with Exim, however, I found a documentation about the message-id in Exim for your reference, please check if it's helpful to you: Message processing(
The Message-ID: header line
)Did you deploy an Exchange server for your accounts? If so, you could create a transport rule to modify the message-id in the message header according to the conditions: