all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Maxim Cournoyer <maxim.cournoyer@gmail.com>
To: 63378@debbugs.gnu.org
Cc: arunisaac@systemreboot.net, Ricardo Wurmus <rekado@elephly.net>
Subject: bug#63378: A single X-Debbugs-CC header must be used
Date: Mon, 08 May 2023 13:17:40 -0400	[thread overview]
Message-ID: <875y92vj2j.fsf@gmail.com> (raw)

Hi,

After some tests, it appears that a single X-Debbugs-CC header must be
used, otherwise the last one is the one that prevails.  This matches my
reading of the 'process' script of the GNU Debbugs instance [0], and
thus must conform to the same email rules outlined in RFC5322 for the To
or CC fields (only one such header must be used); multiple values can be
separated by a comma. [1]

--8<---------------cut here---------------start------------->8---
my %header;

for my $hdr (@headerlines) {
    $hdr = decode_rfc1522($hdr);
    $_ = $hdr;
    s/\n\s/ /g;
    &finish if m/^x-loop: (\S+)$/i && $1 eq "$gMaintainerEmail";
    my $ins = !m/^subject:/i && !m/^reply-to:/i && !m/^return-path:/i
           && !m/^From / && !m/^X-Debbugs-/i && !m/^cc:/i && !m/^to:/i;
    $fwd .= $hdr."\n" if $ins;
    # print DEBUG ">$_<\n";
    if (s/^(\S+):\s*//) {
	my $v = lc $1;
	print DEBUG ">$v=$_<\n";
        ## There may be multiple To: or Cc: headers (see bug#5996).
        if ( ($v eq 'to' || $v eq 'cc') &&
	     defined $header{$v} && length($header{$v}) ) {
            $header{$v} = $header{$v} . ', ' . $_ if length($_);
        } else {
            $header{$v} = $_;
        }
    } else {
	print DEBUG "!>$_<\n";
    }
}
$header{'message-id'} = '' if not defined $header{'message-id'};
--8<---------------cut here---------------end--------------->8---

Only 'to' or 'cc' multiple headers are coalesced into one; otherwise the
$header specific key (for a given header) is overridden to the last
value encountered at line '$header{$v} = $_;', IIUC.

Our teams.scm script should be adjusted to produce a single X-Debbugs-CC
header with comma-separated values.

[0]  https://gitlab.com/npostavs/debbugs/-/blob/gnu-reconstruction/scripts/process#L171
[1]  https://datatracker.ietf.org/doc/rfc5322/, 3.6 Field Definitions

-- 
Thanks,
Maxim




             reply	other threads:[~2023-05-08 17:18 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-05-08 17:17 Maxim Cournoyer [this message]
2023-05-08 18:29 ` bug#63378: [PATCH] teams: Fix script to produce a single X-Debbugs-Cc header Maxim Cournoyer
2023-05-09 13:33   ` bug#63378: A single X-Debbugs-CC header must be used Maxim Cournoyer
2023-05-09 23:43     ` Arun Isaac
2023-05-10  1:15       ` Maxim Cournoyer
2023-05-09 23:55   ` bug#63378: [PATCH] teams: Fix script to produce a single X-Debbugs-Cc header Arun Isaac
2023-05-10 16:15     ` Maxim Cournoyer
2023-05-11 11:13       ` Arun Isaac
2023-05-11 13:18         ` Maxim Cournoyer
2023-05-11 23:59           ` Arun Isaac
2023-05-10  2:55 ` bug#63378: [PATCH v2] " Maxim Cournoyer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=875y92vj2j.fsf@gmail.com \
    --to=maxim.cournoyer@gmail.com \
    --cc=63378@debbugs.gnu.org \
    --cc=arunisaac@systemreboot.net \
    --cc=rekado@elephly.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/guix.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.