E
eric.hall
I'm a relative newbie with perl/regexp
I'm trying to write a rule for SpamAssassin that looks at the top-most
Received header and checks if the HELO identifer and the reverse DNS
hostname are the same, and apply a weight accordingly.
It's easy to see if they are the same, using an internal debug header
and a backreference. Assume HEADER is of the form "rdns=hostname
helo=hostname" then the simple rule of:
HEADER =~ /rdns=(.*) helo=\1/
will match when they are the same. But I need to match when they are
different.
I've tried negative look-ahead of various forms, but nothing seems to
work correctly when backreferences are included. Is there a way out of
this hole?
Perl 5.8.1 on SuSE Linux Professional 9.0, if it matters.
Thanks
I'm trying to write a rule for SpamAssassin that looks at the top-most
Received header and checks if the HELO identifer and the reverse DNS
hostname are the same, and apply a weight accordingly.
It's easy to see if they are the same, using an internal debug header
and a backreference. Assume HEADER is of the form "rdns=hostname
helo=hostname" then the simple rule of:
HEADER =~ /rdns=(.*) helo=\1/
will match when they are the same. But I need to match when they are
different.
I've tried negative look-ahead of various forms, but nothing seems to
work correctly when backreferences are included. Is there a way out of
this hole?
Perl 5.8.1 on SuSE Linux Professional 9.0, if it matters.
Thanks