[Mimedefang] How to change $Subject for newly added recipient

borek ohera bfield at inmail.cz
Tue Dec 5 03:47:15 EST 2006


Hello,
I've got this following situation. If mail comes from specific sender to 
one of the chosen recipients, new recipient is added and I'm trying 
either change the Subject or partially change the mail body, but only 
for this recipient.

Here's a code so far:

sub filter_end {
   my($recip);
        foreach $recip (@Recipients) {
         if ($recip =~ /mail1\@domain\.cz/i or $recip =~ 
/testmail2\@domain\.cz/i or $recip =~ /test\.mail3\@domain\.cz/i)  {
          if ($Sender =~ /testmail1\@domain\.cz/i or $Sender =~ 
/testmail4\@another\-domain\.com/i) {
                # Temporarilly change $Subject
                action_change_header("Subject","** SPAM ** $Subject");
                # Add new recipient
                add_recipient('bf at domain\.cz');
                # action_notify_administrator("The mail was resent  
$Subject");
                # another choice is resend_message
                # resend_message('bf at domain\.cz');
                # Set back the orginal Subject
                action_change_header("Subject","$Subject");
                          }
                }
        }
      action_rebuild();
}

Any help is appreciated.

-- 
Borek



More information about the MIMEDefang mailing list