Binding MailHost to an IP
Hi all, I have a box with multiple IP addresses that I use to support some internal development work. When using MailHost to send mail through an external mail server, I would like to have the mail "come from" one of the IP addresses in particular. It appears that the MailHost object is binding to the primary interface (eth0) instead of eth0:1, eth0:2, etc. Is there a way that I can specify a source address for the email? Thanks, Kevin
On Fri, 2003-12-12 at 08:03, Kevin Carlson wrote:
Hi all,
I have a box with multiple IP addresses that I use to support some internal development work. When using MailHost to send mail through an external mail server, I would like to have the mail "come from" one of the IP addresses in particular.
It appears that the MailHost object is binding to the primary interface (eth0) instead of eth0:1, eth0:2, etc. Is there a way that I can specify a source address for the email?
It would take some work. MailHost is basically a wrapper around Python's smtplib, which doesn't (IIRC) provide that as an option. It might be easier to configure your remote mailserver to accept relays from the IP corresponding with local eth0... or you could run a thin SMTP server on your local machine that relays outbound mail for localhost in whatever manner you require. You could also probably handle this at the protocol level, but that's not my area of expertise, so I can't do much more than speculate. HTH, Dylan
Kevin Carlson wrote at 2003-12-12 11:03 -0500:
I have a box with multiple IP addresses that I use to support some internal development work. When using MailHost to send mail through an external mail server, I would like to have the mail "come from" one of the IP addresses in particular.
It appears that the MailHost object is binding to the primary interface (eth0) instead of eth0:1, eth0:2, etc. Is there a way that I can specify a source address for the email?
It connects to the interface named in its SMTP Host: Usually, different interfaces have different IP addresses (usually with different names). Use the IP address name as SMTP host you want "MailHost" to connect to. -- Dieter
participants (3)
-
Dieter Maurer -
Dylan Reinhardt -
Kevin Carlson