From 56c7a4e9b58bd7c944db1880a27ee435bbce5866 Mon Sep 17 00:00:00 2001 From: Steve Kemp Date: Mon, 19 Nov 2012 16:24:30 +0000 Subject: Updated to ensure we read a banner from the remote server - before we test against it. --- lib/custodian/protocol-tests/smtp.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'lib/custodian/protocol-tests/smtp.rb') diff --git a/lib/custodian/protocol-tests/smtp.rb b/lib/custodian/protocol-tests/smtp.rb index 6a3895d..5da672f 100755 --- a/lib/custodian/protocol-tests/smtp.rb +++ b/lib/custodian/protocol-tests/smtp.rb @@ -81,11 +81,11 @@ class SMTPTest socket.puts( "QUIT") banner = socket.gets(nil) - banner = banner[0,40] + banner = banner[0,40] unless( banner.nil? ) socket.close() - if ( banner =~ /SMTP/i ) + if ( ( !banner.nil? ) && ( banner =~ /SMTP/i ) ) puts "SMTP alive: #{banner}" if ( @test_data['verbose'] ) return true else -- cgit v1.2.1