amavisd-2.6-localsaconfig.patch 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. diff -r 8574935af18f amavisd
  2. --- a/amavisd Tue May 20 19:30:57 2008 +0200
  3. +++ b/amavisd-new-2.6 Thu Jun 12 12:49:08 2008 +0200
  4. @@ -339,6 +339,8 @@
  5. %admin_maps_by_ccat %warnrecip_maps_by_ccat
  6. %always_bcc_by_ccat %dsn_bcc_by_ccat
  7. %addr_extension_maps_by_ccat %addr_rewrite_maps_by_ccat
  8. +
  9. + $sa_site_rules_filename
  10. )],
  11. 'confvars' => # global settings (not per-policy, not per-recipient)
  12. [qw(
  13. @@ -20256,6 +20258,18 @@
  14. my($sa_version_num); # turn '3.1.8-pre1' into 3.001008
  15. $sa_version_num = sprintf("%d.%03d%03d", $1,$2,$3)
  16. if $sa_version =~ /^(\d+)\.(\d+)(?:\.(\d+))/; # ignore trailing non-digits
  17. +
  18. + my %conf_backup = ();
  19. + my ($sa_site_rule_file) = c('sa_site_rules_filename');
  20. +
  21. + if ($sa_site_rule_file && $sa_version_num >= 3) {
  22. + $spamassassin_obj->copy_config(undef, \%conf_backup) ||
  23. + die "config: error returned from copy_config!\n";
  24. + do_log(4,"SA Config saved");
  25. + $spamassassin_obj->read_scoreonly_config ($sa_site_rule_file);
  26. + do_log(4,"SA ScoreOnlyConfig loaded");
  27. + }
  28. +
  29. my($spam_level,$sa_tests,$spam_report,$spam_summary,%supplementary_info);
  30. my($fh) = $msginfo->mail_text;
  31. $fh->seek($msginfo->skip_bytes, 0) or die "Can't rewind mail file: $!";
  32. @@ -20330,6 +20344,11 @@
  33. } or do { $eval_stat = $@ ne '' ? $@ : "errno=$!" };
  34. $which_section = 'SA finish';
  35. + if ($sa_site_rule_file && $sa_version_num >= 3) {
  36. + $spamassassin_obj->copy_config(\%conf_backup, undef) ||
  37. + die "config: error returned from copy_config!\n";
  38. + do_log(4,"SA Config restored");
  39. + }
  40. if (defined $per_msg_status)
  41. { $per_msg_status->finish; undef $per_msg_status }
  42. if (defined $mail_obj && $sa_version_num >= 3)