Multiple Addresses in Notices To

Julian Field mailscanner at ecs.soton.ac.uk
Wed Nov 27 16:41:44 GMT 2002


At 16:34 27/11/2002, you wrote:
>At 16:17 27/11/2002, you wrote:
>>I tried a bunch of things and looked in the FAQ and archive but how do you
>>specify multiple recipients in the Noticies To config option?
>>
>>I tried spaces commas semi-colons.
>
>It currently only supports a single address per message for the notice
>recipient (you can of course use a ruleset to change the recipient
>depending on the message).
>
>If you need to send the notices to more than 1 recipient at a time, you can
>just create an alias in sendmail (or Exim) and send the notices to that alias.
>
>I never figured anyone would need this :-)

The next release will support multiple recipients (space-separated list of
addresses). If you want this feature now (I would welcome someone testing
it for me), here's the patch to MessageBatch.pm. If you try it, please can
you confirm that it works (or doesn't):

---
/root/unstable/mailscanner/mailscanner/bin/MailScanner/MessageBatch.pm
Sun Nov 24 12:40:17 2002
+++ MessageBatch.pm     Wed Nov 27 16:53:57 2002
@@ -563,7 +563,8 @@
    my $this = shift;

    my($id, $message, $counter);
-  my(%notices, $postie, $notice, %headers, $email);
+  my(%notices, $notice, %headers, $email);
+  my(@posties, $posties, $postie);

    # Create all the email messages
    $counter = 0;
@@ -571,10 +572,13 @@
      next if !$message->{infected};
      next if $message->{deleted} && !$message->{stillwarn};
      next unless MailScanner::Config::Value('sendnotices', $message);
-    $postie = MailScanner::Config::Value('noticerecipient', $message);
-    $headers{$postie} = $message->CreatePostmasterHeaders()
-      unless $headers{$postie};
-    $notices{$postie} .= $message->CreatePostmasterNotice();
+    $posties = MailScanner::Config::Value('noticerecipient', $message);
+    @posties = split(" ", $posties);
+    foreach $postie (@posties) {
+      $headers{$postie} = $message->CreatePostmasterHeaders()
+        unless $headers{$postie};
+      $notices{$postie} .= $message->CreatePostmasterNotice();
+    }
      $counter++;
    }
    while(($postie,$notice) = each %notices) {

--
Julian Field                Teaching Systems Manager
jkf at ecs.soton.ac.uk         Dept. of Electronics & Computer Science
Tel. 023 8059 2817          University of Southampton
                             Southampton SO17 1BJ



More information about the MailScanner mailing list