[Raw Msg Headers][Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: SMTP Bind Address/Virtual Interfaces
I really don't know if you can "bind" a socket you are using for
"connecting", i.e., for outgoing tcp connections.
But since you are obviously using linux + iptables, why don't you
just source nat your smtp traffic to whatever interface you want ?
-Carlos
Neal Morgan @ 10/07/2006 04:00 -0300 dixit:
> Greetings all:
>
> I have experimented some with the suggested scheduler.conf changes to
> specify a bind address for outbound smtp connections. I find it doesn't
> work as expected when:
>
> 1) the IP is assigned to a virtual interface
> 2) there are other virtual interfaces on that physical interface in the
> same network
> 3) the IP either has no default gateway assigned in the main table (per
> "ip route show table main"), or has a default gateway but it is not the
> first listed for this network as reported in the main table
>
> Iptables (output/mangle) logging shows zmailer's first outbound packet
> specifying the wrong IP address (first IP of default route for the
> desired interface). For example:
>
> Scheduler.conf has this:
>
> smtp/*.com
> maxchannel=199
> maxring=8
> command="smtp -s -L [1.2.3.8] -l ${LOGDIR}/smtpout"
>
>
> ip route show table main reports:
> default via 1.2.3.1 dev eth4 src 1.2.3.2
> default via 1.2.3.1 dev eth4 src 1.2.3.8
> ...
>
> Scheduler/SMTP will always use 1.2.3.2 as the bind address even though
> 1.2.3.8 was requested.
>
> I can supply additional details, but in short it seems zmailer finds the
> first match on the network address and accepts the src address attached
> to it - whether this address is my requested one or not, all scheduler
> smtp connections matching my "-L" use it. Further, it doesn't seem to
> renegotiate that choice again until after the scheduler has been
> restarted - e.g. a change to the routes doesn't get noticed until the
> next zmailer restart.
>
> Seems the issue is somewhere in zgetbindaddr or zgetifaddress but I'm a
> little too tired and slow to figure it out now. Any suggestions on the
> best fix/method to troubleshoot would be appreciated.
>
> As a side note, smtpserver is perfectly happy binding to my virtual
> interfaces...
>
>
>
> Thanks,
>
> Neal Morgan
>
>
>
>
> -
> To unsubscribe from this list: send the line "unsubscribe zmailer" in
> the body of a message to majordomo@nic.funet.fi
>
--
Carlos G Mendioroz <tron@huapi.ba.ar> LW7 EQI Argentina
-
To unsubscribe from this list: send the line "unsubscribe zmailer" in
the body of a message to majordomo@nic.funet.fi