Skip Menu |

This queue is for tickets about the TipJar-MTA CPAN distribution.

Report information
The Basics
Id: 45397
Status: resolved
Priority: 0/
Queue: TipJar-MTA

People
Owner: Nobody in particular
Requestors: Jose Luis Martinez (no email address)
Cc:
AdminCc:

Bug Information
Severity: Wishlist
Broken in: (no value)
Fixed in: (no value)



Subject: Support for Binding to a specific address
Hello, This patch lets the user select the local IP address for the outgoing connections (in case the machine has several IPs). Index: MTA.pm =================================================================== --- MTA.pm.orig +++ MTA.pm @@ -29,6 +29,7 @@ @NoBounceRegexList $MaxActiveKids $FourErrCacheLifetime + $BindAddress %SMTProutes /; @@ -790,6 +791,11 @@ my $paddr = sockaddr_in( 25, $iaddr ); socket( SOCK, PF_INET, SOCK_STREAM, getprotobyname('tcp') ) or die "$$ socket: $!"; + + my $laddr = defined $BindAddress ? inet_aton($BindAddress) + : INADDR_ANY; + my $sockaddr = sockaddr_in(0, $laddr); + bind( SOCK, $sockaddr ) or die "$!"; connect( SOCK, $paddr ) || next; mylog "connected to $Peerout";
Thanks. This has been included, with some streamlining, in 0.32.