Hello.

I've set up a mail server with FreeBSD + Sendmail + SASL + Mimedefang (+ others, but 
OT); now I'm trying to
implement SPF and I think I'm almost there: everything seems to be running fine, 
mimedefang filters fakes through SPF
and bind puslishes my records.
However I'm in need to allow roaming notebooks to send mail through this smtp server, 
so I have them authenticate and
everything works fine, except SPF.

Here's my code in mimedefang-filter (adapted from a couple of samples on the net):

sub filter_sender {
    if ($SendmailMacros{"auth_authen"}) {
        return ('CONTINUE', 'ok');
    }
    my ($sender, $ip, $hostname, $helo) = @_;
    my $spfq = Mail::SPF::Query->new(ip => $ip, sender => $sender, helo => $helo);
    my ($result, $smtp_comment, $header_comment) = $spfq->result();
    if ($result eq 'pass' or $result eq 'fail') {
        md_syslog 'info', "$QueueID: SPF implemented=yes, result=$result, 
smtp_comment=$smtp_comment, header_comment=$header_comment";
        if ($result eq 'fail') {
            return ('REJECT', $smtp_comment);
        }
    } else {
        my ($result, $smtp_comment, $header_comment) = $spfq->best_guess();
        $smtp_comment ||= '';
        $header_comment ||= '';
        md_syslog 'info', "$QueueID: SPF implemented=no, result=$result, 
smtp_comment=$smtp_comment, header_comment=$header_comment";
    }
    return ('CONTINUE', 'ok');
}


It works almost fine, but it does not allow authenticated users to send mail from 
"foreign" IPs; in other words, the
first three lines do not work.

Any hint?


 bye & Thanks
        av.

P.S. Sorry, but I'm not that PERL guru... :(


_______________________________________________
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