Class MailUtil


  • public class MailUtil
    extends Object
    • Constructor Detail

      • MailUtil

        public MailUtil()
    • Method Detail

      • setPersonAndEmail

        public static void setPersonAndEmail​(String string,
                                             Property personProperty,
                                             Property emailProperty,
                                             Metadata metadata)
        This tries to split a "from" or "to" value into a person field and an email field. This does not handle RFC encoded strings (e.g. "=?iso-8859-1?Q?H=E9roux_Louise?"), you must decode them first.
        Parameters:
        string -
        personProperty -
        emailProperty -
        metadata -
      • addPersonAndEmail

        public static void addPersonAndEmail​(String string,
                                             Property personProperty,
                                             Property emailProperty,
                                             Metadata metadata)
        This tries to split a "from" or "to" value into a person field and an email field. This does not handle RFC encoded strings (e.g. "=?iso-8859-1?Q?H=E9roux_Louise?"), you must decode them first.
        Parameters:
        string -
        personProperty -
        emailProperty -
        metadata -
      • containsEmail

        public static boolean containsEmail​(String chunk)
        If the chunk looks like it contains an email
        Parameters:
        chunk - to analyse
        Returns:
        true if chunk looks like it contains an email