[Pymilter] Re: Discovering MTA interface port
Stuart D Gathman
stuart at bmsi.com
Fri Jul 13 15:44:29 EDT 2012
On 07/13/2012 11:03 AM, David Champion expounded in part:
> This feels like a member of a category of sendmail problems I've only
> ever been able to solve by running multiple sendmails instances. That
> is, put one sendmail on port 25 and another on port 587 (and 465, if you
> use that) and pass an extra flag to the milter command on the port 587
> instance, indicating that you want to skip IP checks.
>
Well, I did the patch, and it was more than 2 lines, but still pretty
simple. However, while testing it, I discovered that sendmail already
sets the {daemon_port} macro. This must be enabled in sendmail.cf with
O Milter.macros.connect=j, _, {daemon_name}, {daemon_port}, {if_name},
{if_addr}
or in sendmail.mc with
define(`confMILTER_MACROS_CONNECT', ``j, _, {daemon_name},
{daemon_port}, {if_name}, {if_addr}'')dnl
Once enabled, {daemon_port} will have "25" or "587" (or whatever you set
in DAEMONOPTIONS macro for sendmail.mc or DaemonPortOptions for
sendmail.cf). This neatly solves the problem of milter behavior that
depends on what server port the client connected to.
So, there is a good reason why the sendmail suggestion box is not
obvious . . .
More information about the Pymilter
mailing list