Skip to content
This repository has been archived by the owner on Jan 25, 2018. It is now read-only.

Commit

Permalink
[-feature] DSN will be returned if message bound for sympa robot does…
Browse files Browse the repository at this point in the history
… never contain commands.

git-svn-id: https://subversion.renater.fr/sympa/branches/sympa-6.2-branch@12663 05aa8bb8-cd2b-0410-b1d7-8918dfa770ce
  • Loading branch information
sikeda committed Jan 31, 2016
1 parent 7776ff0 commit 060a406
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 34 deletions.
22 changes: 0 additions & 22 deletions default/mail_tt2/command_report.tt2
Original file line number Diff line number Diff line change
Expand Up @@ -185,28 +185,6 @@ Warning: this message may already have been sent by one of the list's editor.[%E
[%- FOREACH i_err = intern_errors -%]
> [% i_err.cmd %]

[% END -%]
[% END -%]
[%############################-%]
[%########## GLOBALS #########-%]
[%############################-%]
[% IF nb_global %]
[%- FOREACH glob = globals -%]

==========================================

[% IF glob.entry == 'error_content_type' -%]
[%|loc%]Ignoring message body not in text/plain, please use text/plain only (or put your command in the subject).[%END-%]

[% ELSIF glob.entry == 'no_cmd_found' -%]
[%|loc%]No command found in message.[%END%]

[% ELSIF glob.entry == 'intern_error' -%]
[%|loc%]Ignoring message because of an internal server error.[%END%]

[% ELSIF glob.entry == 'no_existing_list' -%]
[%|loc(glob.listname)%]List '%1' does not exist.[%END%]
[% END -%]
[% END -%]
[% END -%]

Expand Down
5 changes: 5 additions & 0 deletions default/mail_tt2/delivery_status_notification.tt2
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ Subject: [% FILTER qencode %][%|loc%]Message distribution: Internal server error
Subject: [% FILTER qencode %][%|loc%]Message distribution: User error[%END%][%END%]
[% ELSIF status == '5.6.0' -%]
Subject: [% FILTER qencode %][%|loc%]Message distribution: User error[%END%][%END%]
[% ELSIF status == '5.6.1' -%]
Subject: [% FILTER qencode %][%|loc%]Results of your commands[%END%][%END%]
[% ELSIF status == '5.6.5' -%]
Subject: [% FILTER qencode %][%|loc%]Cannot personalize message[%END%][%END%]
[% ELSIF status == '5.7.0' -%]
Expand Down Expand Up @@ -77,6 +79,9 @@ so that they can take care of your message.

Thank you for your attention.[%END%]

[% ELSIF status == '5.6.1' -%]
[%|loc%]No command found in message.[%END%]

[% ELSIF status == '5.6.5' -%]
[%|loc%]Your message cannot be personalized. Please check template syntax.[%END%]

Expand Down
2 changes: 2 additions & 0 deletions src/lib/Sympa.pm
Original file line number Diff line number Diff line change
Expand Up @@ -620,6 +620,8 @@ my %diag_messages = (
'5.4.6' => 'Routing loop detected',
# message contains commands
'5.6.0' => 'Other or undefined media error',
# no command found in message
'5.6.1' => 'Media not supported',
# failed to personalize (merge_feature)
'5.6.5' => 'Conversion Failed',
# virus found
Expand Down
14 changes: 2 additions & 12 deletions src/lib/Sympa/Spindle/DoCommand.pm
Original file line number Diff line number Diff line change
Expand Up @@ -105,18 +105,8 @@ sub _twist {
);
unless ($spindle and $spindle->spin) {
# No command found.
$log->syslog('info', "No command found in message");
Sympa::send_file(
$robot,
'command_report',
$sender,
{ to => $sender,
nb_global => 1,
globals => [{entry => 'no_cmd_found'}],
},
# Ensure 1 second elapsed since last message.
date => time + 1
);
$log->syslog('info', 'No command found in message %s', $message);
Sympa::send_dsn($robot, $message, {}, '5.6.1');
$log->db_log(
'robot' => $robot,
#'list' => 'sympa',
Expand Down

0 comments on commit 060a406

Please sign in to comment.