$Id: rlytest-ports.patch,v 1.3 2003/01/14 07:35:56 jmates Exp $ Patch to rlytest 1.22 to enable a -p option. This allows one to test relaying on SMTP servers running somewhere besides the default SMTP port (25). rlytest may be found at: http://www.unicom.com/sw/rlytest/ --- rlytest.orig Mon Oct 22 14:03:07 2001 +++ rlytest Tue Dec 4 10:14:08 2001 @@ -43,11 +43,11 @@ use IO::Socket; # warning - IO::Socket was an optional add-on prior to 5.004 use Time::gmtime; use vars qw($Usage $Dflt_hostname $Dflt_domain $Root_check %Opts - $Target_host $Timeout $Hostname $Username $Comment + $Target_host $Port $Timeout $Hostname $Username $Comment $Actual_sender $MailFrom_addr $RcptTo_addr $Mssg_body); $0 =~ s!.*/!!; -$Usage = "usage: $0 [-f sender_addr] [-u recip_addr] [-c comment] [-t timeout] target_host"; +$Usage = "usage: $0 [-f sender_addr] [-u recip_addr] [-c comment] [-t timeout] [-p port] target_host"; use vars qw($EX_RELAY_ACCEPTED $EX_RELAY_REJECTED $EX_PROGRAM_ERROR); $EX_RELAY_REJECTED = 0; @@ -94,7 +94,7 @@ # # Crack command line. # -getopts('c:f:t:u:', \%Opts) +getopts('c:f:t:u:p:', \%Opts) or die "$Usage"; die "$Usage\n" unless (@ARGV == 1); @@ -106,6 +106,7 @@ $Timeout = $Opts{'t'} || 60; $Hostname = calculate_fqdn() or die "$0: cannot determine FQDN\n"; +$Port = $Opts{'p'} || 25; # default to SMTP port $Username = $ENV{'LOGNAME'} || $ENV{'USER'} || die "$0: LOGNAME undefined\n"; $Actual_sender = $Username . "\@" . $Hostname; $RcptTo_addr = $Opts{'u'} || $Actual_sender; @@ -162,7 +163,7 @@ my $sock = IO::Socket::INET->new( Proto => "tcp", PeerAddr => $Target_host, - PeerPort => "smtp(25)", + PeerPort => $Port, Timeout => $Timeout) or die "$0: socket failed: cannot connect to $Target_host: $@\n"; @@ -283,6 +284,7 @@ [B<-u> recip_addr] [B<-c> I] [B<-t> I] +[B<-p> I] I =head1 DESCRIPTION @@ -323,6 +325,11 @@ Sets the timeout value (default is 60 seconds) for certain operations. + +=item B<-p> I + +Connects to the SMTP server on the specified port instead of the +default port 25. =back