[Mimedefang] md_check_against_smtp_server - Got it

Tory Blue tmblue at responsys.com
Fri Jun 3 19:10:47 EDT 2005


I think I was being a jackarse.

A) I didn't have MX_RECIPIENT_CHECK enabled in my /etc/sysconfig/mimedefang
file and due to this I have a bunch of questionable attempts at my milter
code.

enabling MX_RECIPIENT and using the simple example, works fine. Now that I
have it working, I can go and start customizing, since I'm in a known good
state.

Thanks all.

Larry Starr's version:  WORKS

"<my internal server>" - should be the name of the machine that you are
relaying for i.e. "internalserver.mydomain.com" 
The RE for setting $relay should be your mail domain "mydom.com" should, of
course be your domain "\bmydomain\.com\b" 
"myfqdn" should be the name of the server running mimedefang i.e
"mail.mydomain.com" 
Hope this helps someone. 

sub filter_recipient
{
      my($recip, $sender, $ip, $host, $first, $helo,
              $rcpt_mailer, $rcpt_host, $rcpt_addr) = @_;

      my $relay = undef;
      $relay = "<my internal server>" if ($recip =~ /\bmydom\.com\b/);
      if ($relay)
      {
              return md_check_against_smtp_server($sender, $recip,
                      "myfqdn", $relay);
      }

      return('CONTINUE', "OK");  # accept recipient if dont find relay
}



More information about the MIMEDefang mailing list