Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mia2E-0005CP-5o for pgsql-www@arkaria.postgresql.org; Thu, 04 Nov 2021 10:31:54 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1mia2D-0002fO-4J for pgsql-www@arkaria.postgresql.org; Thu, 04 Nov 2021 10:31:53 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mia2C-0002fF-UD for pgsql-www@lists.postgresql.org; Thu, 04 Nov 2021 10:31:52 +0000 Received: from mail-lf1-x133.google.com ([2a00:1450:4864:20::133]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1mia26-0003cS-82 for pgsql-www@lists.postgresql.org; Thu, 04 Nov 2021 10:31:52 +0000 Received: by mail-lf1-x133.google.com with SMTP id u11so11059698lfs.1 for ; Thu, 04 Nov 2021 03:31:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=hagander-net.20210112.gappssmtp.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=gRZD9z97f2ocSdVulLVYwT5+dR7G2Ew7E1zAW2/WmTk=; b=JiJcXO+3ve5jYwHvNQG/L2L1Rya4wqI+DddCGhtFaN5j7IFjh5oXSQ7lHxFns9bD1w Rj3ekDuebdS7yoa4B1s/jJdMFaojo+Mq+RKs+PBvM8XNBEtGyAn9EiFwOCnS49wTLgmX gOvTtMiPv7V8F5nqI+9PgpdoV3II/OSPPYpFr3mSTV9hcBle9m8en7fi/YE8GBK7sgSP 5wrOnh4tdc7YWKvQ5p/jxFPRnnLuvOUaE7yjkD3/zr2dl549s3Eua2ZXGlORizwE2mcr lR/8XN016nMgPYOS6g5KRBkWzUdianJIk2WSgQ4aonYvfVcNyIcqXurxBEoeRtGQS9oe beaQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=gRZD9z97f2ocSdVulLVYwT5+dR7G2Ew7E1zAW2/WmTk=; b=lCv35jf/fSfTKq9VMR4v3gfrQd4+G1vNsq+t47DMW02YFDzvf2L2vFvlsuGTzPC9xf tU/gTVz2iyTt5k2H4vQLbnFk9KgWYlM3P+B6X9n4wYFbujjUqvtzuGLTYpjgLWs/7Yhq YkCwU3eozJBO7EGgGZbwR3QCK8nY9twBy0sw48ZRarK3uaIjYe1AINTYiuLVQ2VQDPNq JbCZUTLQUXQWNwiZiZWF5SMby5CmRid54PcW5uk9AsVZRubMUBK5kIiNtu+cvffA7d/j WlLOMzn/uYBTfkAT2v3gzOBcsB+CQe6VY2JE8m6n0QrWeVx39vE22d1L5358Idx1D+nE D3Hw== X-Gm-Message-State: AOAM533EEi+WTQDij38t1UY2e8zHewxctBDz9E0WMBbCwLxMXUDUeavD K0wZLtRZK5qV8vseR2Rvl0Ej1zyClx147vocD1ScnzFUDgU= X-Google-Smtp-Source: ABdhPJwJpLiawV8zn5iQvr3FS59t0dbBITth5wTzb/vqgOMIzumSGOayQg2HMvznf37zGpyhdx/1fv55UDqJTN+lSf8= X-Received: by 2002:a19:8c1b:: with SMTP id o27mr25642173lfd.399.1636021904788; Thu, 04 Nov 2021 03:31:44 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Magnus Hagander Date: Thu, 4 Nov 2021 11:31:33 +0100 Message-ID: Subject: Re: [PATCH] pgarchives: parser: handle messages in which Message-ID is missing To: =?UTF-8?Q?C=C3=A9lestin_Matte?= Cc: pgsql-www@lists.postgresql.org Content-Type: multipart/alternative; boundary="0000000000007adea605cff4084a" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --0000000000007adea605cff4084a Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Wed, Nov 3, 2021 at 6:02 PM C=C3=A9lestin Matte wrote: > Hello, > > As surprising as it may seem, Message-ID is actually not a mandatory emai= l > field [1]. While most MTAs do add this field, some might not, and this wi= ll > 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-I= D > (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]. > I don't think this should be the responsibility of pglister. As you say, "most MTAs do add this field" -- and the solution is to configure the MTA to do this. We already rely on the MTA to get a lot of other important things right. It may be something that should get documented somewhere as a requirement. --=20 Magnus Hagander Me: https://www.hagander.net/ Work: https://www.redpill-linpro.com/ --0000000000007adea605cff4084a Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable


=
On Wed, Nov 3, 2021 at 6:02 PM C=C3= =A9lestin Matte <celestin.ma= tte@cmatte.me> wrote:
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 M= essage-ID (a case I encountered when trying to import an old mbox)
- generates a new Message-ID if none exists, following (a simpler version o= f) [2].

I don't think this should b= e the responsibility of pglister. As you say, "most MTAs do add this f= ield" -- and the solution is to configure the MTA to do this. We alrea= dy rely on the MTA to get a lot of other important things right.
=
It may be something that should get documented somewhere as = a requirement.=C2=A0

--
=C2=A0Magnus Hagander
=C2=A0= Me: https://www.haga= nder.net/
=C2=A0Work: https://www.redpill-linpro.com/
--0000000000007adea605cff4084a--