As it does not appear that the list has preserved the patch
attachments (at least on the sourceforge web page), I am also
including them in this followup message.

patch-amavisd-masq:
--- /src/amavisd.orig        2009-01-07 21:53:32.000000000 -0500
+++ /src/amavisd     2009-01-08 13:20:02.000000000 -0500
@@ -346,6 +346,7 @@
     )],
     'confvars' =>  # global settings (not per-policy, not per-recipient)
     [qw(
+      @sender_header_regexp @receiver_header_regexp
       $myproduct_name $myversion_id $myversion_id_numeric $myversion_date
       $myversion $instance_name @additional_perl_modules
       $MYHOME $TEMPBASE $QUARANTINEDIR $quarantine_subdir_levels
@@ -11606,6 +11607,21 @@
       sprintf("SpamAssassin %s (%s) on %s", Mail::SpamAssassin::Version(),
               $Mail::SpamAssassin::SUB_VERSION, c('myhostname')));
   }
+  if (@receiver_header_regexp) {
+    foreach my $hdr (qw(To Cc Bcc)) {
+      $hdr_edits->edit_header($hdr,
+        sub { my($h,$v)=...@_; foreach my $set (@receiver_header_regexp) {
+                foreach my $rule (@$set) {
+                  my($p,$r)=...@$rule; eval "\$v =~ s(\$p)($r)g;" && last}} 
$v})
+    }
+  }
+  if (@sender_header_regexp) {
+    $hdr_edits->edit_header('From',
+        sub { my($h,$v)=...@_; foreach my $set (@sender_header_regexp) {
+                foreach my $rule (@$set) {
+                  my($p,$r)=...@$rule; eval "\$v =~ s(\$p)($r)g;" && last}} 
$v})
+  }
+
   $hdr_edits;
 }

**************************
amavisd.conf_sample:
# Sender re-writing rules.  Each set of rules is run in order.  Each
# set stops at its first match and then the following set is run.  Escape
# unwanted variable metacharacters ($,@,%) and don't use parenthesis
# on the right-hand-side.  These work like sendmail's masquerade rules.
@sender_header_regexp =
(
 # Set 1
 [
  ['(r...@[^@.\s]*\.example.com)'               => '$1'],
  ['([^<\s]*)@[...@.\s]*\.(example.com)'  => '$...@$2'],
 ],
 # Set 2
 [
  ['(r...@[^@.\s]*\.example2.com)'                      => '$1'],
  ['([^<\s]*)@[...@.\s]*\.(example2.com)'         => '$...@$2'],
 ],
);
# Receiver re-writing rules.  These work like sendmail's generictable rules.
@receiver_header_regexp =
(
 # Set 1
 [
  ['([^<\s]*)@[...@.\s]*\.(example.com)'  => '$...@$2'],
  ['([^<\s]*)@[...@.\s]*\.(example2.com)'         => '$...@$2'],
 ]
);

------------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It is the best place to buy or sell services for
just about anything Open Source.
http://p.sf.net/sfu/Xq1LFB
_______________________________________________
AMaViS-user mailing list
[email protected] 
https://lists.sourceforge.net/lists/listinfo/amavis-user 
 AMaViS-FAQ:http://www.amavis.org/amavis-faq.php3 
 AMaViS-HowTos:http://www.amavis.org/howto/ 

Reply via email to