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 <grarp...@gmail.com>
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 <uothr...@yahoo.com> 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

------------------------------------------------------------------------------
Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server
from Actuate! Instantly Supercharge Your Business Reports and Dashboards
with Interactivity, Sharing, Native Excel Exports, App Integration & more
Get technology previously reserved for billion-dollar corporations, FREE
http://pubads.g.doubleclick.net/gampad/clk?id=190641631&iu=/4140/ostg.clktrk
_______________________________________________
msmtp-users mailing list
msmtp-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/msmtp-users

Reply via email to