[Mimedefang] filter_relay not working?

Mark admin at asarian-host.net
Fri Feb 13 11:00:34 EST 2004


----- Original Message ----- 
From: "Mike Smith" <mike at ftl.com>
To: <mimedefang at lists.roaringpenguin.com>
Sent: Thursday, February 12, 2004 9:02 PM
Subject: RE: [Mimedefang] filter_relay not working?

> I'm running this on MD 2.39.
>
> sub filter_relay {
>     my ($ip, $name, $helo) = @_;
>     action_add_header ("X-From:","$ip");
> }

Will indeed not work. Has nothing to do with MIMEDefang, but everything with
the Milter specification. Context routines, such as addheader, chgheader,
addrcpt, delrcpt, replacebody, are ONLY available to the eom_callback
function.

> The Relay-Key has been changed to protect my real one. Also the ip
> listed after the delete X-MIMEDefang-Relay is not my
> relay/secondary server, but the ip that I connected to the relay on...
> Is that right? Doesn't seem like that's the way it's suppose to work.

What you are trying to accomplish is rather opaque to me. Can you please
specify?

$ip in filter_relay will always be the IP of whoever is making the
connection. On an inbound connection, this will be the IP address of the
connecting host; if you forward from your primary mail server to your
secondary, then the IP will be that of your primary mail server. And yes, it
is supposed to work that way. :)

If you forward to your secondary, then you could add your "X-From" header at
eom_callback (at your primary), and then whitelist the IP address as soon as
you process the header at your secondary. Not an extremely efficient method,
though; better just to whitelist the IP address of your secondary
altogether.

- Mark

        System Administrator Asarian-host.org

---
"If you were supposed to understand it,
we wouldn't call it code." - FedEx



More information about the MIMEDefang mailing list