Binding to a local address in Net::SMTP

J

Jim Cain

For TCPSocket, I know it's possible to specify the local IP address if
you want to:

socket =3D TCPSocket.new(remote_addr, remote_port, local_addr, local_port)

BTW I found this by looking in the source code, since every document I
was referencing only showed the first two arguments.

I am mailing from a host with multiple IP addresses, and I'd like to
be able to specify the local address when I open a connection with
Net::SMTP. Looking at the source, I don't see any way to do this. I'm
thinking about modifying Net::InternetMessageIo_Open (1.8.2) or
old_open (1.8.4) so that it calls TCPSocket.new with the four
arguments, rather than two.

Has anyone had this same issue and created such a workaround? Thanks
for any help.

Cheers,
Jim
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,968
Messages
2,570,149
Members
46,695
Latest member
StanleyDri

Latest Threads

Top