[Mimedefang] md_check_against_smtp_server

James Miller jimm at simutronics.com
Thu Dec 18 17:25:20 EST 2003


Hi everyone.

I'm working on setting up filter_recipient and md_check_against_smtp_server
and not having much luck.
I'm sure it's that I'm not R-ing The right F'n M ;) ... Anyway

1.  Where should filter_recipient be called in mimedefang-filter.pl?  I'm
pretty much using David's example.. but not doing it correctly -- here's
what I'm using and I'm calling it just after 'sub filter_relay' and before
'sub filter_begin' begins

2.  Here's what my filter looks like.
sub filter_recipient
{
    my($recip, $sender, $ip, $host, $first, $helo,
	$rcpt_mailer, $rcpt_host, $rcpt_addr) = @_;
    return md_check_against_smtp_server($sender, $recip,
      "relay_mailserver.ourdomain.com","mailserver.ourdomain.com");
}


I get the feeling that I'm missing a 'what to do with it now' part.. a
if address is good then return('CONTINUE', 'ok');
else return('REJECT', 'That is a bad email address')'

But the RHS of the @ can be about 30 different domains for us.. so I'm not
sure how to structure a if/then/else function for each of our domains

Any help would be appreciated.



Thanks,
Jim





> -----Original Message-----
> From: mimedefang-bounces at lists.roaringpenguin.com
> [mailto:mimedefang-bounces at lists.roaringpenguin.com]On Behalf Of Robert
> Covell
> Sent: Thursday, November 20, 2003 8:18 AM
> To: Mimedefang
> Subject: [Mimedefang] md_check_against_smtp_server
>
>
> I am trying to use md_check_against_smtp_server.  The filter chooses what
> mail server to check based the global $Domain variable.
>
> Two things:
> 1) $Domain does not seem to be available from within
> filter_recipient but is
> available from other functions.  How can I make this see from here?
>
> 2) When I check against mail2.domain.com everything is accepted (i.e. even
> bad addresses).  When I check against mail1.domain.com it SEEMS
> that things
> are not accepted (i.e. it is working fine).  On mail2.domain.com
> I am using
> sendmail 8.11.5(patched) + cyrus 1.5.24 and on mail1.domain.com I am using
> 8.12.10 + cyrus 2.1.15.  Could the older sendmail version be causing the
> problem?  Does it not return the proper information for the
> md_check_against_smtp_server function?  Or am I not using it correctly?
>
> Here is my function:
>
> sub filter_recipient {
>     my($recip, $sender, $ip, $host, $first, $helo, $rcpt_mailer,
> $rcpt_host,
> $rcpt_addr) = @_;
>     if ((lc $Domain) eq "domain1.com") {
>        return md_check_against_smtp_server($sender, $recip,
> "spam1.domain.com","mail2.domain.com");
>     } elsif ((lc $Domain) eq "domain2.com") {
>        return md_check_against_smtp_server($sender, $recip,
> "spam1.domain.com","mail2.domain.com");
>     } else {
>        return md_check_against_smtp_server($sender, $recip,
> "spam1.domain.com","mail1.domain.com");
>     }
> }
>
> Thanks,
> -Bob
>
> _______________________________________________
> MIMEDefang mailing list
> MIMEDefang at lists.roaringpenguin.com
> http://lists.roaringpenguin.com/mailman/listinfo/mimedefang
>



More information about the MIMEDefang mailing list