Exim
Fixing duplicate message IDs using Exim
The DELL 3115CN device sends e-mails with duplicate message IDs when scanning documents. This can cause problems, because many mail servers (e.g. Zimbra) will not deliver additional messages with the same message ID. This means that a user can get a scanned document once, but all subsequent scans (within a certain time) will not arrive in her mailbox.
I implemented a fix for this using a DATA ACL in the configuration of the Exim server that relays the e-mails from the DELL 3115CN:
log_message = Replacing Message-ID header because DELL 3115CN generated duplicate IDs! ($h_Message-Id => DELL3115CN-$message_exim_id@$primary_hostname)
#remove_header = Message-Id
add_header = :after_received:Message-Id: <DELL3115CN-$message_exim_id@$primary_hostname>
In this example, 192.168.0.1 is the IP address of the DELL 3115CN.
In order to activate this rule on a Ubuntu or Debian system, you can place it in /etc/exim4/local/data_acl.conf and add a file /etc/exim4/conf.d/main/00_local_macros with the following line:
Obviously, this will only work if using the split configuration-file style.
You might have notice that the remove_header action is disabled. This is because Exim version 4.76 shipped with Ubuntu 12.04 LTS (Precise Pangolin) does not support this option yet. If you are using a more recent version of Exim, you might want to enable it, so that the wrong Message-Id header generated by the DELL 3115CN is removed.