[Mimedefang] add_recipient function

Kees Theunissen theuniss at rijnh.nl
Fri Jul 20 07:13:16 EDT 2007


On Thu, 19 Jul 2007, An.H.Nguyen wrote:

> Sorry to bother... I've found the mistake and made it work...
>     my ($recip);
>     foreach $recip (@Recipients) {
>     if ($recip =~ m/\@isc\.sjsu\.edu>?$/i) {
>     add_recipient('ahnguyen at sjsu.edu');
>     }
>     }

You might want to prevent adding this recipient multiple times.

    my $add_it = 0;
    my $recip;
    foreach $recip (@Recipients) {
        if ($recip =~ m/\@isc\.sjsu\.edu>?$/i) {
            $add_it = 1;
        }
        if ($recip =~ m/^<?ahnguyen\@sjsu\.edu>?$/i) {
            $add_it = 0;
            last;
        }
    }
    if ($add_it) {
        add_recipient('ahnguyen at sjsu.edu');
    }

Regards,

Kees.

-- 
Kees Theunissen
F.O.M.-Institute for Plasma Physics Rijnhuizen, Nieuwegein, Netherlands
E-mail: theuniss at rijnh.nl,  Tel: (+31|0)306096724,  Fax: (+31|0)306031204




More information about the MIMEDefang mailing list