Hi, We have a simple filter function that looks at $Sender (for a group senders addresses) and in the subject or body (for a specific word), and if both the criterias are true then the $Subject is altered (a prefix is added).
sub filter { my($entity, $fname, $ext, $type) = @_; return if message_rejected(); # Avoid unnecessary work if ($Sender =~ /(\<?kamelasa\@example\.net\>?|\<?syggelekokle\@example\.net\>?)/) { if ($Subject =~ /MATCHINGSTRING/i) { action_change_header('Subject', "[PREFIX]$Subject"); } else { my $io; if ($io = $entity->open("r")) { while (defined($_ = $io->getline)) { if (/MATCHINGSTRING/i) { action_change_header('Subject', "[PREFIX]$Subject"); last; } } $io->close; } } } return action_accept(); } We noted that this filter function didn't work although both the criterias seemed to be true. It turns out that $Sender isn't the email address of From: header in those cases, instead $Sender is set to the email address of the Return-Path header. Maybe this has always been the case, and we where just lucky until now… I guess the question is if it's possible to avoid having Return-Path ending up in $Sender, or if we should do the matching against "$Sender" (or something else) in a different way? (We don't want to put in all possible Return-Path email addresses in the $Sender matching) /P _______________________________________________ NOTE: If there is a disclaimer or other legal boilerplate in the above message, it is NULL AND VOID. You may ignore it. Visit http://www.mimedefang.org and http://www.roaringpenguin.com MIMEDefang mailing list MIMEDefang@lists.roaringpenguin.com http://lists.roaringpenguin.com/mailman/listinfo/mimedefang