def email_list(mail)
      [mail.to, mail.bcc, mail.cc].flatten.uniq.compact
    end
def email_list(mail)
      [mail.to, mail.bcc, mail.cc].flatten.uniq.compact
    end
Private: Get all unique emails across all headers that the email may contain.

 mail - Mail object

 Return Array of email addresses.