]> git.proxmox.com Git - pmg-api.git/commit
prefix message-id in attachment-quarantine
authorStoiko Ivanov <s.ivanov@proxmox.com>
Wed, 17 Jun 2020 15:04:05 +0000 (17:04 +0200)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Thu, 18 Jun 2020 16:29:26 +0000 (18:29 +0200)
commit809eab382afff88e02bf33da757d14cc7774c3b4
treedb2c534dd7bc05c7dbaaa943103b7b33b7c27897
parent05a7829ec22e54152d434632d2d00ee48fca0633
prefix message-id in attachment-quarantine

This patch fixes #2785.

When using the attachment quarantine - the message is:
a) stored in the quarantine unaltered
b) sent on with the attachment removed

Currently we do not change the message in any other way - in particular
we do not change the message-id header of any of the 2 mails.

When a mail is released from the attachment quarantine it is sent by PMG
with the same message-id as the mail with the attachments removed.

This is a violation of RFC 5322 (see [0]), and additionally newer versions
of Exchange do accept 2 mails with the same message-id but silently discard
the second version, thus making the attachment quarantine unusable for
Exchange users.

This patch simply prefixes the message-id with 'pmg-aquar-$$' (where $$ is
the pid of the pmg-smtp-filter process) for the mail without attachment.

By keeping the original message-id in the headers tracing the mailflow should
be facilitated.

The Message-ID is left intact on the original message in order to keep DKIM
signatures valid (they are invalidated on the modified mail by the removal
of the attachment anyways).

[0] https://tools.ietf.org/html/rfc5322 (section 3.6.4)

Signed-off-by: Stoiko Ivanov <s.ivanov@proxmox.com>
src/PMG/RuleDB/Remove.pm