Unverified Commit 29731df8 authored by IKEDA Soji's avatar IKEDA Soji Committed by GitHub
Browse files

Merge pull request #1064 from ikedas/issue-1063 by ikedas

Fixing #1063
parents 472a09ba 6fbbfdd8
......@@ -148,6 +148,20 @@ sub _twist {
}
}
# Check TT2 syntax for personalization feature.
if ($action !~ /\Areject\b/
and not $self->{confirmed_by} # Not in ProcessHeld spindle.
and $message->{shelved}{merge}
and $message->{shelved}{merge} ne 'footer' # 'all' or '1'(<=6.2.58)
and not _test_personalize($message, $list)
) {
$log->syslog('err',
'Failed to personalize. Message %s for list %s was rejected',
$message, $list);
Sympa::send_dsn($list, $message, {}, '5.6.5');
return undef;
}
if ($action =~ /^do_it\b/) {
$self->{quiet} ||= ($action =~ /,\s*quiet\b/); # Overwrite.
......@@ -178,20 +192,6 @@ sub _twist {
'md5_authenticated_messages');
}
# Check TT2 syntax for merge_feature.
if ( $message->{shelved}{merge}
and $message->{shelved}{merge} ne 'footer'
and not _test_personalize($message, $list)) {
$log->syslog(
'err',
'Failed to personalize. Message %s for list %s was rejected',
$message,
$list
);
Sympa::send_dsn($list, $message, {}, '5.6.5');
return undef;
}
# Keep track of known message IDs...if any.
$self->{_msgid}{$list->get_id}{$messageid} = time
unless $self->{confirmed_by};
......@@ -201,56 +201,14 @@ sub _twist {
not $self->{confirmed_by} # Not in ProcessHeld spindle.
and $action =~ /^request_auth\b/
) {
## Check syntax for merge_feature.
if ( $message->{shelved}{merge}
and $message->{shelved}{merge} ne 'footer'
and not _test_personalize($message, $list)) {
$log->syslog(
'err',
'Failed to personalize. Message %s for list %s was rejected',
$message,
$list
);
Sympa::send_dsn($list, $message, {}, '5.6.5');
return undef;
}
return ['Sympa::Spindle::ToHeld'];
} elsif ($action =~ /^editorkey\b/) {
$self->{quiet} ||= ($action =~ /,\s*quiet\b/); # Overwrite
# Check syntax for merge_feature.
if ( $message->{shelved}{merge}
and $message->{shelved}{merge} ne 'footer'
and not _test_personalize($message, $list)) {
$log->syslog(
'err',
'Failed to personalize. Message %s for list %s was rejected',
$message,
$list
);
Sympa::send_dsn($list, $message, {}, '5.6.5');
return undef;
}
return ['Sympa::Spindle::ToModeration'];
} elsif ($action =~ /^editor\b/) {
$self->{quiet} ||= ($action =~ /,\s*quiet\b/); # Overwrite
# Check syntax for merge_feature.
if ( $message->{shelved}{merge}
and $message->{shelved}{merge} ne 'footer'
and not _test_personalize($message, $list)) {
$log->syslog(
'err',
'Failed to personalize. Message %s for list %s was rejected',
$message,
$list
);
Sympa::send_dsn($list, $message, {}, '5.6.5');
return undef;
}
return ['Sympa::Spindle::ToEditor'];
} elsif ($action =~ /^reject\b/) {
my $quiet = $self->{quiet} || ($action =~ /,\s*quiet\b/);
......@@ -333,10 +291,6 @@ sub _test_personalize {
my $message = shift;
my $list = shift;
return 1
unless $message->{shelved}{merge}
and $message->{shelved}{merge} ne 'footer';
# Get available recipients to test.
my $available_recipients = $list->get_recipients_per_mode($message) || {};
# Always test all available reception modes using sender.
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment