[PATCH] pgarchives: parser: handle messages in which Message-ID is missing

From: Célestin Matte <celestin(dot)matte(at)cmatte(dot)me>
To: pgsql-www(at)lists(dot)postgresql(dot)org
Subject: [PATCH] pgarchives: parser: handle messages in which Message-ID is missing
Date: 2021-11-03 17:02:42
Message-ID: c12954dd-c19c-f809-f92c-116469c9543f@cmatte.me
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-www

Hello,

As surprising as it may seem, Message-ID is actually not a mandatory email field [1]. While most MTAs do add this field, some might not, and this will cause load_message.py to crash.
As a solution to this, when this field is missing, this patch:
- attempts to find a "Sent-Message-ID" header and use it as the Message-ID (a case I encountered when trying to import an old mbox)
- generates a new Message-ID if none exists, following (a simpler version of) [2].

[1] https://www.rfc-editor.org/rfc/rfc2822#section-3.6.4
[2] https://datatracker.ietf.org/doc/html/draft-ietf-usefor-message-id-00#section-3

Cheers,
--
Célestin Matte

Attachment Content-Type Size
0001-parser-handler-messages-in-which-Message-ID-is-missi.patch text/x-patch 3.0 KB

Responses

Browse pgsql-www by date

  From Date Subject
Next Message Célestin Matte 2021-11-03 17:05:44 Re: [PATCH] pgarchives: parser: handle messages in which Message-ID is missing
Previous Message Alvaro Herrera 2021-11-02 17:55:11 Re: [PATCH 2/3] Use orgname in templates to make them organization-generic