my $list_id = $header_obj->header('List-Id');
my ($archive_url, $user, $domain);
if (defined $list_id) {
- ($user, $domain) = ($list_id =~ /<(.+)\@(.+)>/g);
+ # due to a bug in old versions of public-inbox, <user@domain> was used
+ # as the list-Id instead of <user.domain> as recommended in RFC2919
+ ($user, $domain) = ($list_id =~ /<([^\.@]+)[\.@](.+)>/g);
if (defined $domain) {
$archive_url = "https://$domain/$user/";
if ($mid =~ /\A<(.+)>\z/) {
$mid = $1;
}
- $mid = uri_escape_utf8($mid);
+ $mid = uri_escape_utf8($mid,
+ '^A-Za-z0-9\-\._~!\$\&\';\(\)\*\+,;=:@');
$header_obj->header_set('List-Archive', "<$archive_url>");
foreach my $h (qw(Help Unsubscribe Subscribe Owner)) {