Matthew.van.Eerde wrote:
> David F. Skoll wrote:
>> On Wed, 8 Sep 2004, Ted Beaton wrote:
>> 
>>>               if ($recip = [EMAIL PROTECTED]) {

Or if I wanted to get really crazy I'd do something like

sub email_lists_overlap(\@@);
sub lists_overlap(\@@);
sub canonify_email($);

...

        if (    email_lists_overlap(
                        @Recipients,
                        (       '[EMAIL PROTECTED]',
                                '"Billie Joe" <[EMAIL PROTECTED]>', 
                                '<>',
                        )
                )
        )
        {       ...
        }
...

sub email_lists_overlap(\@@)
{       my @first = @{ shift };
        my @second = @_;

        @first = map { canonify_email($_} } @first;
        @second = map { canonify_email($_) } @second;

        return lists_overlap(@first, @second);
}

sub lists_overlap(\@@)
{       my @first = @{ shift };
        my @second = @_;

        my %hash = ();

        for my $element (@first)
        {       $hash{$element} = 1;
        }

        for my $element (@second)
        {       return 1 if $hash{$element};
        }

        return 0;
}

sub canonify_email($)
{       my $raw_email = shift;
        my $canonical_email = $raw_email;

        # canonify the email here...
        $canonical_email = lc $canonical_email; # standardize on lowercase
        ... etc.

        return $canonical_email;
}

_______________________________________________
Visit http://www.mimedefang.org and http://www.canit.ca
MIMEDefang mailing list
[EMAIL PROTECTED]
http://lists.roaringpenguin.com/mailman/listinfo/mimedefang

Reply via email to