Added global configuration settings to use MySQL, PostgreSQL or LDAP backends for storing preferences.
---- Changes since 1.410 ----
Auto-whitelists can now be viewed, deleted from and cleared for all users on the system. An access control option allows this to be limited to just certain users or group members.
+---- Changes since 1.430 ----
+Added buttons to the auto-whitelist page for permanently allowing or denying selected addresses.
&can_use_check("awl");
&ReadParse();
&can_edit_awl($in{'user'}) || &error($text{'dawl_ecannot'});
+$conf = &get_config();
# Check stuff
&open_auto_whitelist_dbm($in{'user'}) || &error($text{'dawl_eopen'});
@d = split(/\0/, $in{'d'});
@d || &error($text{'dawl_enone'});
-# Delete from hash
-foreach $d (@d) {
- delete($awl{$d});
- delete($awl{$d."|totscore"});
+if ($in{'white'}) {
+ # Add to whitelist
+ @d = map { s/\|.*$//; $_ } @d;
+ @from = map { @{$_->{'words'}} } &find("whitelist_from", $conf);
+ @from = &unique(@from, @d);
+ &save_directives($conf, "whitelist_from", \@from, 1);
+ &flush_file_lines();
+ }
+elsif ($in{'black'}) {
+ # Add to blacklist
+ @d = map { s/\|.*$//; $_ } @d;
+ @from = map { @{$_->{'words'}} } &find("blacklist_from", $conf);
+ @from = &unique(@from, @d);
+ &save_directives($conf, "blacklist_from", \@from, 1);
+ &flush_file_lines();
+ }
+else {
+ # Delete from AWL hash
+ foreach $d (@d) {
+ delete($awl{$d});
+ delete($awl{$d."|totscore"});
+ }
}
&close_auto_whitelist_dbm();
print &ui_columns_start([ "",
$text{'awl_email'},
$text{'awl_ip'},
- $text{'awl_score'} ], \@tds);
+ $text{'awl_score'} ], undef, 0, \@tds);
foreach $k (@keys) {
($email, $ip, $rest) = split(/\|/, $k);
if ($ip eq "ip=none") {
}
print &ui_columns_end();
print &ui_links_row(\@links);
- print &ui_form_end([ [ undef, $text{'awl_delete'} ] ]);
+ print &ui_form_end([ [ undef, $text{'awl_delete'} ],
+ [ 'white', $text{'awl_white'} ],
+ [ 'black', $text{'awl_black'} ] ]);
}
&close_auto_whitelist_dbm();
awl_none=None
awl_unknown=Unknown
awl_delete=Remove Selected Entries
+awl_white=Permanently Allow
+awl_black=Permanently Deny
awl_cannot=Usermin could not open your auto-whitelist file <tt>$1</tt>, perhaps because it is in an un-supported format.
awl_empty=Your auto-whitelist file <tt>$1</tt> does not contain any entries. It will be populated by SpamAsssassin as mail is processed by the system.
awl_user=Show auto-whitelist for user: