patch for exim-1.62: bind source address on outgoing SMTP co…

Página superior
Eliminar este mensaje
Responder a este mensaje
Autor: Lutz Pressler
Fecha:  
A: exim-users
Cc: P.Hazel, lp
Asunto: patch for exim-1.62: bind source address on outgoing SMTP conn.
Hello,

the following patch modifies transports/smtp.c to use the first address
of local_interfaces if these are explicitly configured as the source for
outgoing SMTP connections. This is used here in a setup which
needs multiple really idenpendant instances of exim running on one host.
There should be no negative side effects.
The patch has not been done for the HAVE_IPV6 case yet.

Please direct any comments etc. also to me as I have not subscribed to
this list.

Regards,
Lutz

*** transports/smtp.c.orig    Tue May 20 17:15:25 1997
--- transports/smtp.c    Tue May 20 19:12:18 1997
***************
*** 773,778 ****
--- 773,793 ----
    /* Set up the address and port on an IPv4 system */


    #else
+ 
+   /*
+   If local interfaces are explicitly configured, use first one as source
+   address on outgoing SMTP connections. (NOT done on IPv6 systems yet!)
+                                  1997-05-20 Lutz Pressler <lp@???>
+   */
+   if (local_interfaces != NULL)
+     {
+     s_in.sin_family = AF_INET;
+     s_in.sin_port = 0;
+     s_in.sin_addr.s_addr = 
+       (S_ADDR_TYPE)inet_addr(local_interface_data->address);
+     rc = bind(deliver_socket, (struct sockaddr *)&s_in, sizeof(s_in));
+     }
+ 
    s_in.sin_family = AF_INET;
    s_in.sin_port = port;
    s_in.sin_addr.s_addr = (S_ADDR_TYPE)inet_addr(host->address);




--
  _              |  Lutz Pressler          |  Tel.: ++49-551-507775
 |_     |\ |     |  Service Network GmbH   |  FAX:  ++49-551-507776
 ._|ER  | \|ET   |  Hannah-Vogt-Strasse 1  |   mailto:lp@SerNet.DE
Service Network  |  D-37085 Goettingen     |  http://www.SerNet.DE/