diff options
author | Steve Kemp <steve@steve.org.uk> | 2015-01-13 15:41:38 +0000 |
---|---|---|
committer | Steve Kemp <steve@steve.org.uk> | 2015-01-13 15:41:38 +0000 |
commit | 97cc01c25359fd5465b7acf2fb4ad5f7e4c19309 (patch) | |
tree | 698199392b75116217fb2e9c5da88af42d4708d3 | |
parent | 8318ede7af604f6503abe32a38271b79e527819f (diff) |
Stub MX-test.
This will perform a DNS-lookup AND SMTP-test for the given
domain.
-rw-r--r-- | lib/custodian/protocoltest/mx.rb | 67 | ||||
-rw-r--r-- | lib/custodian/protocoltests.rb | 1 |
2 files changed, 68 insertions, 0 deletions
diff --git a/lib/custodian/protocoltest/mx.rb b/lib/custodian/protocoltest/mx.rb new file mode 100644 index 0000000..70fe465 --- /dev/null +++ b/lib/custodian/protocoltest/mx.rb @@ -0,0 +1,67 @@ +require 'custodian/protocoltest/tcp' + +# +# The MX (DNS + smtp) test. +# +# This object is instantiated if the parser sees a line such as: +# +### +### bytemark.co.uk must run mx otherwise 'mail fail'. +### +# +# +module Custodian + + module ProtocolTest + + class MXTest < TestFactory + + + # + # Constructor + # + def initialize( line ) + @line = line + end + + + # + # Allow this test to be serialized. + # + def to_s + @line + end + + + # + # Run the test. + # + def run_test + + # reset the error, in case we were previously executed. + @error = nil + + return true; + end + + + + + # + # If the test fails then report the error. + # + def error + @error + end + + + + + register_test_type "mx" + + + + + end + end +end diff --git a/lib/custodian/protocoltests.rb b/lib/custodian/protocoltests.rb index a1b6f3b..2aed748 100644 --- a/lib/custodian/protocoltests.rb +++ b/lib/custodian/protocoltests.rb @@ -16,6 +16,7 @@ require 'custodian/protocoltest/dnsbl' require 'custodian/protocoltest/ftp' require 'custodian/protocoltest/http' require 'custodian/protocoltest/imap' +require 'custodian/protocoltest/mx' require 'custodian/protocoltest/jabber' require 'custodian/protocoltest/ldap' require 'custodian/protocoltest/mysql' |