[Mimedefang] filter_recipient question
Kevin A. McGrail
kmcgrail at pccc.com
Tue Dec 11 13:41:03 EST 2007
Do you have MX_RECIPIENT_CHECK / -t on mimedefang so that your
filter_recipient routine is called?
It shouldn't cause an issue, but you might want to use the full parameter
passing:
my($recip, $sender, $ip, $host, $first, $helo, $rcpt_mailer, $rcpt_host,
$rcpt_addr) = @_;
Add some syslog statements ala md_syslog('warning', "$recipient") to see
what's happening during the live processing.
Regards,
KAM
> I'm trying to have a blanket ACCEPT for certain domains and I can't get
> it to work...at least, I still see things getting bounced by MimeDefang.
> So, is the following snippet of code actually correct? Syntactically it
> appears fine, but that's also it... (lines wrapped for readability)
>
> sub filter_recipient {
> my($recipient, $sender, $rest) = @_;
> my($answer, $explanation);
>
> return('ACCEPT_AND_NO_MORE_FILTERING', "ok") \
> if ($recipient =~ /.+\@reincorporation\.com>?/i);
>
> return('ACCEPT_AND_NO_MORE_FILTERING', "ok") \
> if ($recipient =~ /.+\@itfcorp.com\.com>?/i);
> if ($recipient =~ /.+\@pcraft\.com>?/i) {
> ($answer, $explanation) =
> md_check_against_smtp_server($sender, $recipient, \
> "serpico.pcraft.com", "i-ivan.int.pcraft.com");
> } else {
> ($answer, $explanation) = md_check_against_smtp_server($sender,
> $recipient, \
> "serpico.pcraft.com", "i-bug.int.pcraft.com");
> }
> # Convert TEMPFAIL to CONTINUE
> $answer = 'CONTINUE' if ($answer eq 'TEMPFAIL');
> return ($answer, $explanation);
> }
More information about the MIMEDefang
mailing list