[Mimedefang] SMTP AUTH password can be used in Mimedefang?

sosogh sosogh at 126.com
Mon Nov 24 05:45:36 EST 2008

For example:
                           user at backend.com
outside world -----------> backend server

I assume that:
1.user at backend.com is mail address in backend server
2.IP of backend server is
3.MX record of backend.com points to

The backend mail server holds three service:
1.SMTP service(serve for outbound mails)
2.MX service(serve for inbound mails)
3.POP3 service

My users's outlook recognizes that POP3 server and SMTP server are both
Outside world recognizes that mail server of domian backend.com is

Now I want to set a "transparent anti-spam proxy " for backend server
I can change IP of backend server, 
and I donot want to deploy these three service in separate server

>You could configure the backend server to accept mail from the mail only proxy, 
> that way anybody not honoring your MX records is lost.

If I do so , any SMTP connnection from users's outlook will be blocked by backend server.

>That's easily prevented, either by configuring the backend server
>itself to reject unauthenticated connections from IP addresses
>that do not belong to your own organization or by blocking
>access to the SMTP port of the backend server from the outside
>on your firewall.

My user's outlook must access to backend server,but their IP are dynamic

So I have to set a "proxy",I set proxy server in a "bridge" mode,make it transparent.
the network is as follow:

                   eth0     eth1          eth0
outside----------->    proxy   ----------> backend   

I have to redirect any "SMTP to" to using this cmd on proxy server :
/sbin/iptables -t nat -A PREROUTING -p tcp -d --dport 25 -j DNAT --to-destination

>Why would it need to do that? In other words: what relevance does
>the SMTP authentication have for the operation of your anti-spam

Both these connections:
1.from outside world to
2.from user's outlook to
are DNAT to,
so "proxy server" should verify SMTP authentication

>How do you authentificate your users, with sendmail or postfix?
Postfix . Because I set this "proxy server" with postfix and mimedefang
postfix verify valid recipients like this:
postfix call mimedefang , mimedefang call the function "md_check_against_smtp_server"

sub filter_recipient
    my($recip, $sender, $ip, $host, $first, $helo,
       $rcpt_mailer, $rcpt_host, $rcpt_addr) = @_;
    return md_check_against_smtp_server($sender, $recip,"filter.domain.tld",""); 


More information about the MIMEDefang mailing list