def HeaderPrintMUADetails(message, mta=None):
 details = []
 for header in MUA_ID_HEADERS:
  value = message.get(header)
  if value:
   value = ' '.join([v for v in HP_MUA_ID_SPLIT.split(value.strip()) if (not HP_MUA_ID_IGNORE.search(v))])
   details.extend([header, value.strip()])
 if (not details):
  if (mta and mta[0].startswith('Received by google.com')):
   details.extend(['Guessed', 'GMail'])
  elif (('x-ms-tnef-correlator' in message) or ('x-ms-has-attach' in message)):
   details.extend(['Guessed', 'Exchange'])
  elif ('@mailpile' in message.get('message-id', '')):
   details.extend(['Guessed', 'Mailpile'])
 return details

def HeaderPrintMUADetails ( message , mta = None ) : details = [ ] for header in MUA_ID_HEADERS : value = message . get ( header ) if value : value = ' ' . join ( [ v for v in HP_MUA_ID_SPLIT . split ( value . strip ( ) ) if ( not HP_MUA_ID_IGNORE . search ( v ) ) ] ) details . extend ( [ header , value . strip ( ) ] ) if ( not details ) : if ( mta and mta [ 0 ] . startswith ( 'Received by google.com' ) ) : details . extend ( [ 'Guessed' , 'GMail' ] ) elif ( ( 'x-ms-tnef-correlator' in message ) or ( 'x-ms-has-attach' in message ) ) : details . extend ( [ 'Guessed' , 'Exchange' ] ) elif ( '@mailpile' in message . get ( 'message-id' , '' ) ) : details . extend ( [ 'Guessed' , 'Mailpile' ] ) return details
summarize what the message tells us directly about the mua .