public static void setPersonAndEmail(String string, Property personProperty,
                                         Property emailProperty, Metadata metadata) {

        StringBuffer sb = new StringBuffer();
        String email = extractEmail(string, sb);
        String person = clean(sb.toString());
        if (person != null && person.length() > 0) {
            metadata.set(personProperty, person);
        }
        if (email != null && email.length() > 0) {
            metadata.set(emailProperty, email);
        }

    }
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.

@param string
@param personProperty
@param emailProperty
@param metadata
tika-parsers/tika-parsers-standard/tika-parsers-standard-modules/tika-parser-mail-commons/src/main/java/org/apache/tika/parser/mailcommons/MailUtil.java