<s> import os <EOL> import sys <EOL> import smtplib <EOL> from email . mime . text import MIMEText <EOL> from email . mime . multipart import MIMEMultipart <EOL> from email import Encoders <EOL> from email . MIMEBase import MIMEBase <EOL> import socket <EOL> from socket import gethostname <EOL> import datetime <EOL> global g_allowExternalResolver <EOL> g_allowExternalResolver = False <EOL> try : <EOL> import dns . resolver <EOL> g_allowExternalResolver = True <EOL> except : <EOL> pass <EOL> def getNow ( ) : <EOL> return datetime . datetime . now ( ) . strftime ( "<STR_LIT>" ) <EOL> def showsyntax ( args ) : <EOL> print "<STR_LIT>" <EOL> print "<STR_LIT>" % args [ <NUM_LIT:0> ] <EOL> print "<STR_LIT>" <EOL> print "<STR_LIT>" <EOL> print "<STR_LIT>" <EOL> print "<STR_LIT>" <EOL> print "<STR_LIT>" <EOL> print "<STR_LIT>" <EOL> print "<STR_LIT>" <EOL> print "<STR_LIT>" <EOL> print "<STR_LIT>" <EOL> print "<STR_LIT>" <EOL> print "<STR_LIT>" <EOL> if not g_allowExternalResolver : <EOL> print "<STR_LIT>" <EOL> print "<STR_LIT>" <EOL> print "<STR_LIT>" <EOL> print "<STR_LIT>" <EOL> print "<STR_LIT>" <EOL> return <EOL> def showbanner ( ) : <EOL> print """<STR_LIT>""" <EOL> return <EOL> def check_port ( host , port ) : <EOL> s = socket . socket ( socket . AF_INET , socket . SOCK_STREAM ) <EOL> try : <EOL> s . connect ( ( host , port ) ) <EOL> return True <EOL> except : <EOL> return False <EOL> def to_long ( ip ) : <EOL> ip = ip . split ( '<STR_LIT:.>' , <NUM_LIT:4> ) <EOL> return int ( ip [ <NUM_LIT:0> ] ) * ( <NUM_LIT:2> ** <NUM_LIT> ) + int ( ip [ <NUM_LIT:1> ] ) * ( <NUM_LIT:2> ** <NUM_LIT:16> ) + int ( ip [ <NUM_LIT:2> ] ) * ( <NUM_LIT:2> ** <NUM_LIT:8> ) + int ( ip [ <NUM_LIT:3> ] ) <EOL> def to_dotted_decimal ( long_form ) : <EOL> octets = [ ] <EOL> for i in range ( <NUM_LIT:4> ) : <EOL> octets += [ str ( long_form % <NUM_LIT:2> ** <NUM_LIT:8> ) ] <EOL> long_form = long_form >> <NUM_LIT:8> <EOL> return '<STR_LIT:.>' . join ( octets [ : : - <NUM_LIT:1> ] ) <EOL> def cidr_to_ipv4 ( cidr ) : <EOL> ip , network_bits = cidr . split ( '<STR_LIT:/>' , <NUM_LIT:1> ) <EOL> host_bits = <NUM_LIT:32> - int ( network_bits ) <EOL> long_form = to_long ( ip ) <EOL> start = ( long_form >> host_bits ) << host_bits <EOL> for i in xrange ( <NUM_LIT:2> ** host_bits ) : <EOL> yield to_dotted_decimal ( start | i ) <EOL> def readDNSServerFile ( dnsserverfile ) : <EOL> dnsservers = [ ] <EOL> try : <EOL> f = open ( dnsserverfile , "<STR_LIT:rb>" ) <EOL> content = f . readlines ( ) <EOL> f . close ( ) <EOL> for dnsline in content : <EOL> if not dnsline . startswith ( '<STR_LIT:#>' ) and dnsline . replace ( "<STR_LIT:U+0020>" , "<STR_LIT>" ) != "<STR_LIT>" : <EOL> dnsserver = dnsline . replace ( "<STR_LIT:\n>" , "<STR_LIT>" ) . replace ( "<STR_LIT:\r>" , "<STR_LIT>" ) <EOL> if not dnsserver in dnsservers : <EOL> dnsservers . append ( dnsserver ) <EOL> except : <EOL> print "<STR_LIT>" % dnsserverfile <EOL> return dnsservers <EOL> def checkdns ( dnsconfigfile , mailconfigfile , dnsservers ) : <EOL> useOSDNS = True <EOL> print "<STR_LIT>" <EOL> print "<STR_LIT>" <EOL> if len ( dnsservers ) > <NUM_LIT:0> : <EOL> print "<STR_LIT>" % len ( dnsservers ) <EOL> print "<STR_LIT>" % dnsservers <EOL> useOSDNS = False <EOL> else : <EOL> print "<STR_LIT>" <EOL> print "<STR_LIT>" <EOL> print "<STR_LIT>" <EOL> toreport = [ ] <EOL> cDNS = DNSConfig ( dnsconfigfile ) <EOL> dnsscope , dnsscope_short = cDNS . getConfig ( ) <EOL> dnscnt = <NUM_LIT:1> <EOL> for dnscheck in dnsscope : <EOL> extramsg = "<STR_LIT>" <EOL> allresults = [ ] <EOL> try : <EOL> if useOSDNS : <EOL> allresults = [ socket . gethostbyname ( dnscheck ) ] <EOL> else : <EOL> r = dns . resolver . Resolver ( ) <EOL> r . nameservers = dnsservers <EOL> dnsdata = r . query ( dnscheck ) <EOL> for rdata in dnsdata : <EOL> thisresult = rdata . address <EOL> if not thisresult in allresults : <EOL> allresults . append ( thisresult ) <EOL> extramsg = "<STR_LIT>" % allresults <EOL> except : <EOL> allresults = [ "<STR_LIT>" ] <EOL> extramsg = "<STR_LIT>" <EOL> siteok = True <EOL> for thisresult in allresults : <EOL> if not thisresult in dnsscope [ dnscheck ] : <EOL> siteok = False <EOL> extramsg = "<STR_LIT>" % allresults <EOL> toreport . append ( "<STR_LIT>" % <EOL> ( getNow ( ) , dnscheck , thisresult , dnsscope_short [ dnscheck ] ) ) <EOL> print "<STR_LIT>" % ( dnscnt , dnscheck , str ( siteok ) . lower ( ) , extramsg ) <EOL> dnscnt += <NUM_LIT:1> <EOL> print "<STR_LIT>" <EOL> print "<STR_LIT>" % ( len ( dnsscope ) , len ( toreport ) ) <EOL> if len ( toreport ) > <NUM_LIT:0> : <EOL> print "<STR_LIT>" <EOL> print "<STR_LIT:*>" * <NUM_LIT:50> <EOL> print "<STR_LIT>" % len ( toreport ) <EOL> mailbody = [ ] <EOL> mailbody . append ( "<STR_LIT>" ) <EOL> mailbody . append ( "<STR_LIT>" ) <EOL> mailbody . append ( "<STR_LIT>" % len ( toreport ) ) <EOL> mailbody . append ( "<STR_LIT>" ) <EOL> for tr in toreport : <EOL> mailbody . append ( tr ) <EOL> print tr <EOL> print "<STR_LIT:*>" * <NUM_LIT:50> <EOL> mailbody . append ( "<STR_LIT>" ) <EOL> mailbody . append ( "<STR_LIT>" ) <EOL> mailhandler = Mailer ( mailconfigfile ) <EOL> mailhandler . sendmail ( mailbody ) <EOL> return <EOL> class MailConfig : <EOL> """<STR_LIT>""" <EOL> serverinfo = { } <EOL> def __init__ ( self , filename ) : <EOL> self . filename = filename <EOL> self . fullpath = os . path . join ( os . path . dirname ( os . path . realpath ( __file__ ) ) , filename ) <EOL> def configFileExists ( self ) : <EOL> return os . path . isfile ( self . fullpath ) <EOL> def readConfigFile ( self ) : <EOL> f = open ( self . fullpath , "<STR_LIT:r>" ) <EOL> content = f . readlines ( ) <EOL> f . close ( ) <EOL> serverdata = { } <EOL> thisid = "<STR_LIT>" <EOL> for l in content : <EOL> line = l . replace ( "<STR_LIT:\n>" , "<STR_LIT>" ) . replace ( "<STR_LIT:\r>" , "<STR_LIT>" ) <EOL> if line . startswith ( "<STR_LIT:[>" ) and line . endswith ( "<STR_LIT:]>" ) : <EOL> if thisid != "<STR_LIT>" and len ( serverdata ) > <NUM_LIT:0> and not thisid in self . serverinfo : <EOL> self . serverinfo [ thisid ] = serverdata <EOL> thisid = line [ <NUM_LIT:1> : - <NUM_LIT:1> ] <EOL> serverdata = { } <EOL> if not line . startswith ( "<STR_LIT:#>" ) and len ( line ) > <NUM_LIT:0> and "<STR_LIT:=>" in line : <EOL> lineparts = line . split ( "<STR_LIT:=>" ) <EOL> configparam = lineparts [ <NUM_LIT:0> ] <EOL> if len ( lineparts ) > <NUM_LIT:1> and len ( configparam ) > <NUM_LIT:0> and len ( line ) > len ( configparam ) : <EOL> configval = line [ len ( configparam ) + <NUM_LIT:1> : ] <EOL> serverdata [ configparam ] = configval <EOL> if thisid != "<STR_LIT>" and len ( serverdata ) > <NUM_LIT:0> and not thisid in self . serverinfo : <EOL> self . serverinfo [ thisid ] = serverdata <EOL> return <EOL> def writeConfigFile ( self ) : <EOL> filecontent = [ ] <EOL> for configid in self . serverinfo : <EOL> thisdata = self . serverinfo [ configid ] <EOL> filecontent . append ( "<STR_LIT>" % str ( configid ) ) <EOL> filecontent += thisdata <EOL> f = open ( self . fullpath , "<STR_LIT:wb>" ) <EOL> for l in filecontent : <EOL> f . write ( "<STR_LIT>" % l ) <EOL> f . close ( ) <EOL> print "<STR_LIT>" <EOL> return <EOL> def initConfigFile ( self ) : <EOL> print "<STR_LIT>" <EOL> i_server = "<STR_LIT>" <EOL> i_port = <NUM_LIT> <EOL> i_timeout = <NUM_LIT> <EOL> i_auth = "<STR_LIT>" <EOL> i_user = "<STR_LIT>" <EOL> i_pass = "<STR_LIT>" <EOL> i_from = "<STR_LIT>" <EOL> i_to = "<STR_LIT>" <EOL> i_tls = "<STR_LIT>" <EOL> while True : <EOL> i_server = raw_input ( '<STR_LIT>' ) <EOL> if not i_server == "<STR_LIT>" : <EOL> break <EOL> while True : <EOL> i_port = raw_input ( '<STR_LIT>' ) <EOL> if not str ( i_port ) == "<STR_LIT>" : <EOL> try : <EOL> i_port = int ( i_port ) <EOL> break <EOL> except : <EOL> continue <EOL> else : <EOL> i_port = <NUM_LIT> <EOL> break <EOL> while True : <EOL> i_from = raw_input ( "<STR_LIT>" ) <EOL> if not i_from == "<STR_LIT>" : <EOL> break <EOL> while True : <EOL> i_to = raw_input ( "<STR_LIT>" ) <EOL> if not i_to == "<STR_LIT>" : <EOL> break <EOL> while True : <EOL> i_timeout = raw_input ( '<STR_LIT>' ) <EOL> if not str ( i_timeout ) == "<STR_LIT>" : <EOL> try : <EOL> i_timeout = int ( i_timeout ) <EOL> break <EOL> except : <EOL> continue <EOL> else : <EOL> i_timeout = <NUM_LIT> <EOL> break <EOL> while True : <EOL> i_auth = raw_input ( '<STR_LIT>' ) <EOL> i_auth = i_auth . lower ( ) <EOL> if i_auth == "<STR_LIT>" : <EOL> i_auth = "<STR_LIT>" <EOL> if i_auth in [ "<STR_LIT:yes>" , "<STR_LIT>" ] : <EOL> break <EOL> if i_auth == "<STR_LIT:yes>" : <EOL> while True : <EOL> i_user = raw_input ( '<STR_LIT>' ) <EOL> if not i_user == "<STR_LIT>" : <EOL> break <EOL> while True : <EOL> i_pass = raw_input ( '<STR_LIT>' ) <EOL> if not i_pass == "<STR_LIT>" : <EOL> break <EOL> while True : <EOL> i_tls = raw_input ( '<STR_LIT>' ) <EOL> i_tls = i_tls . lower ( ) <EOL> if i_tls == "<STR_LIT>" : <EOL> i_tls = "<STR_LIT>" <EOL> if i_tls in [ "<STR_LIT:yes>" , "<STR_LIT>" ] : <EOL> break <EOL> initserverdata = [ ] <EOL> initserverdata . append ( "<STR_LIT>" % i_server ) <EOL> initserverdata . append ( "<STR_LIT>" % i_port ) <EOL> initserverdata . append ( "<STR_LIT>" % i_from ) <EOL> initserverdata . append ( "<STR_LIT>" % i_to ) <EOL> initserverdata . append ( "<STR_LIT>" % i_timeout ) <EOL> initserverdata . append ( "<STR_LIT>" % i_auth ) <EOL> initserverdata . append ( "<STR_LIT>" % i_user ) <EOL> initserverdata . append ( "<STR_LIT>" % i_pass ) <EOL> initserverdata . append ( "<STR_LIT>" % i_tls ) <EOL> self . serverinfo = { } <EOL> self . serverinfo [ i_server ] = initserverdata <EOL> self . writeConfigFile ( ) <EOL> return <EOL> class DNSConfig : <EOL> """<STR_LIT>""" <EOL> def __init__ ( self , configfile ) : <EOL> self . configfile = configfile <EOL> return <EOL> def getConfig ( self ) : <EOL> configrecords = { } <EOL> configrecords_short = { } <EOL> f = open ( self . configfile , "<STR_LIT:rb>" ) <EOL> contents = f . readlines ( ) <EOL> f . close <EOL> for thisline in contents : <EOL> if not thisline . replace ( "<STR_LIT:U+0020>" , "<STR_LIT>" ) == "<STR_LIT>" and not thisline . startswith ( "<STR_LIT:#>" ) : <EOL> thislineparts = thisline . split ( "<STR_LIT:=>" ) <EOL> if len ( thislineparts ) == <NUM_LIT:2> : <EOL> sitename = thislineparts [ <NUM_LIT:0> ] . replace ( "<STR_LIT:U+0020>" , "<STR_LIT>" ) <EOL> siteiplist = thislineparts [ <NUM_LIT:1> ] . replace ( "<STR_LIT:\r>" , "<STR_LIT>" ) . replace ( "<STR_LIT:\n>" , "<STR_LIT>" ) . replace ( "<STR_LIT:U+0020>" , "<STR_LIT>" ) <EOL> if len ( sitename ) > <NUM_LIT:0> and len ( siteiplist ) > <NUM_LIT:0> : <EOL> siteips = siteiplist . split ( '<STR_LIT:U+002C>' ) <EOL> iplist = [ ] <EOL> for thisip in siteips : <EOL> if not thisip . startswith ( "<STR_LIT:->" ) : <EOL> tip = thisip . replace ( "<STR_LIT:\\>" , "<STR_LIT:/>" ) <EOL> if "<STR_LIT:/>" in tip : <EOL> cidrlist = cidr_to_ipv4 ( tip ) <EOL> for ip in cidrlist : <EOL> if not ip in iplist : <EOL> iplist . append ( ip ) <EOL> else : <EOL> if not tip in iplist : <EOL> iplist . append ( thisip ) <EOL> if not sitename in configrecords_short : <EOL> configrecords_short [ sitename ] = [ thisip ] <EOL> else : <EOL> configrecords_short [ sitename ] . append ( thisip ) <EOL> for thisip in siteips : <EOL> if thisip . startswith ( "<STR_LIT:->" ) : <EOL> tip = thisip . replace ( "<STR_LIT:\\>" , "<STR_LIT:/>" ) . replace ( "<STR_LIT:->" , "<STR_LIT>" ) <EOL> if "<STR_LIT:/>" in tip : <EOL> cidrlist = cidr_to_ipv4 ( tip ) <EOL> for ip in cidrlist : <EOL> if ip in iplist : <EOL> iplist . remove ( ip ) <EOL> else : <EOL> if tip in iplist : <EOL> iplist . remove ( tip ) <EOL> for thisip in iplist : <EOL> if not sitename in configrecords : <EOL> configrecords [ sitename ] = [ thisip ] <EOL> else : <EOL> configrecords [ sitename ] . append ( thisip ) <EOL> return configrecords , configrecords_short <EOL> class Mailer : <EOL> """<STR_LIT>""" <EOL> def __init__ ( self , smtpconfigfile ) : <EOL> self . server = "<STR_LIT:127.0.0.1>" <EOL> self . timeout = <NUM_LIT> <EOL> self . port = <NUM_LIT> <EOL> self . to = "<STR_LIT>" <EOL> self . fromaddress = "<STR_LIT>" <EOL> self . login = "<STR_LIT>" <EOL> self . password = "<STR_LIT>" <EOL> self . requirelogin = False <EOL> self . usetls = False <EOL> cEmailConfig = MailConfig ( smtpconfigfile ) <EOL> cEmailConfig . readConfigFile ( ) <EOL> serverconfigs = cEmailConfig . serverinfo <EOL> print "<STR_LIT>" % len ( serverconfigs ) <EOL> for mailid in serverconfigs : <EOL> thisconfig = serverconfigs [ mailid ] <EOL> if "<STR_LIT>" in thisconfig : <EOL> self . server = thisconfig [ "<STR_LIT>" ] <EOL> if "<STR_LIT:port>" in thisconfig : <EOL> self . port = int ( thisconfig [ "<STR_LIT:port>" ] ) <EOL> print "<STR_LIT>" % ( self . server , self . port ) <EOL> if check_port ( self . server , self . port ) : <EOL> print "<STR_LIT>" <EOL> if "<STR_LIT>" in thisconfig : <EOL> self . timeout = int ( thisconfig [ "<STR_LIT>" ] ) <EOL> if "<STR_LIT>" in thisconfig : <EOL> if thisconfig [ "<STR_LIT>" ] == "<STR_LIT:yes>" : <EOL> self . requirelogin = True <EOL> else : <EOL> self . requirelogin = False <EOL> if "<STR_LIT:user>" in thisconfig : <EOL> self . login = thisconfig [ "<STR_LIT:user>" ] <EOL> if "<STR_LIT>" in thisconfig : <EOL> self . password = thisconfig [ "<STR_LIT>" ] <EOL> if "<STR_LIT>" in thisconfig : <EOL> if thisconfig [ "<STR_LIT>" ] == "<STR_LIT:yes>" : <EOL> self . usetls = True <EOL> else : <EOL> self . usetls = False <EOL> if "<STR_LIT:to>" in thisconfig : <EOL> self . to = thisconfig [ "<STR_LIT:to>" ] <EOL> if "<STR_LIT>" in thisconfig : <EOL> self . fromaddress = thisconfig [ "<STR_LIT>" ] <EOL> break <EOL> else : <EOL> print "<STR_LIT>" <EOL> return <EOL> def sendmail ( self , info , logfile = [ ] , mailsubject = "<STR_LIT>" ) : <EOL> msg = MIMEMultipart ( ) <EOL> bodytext = "<STR_LIT:\n>" . join ( x for x in info ) <EOL> logtext = "<STR_LIT:\n>" . join ( x for x in logfile ) <EOL> mailbody = MIMEText ( bodytext , '<STR_LIT>' ) <EOL> msg . attach ( mailbody ) <EOL> msg [ '<STR_LIT>' ] = '<STR_LIT>' % ( gethostname ( ) , mailsubject ) <EOL> msg [ '<STR_LIT>' ] = self . fromaddress <EOL> msg [ '<STR_LIT>' ] = self . fromaddress <EOL> msg [ '<STR_LIT>' ] = self . to <EOL> msg [ '<STR_LIT>' ] = '<STR_LIT:2>' <EOL> if len ( logfile ) > <NUM_LIT:0> : <EOL> part = MIMEBase ( '<STR_LIT>' , "<STR_LIT>" ) <EOL> part . set_payload ( logtext ) <EOL> Encoders . encode_base64 ( part ) <EOL> part . add_header ( '<STR_LIT>' , '<STR_LIT>' ) <EOL> msg . attach ( part ) <EOL> noerror = False <EOL> thistimeout = <NUM_LIT:5> <EOL> while not noerror : <EOL> try : <EOL> print "<STR_LIT>" % ( self . server , self . port ) <EOL> s = smtplib . SMTP ( self . server , self . port , '<STR_LIT>' , self . timeout ) <EOL> print "<STR_LIT>" <EOL> if self . usetls : <EOL> print "<STR_LIT>" <EOL> s . starttls ( ) <EOL> print "<STR_LIT>" <EOL> if self . requirelogin : <EOL> print "<STR_LIT>" <EOL> s . login ( self . login , self . password ) <EOL> print "<STR_LIT>" <EOL> print "<STR_LIT>" <EOL> s . sendmail ( self . to , [ self . to ] , msg . as_string ( ) ) <EOL> print "<STR_LIT>" <EOL> s . quit ( ) <EOL> noerror = True <EOL> except smtplib . SMTPServerDisconnected as e : <EOL> print "<STR_LIT>" <EOL> print "<STR_LIT>" <EOL> noerror = True <EOL> except smtplib . SMTPResponseException as e : <EOL> print "<STR_LIT>" % ( str ( e . smtp_code ) , e . smtp_error ) <EOL> except smtplib . SMTPSenderRefused as e : <EOL> print "<STR_LIT>" % ( str ( e . smtp_code ) , smtp_error ) <EOL> except smtplib . SMTPRecipientsRefused as e : <EOL> print "<STR_LIT>" <EOL> except smtplib . SMTPDataError as e : <EOL> print "<STR_LIT>" <EOL> except smtplib . SMTPConnectError as e : <EOL> print "<STR_LIT>" <EOL> except smtplib . SMTPHeloError as e : <EOL> print "<STR_LIT>" <EOL> except smtplib . SMTPException as e : <EOL> print "<STR_LIT>" <EOL> except : <EOL> print "<STR_LIT>" <EOL> if not noerror : <EOL> print "<STR_LIT>" % thistimeout <EOL> time . sleep ( thistimeout ) <EOL> if thistimeout < <NUM_LIT> : <EOL> thistimeout += <NUM_LIT:5> <EOL> return <EOL> if __name__ == "<STR_LIT:__main__>" : <EOL> mailconfigerror = True <EOL> dnsconfigerror = True <EOL> workingfolder = os . getcwd ( ) <EOL> dnsconfigfile = os . path . join ( workingfolder , "<STR_LIT>" ) <EOL> mailconfigfile = os . path . join ( workingfolder , "<STR_LIT>" ) <EOL> dnsserverfile = "<STR_LIT>" <EOL> dnsservers = [ ] <EOL> showbanner ( ) <EOL> arguments = [ ] <EOL> if len ( sys . argv ) >= <NUM_LIT:2> : <EOL> arguments = sys . argv [ <NUM_LIT:1> : ] <EOL> args = { } <EOL> last = "<STR_LIT>" <EOL> for word in arguments : <EOL> if ( word [ <NUM_LIT:0> ] == '<STR_LIT:->' ) : <EOL> word = word . lstrip ( "<STR_LIT:->" ) <EOL> args [ word ] = True <EOL> last = word <EOL> else : <EOL> if ( last != "<STR_LIT>" ) : <EOL> if str ( args [ last ] ) == "<STR_LIT:True>" : <EOL> args [ last ] = word <EOL> else : <EOL> args [ last ] = args [ last ] + "<STR_LIT:U+0020>" + word <EOL> if "<STR_LIT:h>" in args : <EOL> showsyntax ( sys . argv ) <EOL> sys . exit ( <NUM_LIT:0> ) <EOL> if "<STR_LIT:d>" in args : <EOL> if type ( args [ "<STR_LIT:d>" ] ) . __name__ . lower ( ) != "<STR_LIT:bool>" : <EOL> dnsconfigfile = args [ "<STR_LIT:d>" ] <EOL> if "<STR_LIT:s>" in args : <EOL> if type ( args [ "<STR_LIT:s>" ] ) . __name__ . lower ( ) != "<STR_LIT:bool>" : <EOL> mailconfigfile = args [ "<STR_LIT:s>" ] <EOL> if "<STR_LIT:n>" in args and g_allowExternalResolver : <EOL> if type ( args [ "<STR_LIT:n>" ] ) . __name__ . lower ( ) != "<STR_LIT:bool>" : <EOL> dnsserverfile = args [ "<STR_LIT:n>" ] <EOL> if not os . path . isfile ( dnsserverfile ) : <EOL> print "<STR_LIT>" % dnsserverfile <EOL> dnsserverfile = "<STR_LIT>" <EOL> else : <EOL> dnsservers = readDNSServerFile ( dnsserverfile ) <EOL> if not os . path . isfile ( dnsconfigfile ) : <EOL> print "<STR_LIT>" % dnsconfigfile <EOL> sys . exit ( <NUM_LIT:1> ) <EOL> else : <EOL> print "<STR_LIT>" % dnsconfigfile <EOL> cEmailConfig = MailConfig ( mailconfigfile ) <EOL> if not cEmailConfig . configFileExists ( ) : <EOL> print "<STR_LIT>" % mailconfigfile <EOL> cEmailConfig . initConfigFile ( ) <EOL> else : <EOL> print "<STR_LIT>" % mailconfigfile <EOL> cEmailConfig . readConfigFile ( ) <EOL> if "<STR_LIT>" in args : <EOL> content = [ ] <EOL> mailhandler = Mailer ( mailconfigfile ) <EOL> info = [ '<STR_LIT>' ] <EOL> mailhandler . sendmail ( info , content , '<STR_LIT>' ) <EOL> sys . exit ( <NUM_LIT:0> ) <EOL> checkdns ( dnsconfigfile , mailconfigfile , dnsservers ) </s>
