def _get_participants(msg, excluded_emails=[]):
 participants = ((msg.to_addr + msg.cc_addr) + msg.bcc_addr)
 return sorted(list(set([email.lower() for (_, email) in participants if (email not in excluded_emails)])))

def _get_participants ( msg , excluded_emails = [ ] ) : participants = ( ( msg . to_addr + msg . cc_addr ) + msg . bcc_addr ) return sorted ( list ( set ( [ email . lower ( ) for ( _ , email ) in participants if ( email not in excluded_emails ) ] ) ) )
returns an alphabetically sorted list of emails addresses that msg was sent to .