Problems? Is your data what you think it is? | |
PerlMonks |
Sending SMTP mail on other than port 25by grinder (Bishop) |
on Apr 26, 2002 at 10:30 UTC ( [id://162233]=perlquestion: print w/replies, xml ) | Need Help?? |
grinder has asked for the wisdom of the Perl Monks concerning the following question:
Monks, I need to send some mail to a server that is configured to listen on other than port 25 for SMTP connections. According to Super Search no-one seems to have needed to do this yet :)
I have an antivirus package listening to port 25, and after cleaning a message of viruses, it forwards the message to another port on the same machine, where my SMTP server is listening.
I want to prove to myself that my firewall rules are set up correctly, and that it is not possible for a remote host to connect to said port, otherwise is would be possible to bypass the antivirus check. Someone suggested Net::SMTP. Since it is derived from IO::Socket::INET, it can accept a PeerPort attribute, which would let me do what I want. Unfortunately, what I have written does not work:
While the script waits on STDIN, I can run a netstat and look for the open socket, and I see:
That is, the connection is opened on the port 25, not the port specified by the PeerPort attribute. I do get the banner, as double proof that the connection is connected on 25. Can someone hit me with a cluestick? Thanks. print@_{sort keys %_},$/if%_=split//,'= & *a?b:e\f/h^h!j+n,o@o;r$s-t%t#u'
Back to
Seekers of Perl Wisdom
|
|