[lug] "Simple" mail MTA setup?

Ken MacFerrin lists at macferrin.com
Fri Jan 5 15:11:53 MST 2007


> 
> I have tried many of the standard MTA software (postfix, exim,
> sendmail, qmail) etc. I have spent hours trying these, only to find
> that the IP number gets encoded in the headers, and my mail is
> rejected by some small number of destinations. It is definitely not
> trivial to set them up anyway.
> 

On postfix you can strip these filters out at the smarthost using
header_checks.  In your postfix config directory create a file called
"header_checks" with a line similar to the following for the IP address
you want to strip out:

/^Received: .*\[123\.45\.67\.89\]\).*/ IGNORE

You'll then want to add the following parameter into your main.cf or
master.cf:

header_checks=regexp:/etc/postfix/header_checks

If you add this to your main.cf it will end up wasting resources by
running this header check on both incoming and outgoing mail.  I prefer
to create a new "cleanup" queue in my master.cf as follows:

cleanup2  unix  n       -       -       -       0       cleanup
    -o header_checks=regexp:/etc/postfix/header_checks

..and then redirecting my outgoing smtpd mail queue to it as a last stop
with the following:
    -o cleanup_service_name=cleanup2

All of this assumes you admin access to the smarthost.  Without this
you're pretty much stuck because most MTA's will add a "Received" header
showing the IP of the client that sent them the mail by default. So even
if you keep the client MTA from adding any IP info, the smarthost will
still add it in when passing the message through.
-Ken




More information about the LUG mailing list