#NEWLINE# def scan( self , message ) : #NEWLINE# #INDENT# 'Convenience method that scans a message and returns the results,\n        without adding the spam headers.\n\n        :param message: Message to scan.\n        :type message: :py:obj:`bytes` or :class:`~slimta.envelope.Envelope`\n        :returns: Tuple of a spammy boolean followed by a list of the symbols\n                  matched in the scan.\n\n        ' #NEWLINE# if isinstance ( message , Envelope ) : #NEWLINE# #INDENT# ( header_data , message_data ) = message . flatten ( ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# header_data = b'' #NEWLINE# message_data = message #NEWLINE# #UNINDENT# socket = None #NEWLINE# try : #NEWLINE# #INDENT# socket = self . _socket_creator ( message_data . address ) #NEWLINE# log . connect ( socket , self . address ) #NEWLINE# self . _send_request ( socket , header_data , message_data ) #NEWLINE# return self . _recv_response ( socket ) #NEWLINE# #UNINDENT# finally : #NEWLINE# #INDENT# if socket : #NEWLINE# #INDENT# log . close ( socket ) #NEWLINE# socket . close ( )