def mail_decode(src_ip_port, dst_ip_port, mail_creds):
 try:
  decoded = base64.b64decode(mail_creds).replace('\x00', ' ').decode('utf8')
  decoded = decoded.replace('\x00', ' ')
 except TypeError:
  decoded = None
 except UnicodeDecodeError as e:
  decoded = None
 if (decoded != None):
  msg = ('Decoded: %s' % decoded)
  printer(src_ip_port, dst_ip_port, msg)

def mail_decode ( src_ip_port , dst_ip_port , mail_creds ) : try : decoded = base64 . b64decode ( mail_creds ) . replace ( '\x00' , ' ' ) . decode ( 'utf8' ) decoded = decoded . replace ( '\x00' , ' ' ) except TypeError : decoded = None except UnicodeDecodeError as e : decoded = None if ( decoded != None ) : msg = ( 'Decoded: %s' % decoded ) printer ( src_ip_port , dst_ip_port , msg )
decode base64 mail creds .