Commit e8c08216 authored by sikeda's avatar sikeda
Browse files

[-bug] (r12322) If ARF is malformed, it should be forwarded to listmaster, the manual says.


git-svn-id: https://subversion.renater.fr/sympa/branches/sympa-6.2-branch@12324 05aa8bb8-cd2b-0410-b1d7-8918dfa770ce
parent 2d4c18bc
......@@ -147,14 +147,30 @@ Subject: [% FILTER qencode %][%|loc%]A message archiving failed[%END%][%END%]
[% ELSIF type == 'automatic_bounce_management' -%]
[% PROCESS 'automatic_bounce_management.tt2' -%]
[% ELSIF type == 'bounce_management_failed' -%]
Subject: [% FILTER qencode %][%|loc%]A bounce management failed[%END%][%END%]
[% ELSIF type == 'arf_processing_failed' -%]
Subject: [% FILTER qencode %][%|loc%]Processing email feedback report failed[%END%][%END%]
Content-Type: multipart/mixed; boundary="[%boundary%]"
[%|loc(file,bad)%]Sympa could not handle bounce message '%1'. Moving it into directory '%2'.[%END%]
--[%boundary%]
Content-Disposition: inline
[%|loc%]Sympa could not handle email feedback report.[%END%]
[%|loc(list.name,list.host)%]List: %1@%2[%END%]
[%|loc(error)%]Error: %1[%END%]
[%|loc(feedback_type)%]Feedback type: %1[%END%]
[%|loc%]See logs for more details.[%END%]
--[%boundary%]
Content-Disposition: inline
Content-Type: message/rfc822
Content-Transfer-Encoding: 8bit
X-Sympa-Attach: yes
[%# msg #%]
--[%boundary%]--
[% ELSIF type == 'edit_list_error' -%]
Subject: [% FILTER qencode %][%|loc%]incorrect format of edit_list.conf[%END%][%END%]
......
......@@ -547,8 +547,49 @@ sub process_message {
grep {m/$email_regexp/}
map { lc($_ || '') } @{$report->{original_rcpt_to} || []};
# Malformed reports are forwarded to listmaster.
unless (@original_rcpts) {
$log->syslog(
'err',
'Ignoring Feedback Report %s for list %s: Unknown Original-Rcpt-To field. Can\'t do anything; feedback_type=%s',
$message,
$list,
$feedback_type
);
Sympa::send_notify_to_listmaster(
$list,
'arf_processing_failed',
{ error => 'Unknown Original-Rcpt-To field',
feedback_type => $feedback_type,
msg => $message,
}
);
return undef;
}
unless ($feedback_type
and $feedback_type =~
/b(?:abuse|fraud|not-spam|virus|other)\b/) {
$log->syslog(
'err',
'Ignoring Feedback Report %s for list %s: Unknown format; feedback_type=%s',
$message,
$list,
$feedback_type
);
Sympa::send_notify_to_listmaster(
$list,
'arf_processing_failed',
{ error => 'Unknown feedback type',
feedback_type => $feedback_type,
msg => $message,
}
);
return undef;
}
# Process report.
foreach my $original_rcpt (@original_rcpts) {
$log->syslog('debug',
$log->syslog('debug3',
'Email Feedback Report: %s feedback-type: %s; user: %s',
$list, $feedback_type, $original_rcpt);
......@@ -612,15 +653,17 @@ sub process_message {
} else {
$log->syslog(
'notice',
'Ignoring Feedback Report %s: Nothing to do for this feedback type.(feedback_type:%s, original_rcpt:%s, listname:%s)',
'Ignoring Feedback Report %s for list %s: Nothing to do for this feedback type; feedback_type=%s; original_rcpt=%s',
$message,
$list,
$feedback_type,
$original_rcpt,
$list
$original_rcpt
);
}
}
}
last; # feedback report may have only one block.
} # foreach my $report
} # if (... $report_type eq 'feedback-report')
$log->syslog('debug', 'Processing bounce %s for list %s', $message,
......
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