[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [msmtp-users] PATCH: bind to source IP
net_get_canonical_hostname simply calls gethostname() from glibc, and that function just calls uname(); it doesn't appear possible to change the source IP in glibc without using a standalone resolver library.
----- Original Message -----
From: grarpamp <grarpamp@...20...>
To: "msmtp-users@lists.sourceforge.net" <msmtp-users@lists.sourceforge.net>
Cc:
Sent: Friday, February 20, 2015 2:12 PM
Subject: Re: [msmtp-users] PATCH: bind to source IP
On Fri, Feb 20, 2015 at 9:12 AM, G H <uothrawn@...1...> wrote:
> Patch is attached to cause msmtp to bind to a source IP address before connecting to the remote endpoint. This is useful for source-based routing. Note that DNS lookups will still be going out your default interface; use a local dnsmasq or IPtables SNATing to fix this.
I would have thought binding to specific ip/alias/interface in
case of multiple being present was already in msmtp.
Thanks for bringing up this feature.
Aren't there functions in the resolver libs for that? (Here I see one
for switching to TCP connections but so far not for setting src ip.
If not, this should be ticketed upstream as feature request in linux/bsd.)
You could also bind a named/unbound instance and point the
resolver there.
_______________________________________________
msmtp-users mailing list
msmtp-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/msmtp-users