[Mimedefang] string compare / matching

Petra Humann humann at tcs.inf.tu-dresden.de
Fri Nov 30 03:49:06 EST 2007


Hello,

I have some code in my filter_end:

sub filter_end ($) {
    my($entity) = @_;
....
    my $from_header = $entity->head->get("From");
    $from_header =~ s/^.*<//;
    $from_header =~ s/>$//;
    $from_header = lc($from_header);

    my $absender = $Sender;
    $absender =~ s/^<//;
    $absender =~ s/>$//;
    $absender = lc($absender);

    if ( $absender ne $from_header ) {
	md_syslog ('warning', "$MsgID not equal Sender $absender from
$from_header");
    } else {
	md_syslog ('warning', "$MsgID equal Sender $absender from $from_header");
    }

I ever get: "not equal", although $absender and $from_header are
equal. If I write:

	if ( ! grep /$absender/, $from_header) ...

it works, but some addresses doesn't, like "liste**recipient**@liste.com".

How do I solve this problem?

Regards.
Petra Humann
-- 
Mail:    humann at tcs.inf.tu-dresden.de
WWW:     http://wwwtcs.inf.tu-dresden.de/~humann/


More information about the MIMEDefang mailing list