From 8e4d671cb49ed740614ac804c5ce7c8f1e154e38 Mon Sep 17 00:00:00 2001 From: IKEDA Soji Date: Wed, 14 Jun 2023 07:02:25 +0900 Subject: [PATCH] Workaround for Issue 1685 --- src/lib/Sympa/List.pm | 18 ------------------ src/lib/Sympa/Message.pm | 4 ---- src/lib/Sympa/Spindle/ProcessOutgoing.pm | 9 --------- 3 files changed, 31 deletions(-) diff --git a/src/lib/Sympa/List.pm b/src/lib/Sympa/List.pm index e862d5b3b..6712183b1 100644 --- a/src/lib/Sympa/List.pm +++ b/src/lib/Sympa/List.pm @@ -5885,24 +5885,6 @@ sub add_list_header { ); $message->add_header('List-Help', join ', ', map { sprintf '<%s>', $_ } @urls); - } elsif ($field eq 'unsubscribe' and $options{oneclick}) { - if ($wwsympa_url - and my $id = $self->oneclick_id($options{oneclick})) { - my @urls = ( - Sympa::get_url($self, 'oneclick', paths => [$id]), - Sympa::Tools::Text::mailtourl( - Sympa::get_address($self, 'sympa'), - query => {subject => sprintf('SIG %s', $self->{'name'})} - ) - ); - # Overwrite existing fields to prevent forgery. - $message->delete_header('List-Unsubscribe-Post'); - $message->delete_header('List-Unsubscribe'); - $message->add_header('List-Unsubscribe-Post', - 'List-Unsubscribe=One-Click'); - $message->add_header('List-Unsubscribe', - join ', ', map { sprintf '<%s>', $_ } @urls); - } } elsif ($field eq 'unsubscribe') { my @urls = ( ($wwsympa_url ? (Sympa::get_url($self, 'signoff')) : ()), diff --git a/src/lib/Sympa/Message.pm b/src/lib/Sympa/Message.pm index 9523bb8b4..4378bcffb 100644 --- a/src/lib/Sympa/Message.pm +++ b/src/lib/Sympa/Message.pm @@ -471,8 +471,6 @@ sub dkim_sign { $log->syslog('err', 'Can\'t create Mail::DKIM::Signer'); return undef; } - # For One-Click Unsubscribe. - $dkim->extended_headers({'List-Unsubscribe-Post' => '*'}); # $new_body will store the body as fed to Mail::DKIM to reuse it # when returning the message as string. Line terminators must be @@ -535,8 +533,6 @@ sub arc_seal { $log->syslog('err', 'Can\'t create Mail::DKIM::ARC::Signer'); return undef; } - # For One-Click Unsubscribe. - $arc->extended_headers({'List-Unsubscribe-Post' => '*'}); # $new_body will store the body as fed to Mail::DKIM to reuse it # when returning the message as string. Line terminators must be diff --git a/src/lib/Sympa/Spindle/ProcessOutgoing.pm b/src/lib/Sympa/Spindle/ProcessOutgoing.pm index c14e6ee7c..1a4a24f5c 100644 --- a/src/lib/Sympa/Spindle/ProcessOutgoing.pm +++ b/src/lib/Sympa/Spindle/ProcessOutgoing.pm @@ -290,15 +290,6 @@ sub _twist { $return_path = Sympa::get_address($robot, 'owner'); } - # If message is personalized and DKIM signature is available, - # Add One-Click Unsubscribe header field. - if ( $new_message->{shelved}{merge} - and (%arc or $new_message->{shelved}{dkim_sign} and %dkim) - and grep { 'unsubscribe' eq $_ } - @{$list->{'admin'}{'rfc2369_header_fields'}}) { - $list->add_list_header($new_message, 'unsubscribe', - oneclick => $rcpt); - } if ( $new_message->{shelved}{merge} and $new_message->{shelved}{merge} ne 'footer') { unless ($new_message->personalize($list, $rcpt)) {