On Thu, Jan 29, 2004 at 01:37:59PM -0500,
mengwong(_at_)dumbo(_dot_)pobox(_dot_)com wrote:
|
| |
| | Can one of the perl gurus knock up a filter that we can put into user
| | .procmailrc files and so on that adds Received-SPF lines? I'll make a
| | seperate post on my version of this in a moment.
| |
|
| The challenge is picking out the correct IP. Maybe the author of
| SpamBouncer can help.
|
Somebody sent me this.
The received header parsing is for Postfix.
#! /usr/bin/perl
use Mail::SPF::Query;
$/ = "\n\n";
$oldheader = <STDIN>;
$/ = undef;
$body = <STDIN>;
$/ = "\n";
chomp $oldheader;
$newheader = $oldheader;
$newheader =~ s/\n\s+/ /g;
@headers = split(/\n/, $newheader);
foreach $header (@headers) {
if ( $header =~ /^From (\S+)/ ) {
$sender = $1;
} elsif ( $header =~ /^Received: (.*)$/ ) {
$received = $1;
if ( ! $host ) {
($host, $helo, $ip) =
($received =~ /^from (\S+) \((\S+) \[(\S+)\]\)
by .*/);
}
}
}
if (( ! $ip ) || ( ! $helo ) || ( ! $sender )) {
($result, $smtp_comment, $header_comment) = ("INVALID", "", "");
} else {
$query = Mail::SPF::Query->new( ip => $ip,
helo => $helo,
sender => $sender );
($result, $smtp_comment, $header_comment) = $query->result();
}
print "$oldheader";
print "X-SPF-Status: $result\n";
print "X-SPF-Comment: $header_comment\n\n";
print "$body";
-------
Sender Permitted From: http://spf.pobox.com/
Archives at http://archives.listbox.com/spf-discuss/current/
Latest draft at http://spf.pobox.com/draft-mengwong-spf-02.9.4.txt
Wiki:
http://spfwiki.infinitepenguins.net/pmwiki.php/SenderPermittedFrom/HomePage
To unsubscribe, change your address, or temporarily deactivate your
subscription,
please go to
http://v2.listbox.com/member/?listname(_at_)©#«Mo\¯HÝÜîU;±¤Ö¤Íµø?¡