Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Let some obsoleted parameters be retired and add convenient spam_status scenarios #1470

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions default/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,11 @@ nobase_default_DATA = \
scenari/send.publicnoattachment \
scenari/send.public_nobcc \
scenari/send.publicnomultipart \
scenari/spam_status.bogofilter \
scenari/spam_status.j-chkmail \
scenari/spam_status.none \
scenari/spam_status.rspamd \
scenari/spam_status.spamassassin \
scenari/spam_status.x-spam-status \
scenari/subscribe.auth \
scenari/subscribe.authdkim \
Expand Down
6 changes: 6 additions & 0 deletions default/scenari/spam_status.bogofilter
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
title bogofilter

match([header->X-Bogosity][-1],/^(Spam|Yes)\b/) smtp,dkim,md5,smime -> spam
match([header->X-Bogosity][-1],/^(Ham|No)\b/) smtp,dkim,md5,smime -> ham
match([header->X-Bogosity][-1],/^Unsure\b/) smtp,dkim,md5,smime -> unsure
true() smtp,dkim,md5,smime -> unsure
6 changes: 6 additions & 0 deletions default/scenari/spam_status.j-chkmail
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
title j-chkmail

match([header->X-j-chkmail-Status][-1],/Spam Hi/) smtp,dkim,md5,smime -> spam
match([header->X-j-chkmail-Status][-1],/Spam Low/) smtp,dkim,md5,smime -> unsure
match([header->X-j-chkmail-Status][-1],/Unsure/) smtp,dkim,md5,smime -> unsure
true() smtp,dkim,md5,smime -> ham
3 changes: 3 additions & 0 deletions default/scenari/spam_status.none
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
title.gettext do nothing

true() smtp,dkim,md5,smime -> unsure
6 changes: 6 additions & 0 deletions default/scenari/spam_status.rspamd
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
title Rspamd

match([header->X-Spam][0],/^Yes/) smtp,dkim,md5,smime -> spam
match([header->X-Spam-Status][-1],/^Yes\b/) smtp,dkim,md5,smime -> spam
match([header->X-Spam-Status][-1],/^No\b/) smtp,dkim,md5,smime -> ham
true() smtp,dkim,md5,smime -> unsure
7 changes: 7 additions & 0 deletions default/scenari/spam_status.spamassassin
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
title SpamAssassin

match([header->X-Spam-Status][0],/^Yes\b/) smtp,dkim,md5,smime -> spam
match([header->X-Spam-Status][0],/^No\b/) smtp,dkim,md5,smime -> ham
match([header->X-Spam-Flag][0],/^YES/) smtp,dkim,md5,smime -> spam
match([header->X-Spam-Flag][0],/^NO/) smtp,dkim,md5,smime -> ham
true() smtp,dkim,md5,smime -> unsure
6 changes: 2 additions & 4 deletions default/scenari/spam_status.x-spam-status
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
title.gettext test x-spam-status header

match([header->X-Spam-Status][-1],/^\s*yes/) smtp,dkim,smime,md5 -> spam
match([header->X-j-chkmail-Status][-1],/Spam Hi/) smtp,dkim,smime,md5 -> spam
match([header->X-j-chkmail-Status][-1],/Spam Low/) smtp,dkim,smime,md5 -> unsure
true() smtp,dkim,md5,smime -> ham
match([header->X-Spam-Status][-1],/^\s*yes/) smtp,dkim,md5,smime -> spam
true() smtp,dkim,md5,smime -> unsure
14 changes: 6 additions & 8 deletions default/web_tt2/modindex.tt2
Original file line number Diff line number Diff line change
Expand Up @@ -47,14 +47,12 @@
<i class="fa fa-eye"></i>
</a>

[%~ IF conf.antispam_feature == 'on' ~%]
[% IF msg.value.spam_status == 'spam' ~%]
<span data-tooltip title="[%|loc%]Spam[%END%]">
<i class="fa fa-ban text-error"></i>
</span>
[%~ ELSE ~%]
&nbsp;
[%~ END %]
[% IF msg.value.spam_status == 'spam' ~%]
<span data-tooltip title="[%|loc%]Spam[%END%]">
<i class="fa fa-ban text-error"></i>
</span>
[%~ ELSE ~%]
&nbsp;
[%~ END %]
</div>
<div class="small-4 medium-4 columns" role="cell">
Expand Down
2 changes: 1 addition & 1 deletion doc/sympa_config.podpl
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,7 @@ sub _format {
open $fh, '<', "$function.$name" or die $ERRNO;
my $content = do { local $RS; <$fh> };
close $fh;
if ($content =~ /(?:\A|\n)title(?:[.][-\w]+)\s+(.+)/) {
if ($content =~ /(?:\A|\n)title(?:[.][-\w]+)?\s+(.+)/) {
$parameters .= sprintf "=item C<%s> - %s\n\n", $name, $1;
} else {
$parameters .= sprintf "=item C<%s>\n\n", $name;
Expand Down
3 changes: 2 additions & 1 deletion src/cgi/wwsympa.fcgi.in
Original file line number Diff line number Diff line change
Expand Up @@ -1152,7 +1152,6 @@ while ($query = Sympa::WWW::FastCGI->new) {
'main_menu_custom_button_3_target',
'static_content_url',
'use_blocklist',
'antispam_feature',
'custom_robot_parameter',
'reporting_spam_script_path',
'automatic_list_families',
Expand All @@ -1178,6 +1177,8 @@ while ($query = Sympa::WWW::FastCGI->new) {
# Compat. < 6.2.62: Renamed parameters.
$param->{'conf'}{'use_blacklist'} =
Conf::get_robot_conf($robot, 'use_blocklist');
# Compat. < 6.2.71: Obsoleted parameter.
$param->{'conf'}{'antispam_feature'} = 'on';

$auth_services = $Conf::Conf{'auth_services'}{$robot};
$param->{'sso'} = {
Expand Down
Loading