jodd-mail/src/main/java/jodd/mail/RFC2822AddressParser.java
public ParsedAddress parse(String email) {
		email = email.trim();

		// match all

		final Matcher mailboxMatcher = MAILBOX_PATTERN().matcher(email);
		final boolean mailboxMatcherMatches = mailboxMatcher.matches();
		final String[] mailboxMatcherParts = mailboxMatcherMatches ? _calcMatcherParts(mailboxMatcher) : null;

		final Matcher returnPathMatcher = RETURN_PATH_PATTERN().matcher(email);
		final boolean returnPathMatches = returnPathMatcher.matches();

		// extract

		String personalName = null;
		String localPart = null;
		String domain = null;
		InternetAddress internetAddress = null;
		String returnPathAddress = null;

		if (mailboxMatcherMatches) {
			personalName = mailboxMatcherParts[0];
			localPart = mailboxMatcherParts[1];
			domain = mailboxMatcherParts[2];
			internetAddress = pullFromGroups(mailboxMatcher);
		}

		if (returnPathMatches) {
			if (internetAddress != null) {
				returnPathAddress = internetAddress.getAddress();
			} else {
				returnPathAddress = StringPool.EMPTY;
			}
		}

		return new ParsedAddress(mailboxMatcherMatches, personalName, localPart, domain, internetAddress, returnPathMatches, returnPathAddress);
	}
public ParsedAddress parse(String email) {
		email = email.trim();

		// match all

		final Matcher mailboxMatcher = MAILBOX_PATTERN().matcher(email);
		final boolean mailboxMatcherMatches = mailboxMatcher.matches();
		final String[] mailboxMatcherParts = mailboxMatcherMatches ? _calcMatcherParts(mailboxMatcher) : null;

		final Matcher returnPathMatcher = RETURN_PATH_PATTERN().matcher(email);
		final boolean returnPathMatches = returnPathMatcher.matches();

		// extract

		String personalName = null;
		String localPart = null;
		String domain = null;
		InternetAddress internetAddress = null;
		String returnPathAddress = null;

		if (mailboxMatcherMatches) {
			personalName = mailboxMatcherParts[0];
			localPart = mailboxMatcherParts[1];
			domain = mailboxMatcherParts[2];
			internetAddress = pullFromGroups(mailboxMatcher);
		}

		if (returnPathMatches) {
			if (internetAddress != null) {
				returnPathAddress = internetAddress.getAddress();
			} else {
				returnPathAddress = StringPool.EMPTY;
			}
		}

		return new ParsedAddress(mailboxMatcherMatches, personalName, localPart, domain, internetAddress, returnPathMatches, returnPathAddress);
	}
public ParsedAddress parse ( String email ) { email = email . trim ( ) ; // match all final Matcher mailboxMatcher = MAILBOX_PATTERN ( ) . matcher ( email ) ; final boolean mailboxMatcherMatches = mailboxMatcher . matches ( ) ; final String [ ] mailboxMatcherParts = mailboxMatcherMatches ? _calcMatcherParts ( mailboxMatcher ) : null ; final Matcher returnPathMatcher = RETURN_PATH_PATTERN ( ) . matcher ( email ) ; final boolean returnPathMatches = returnPathMatcher . matches ( ) ; // extract String personalName = null ; String localPart = null ; String domain = null ; InternetAddress internetAddress = null ; String returnPathAddress = null ; if ( mailboxMatcherMatches ) { personalName = mailboxMatcherParts [ 0 ] ; localPart = mailboxMatcherParts [ 1 ] ; domain = mailboxMatcherParts [ 2 ] ; internetAddress = pullFromGroups ( mailboxMatcher ) ; } if ( returnPathMatches ) { if ( internetAddress != null ) { returnPathAddress = internetAddress . getAddress ( ) ; } else { returnPathAddress = StringPool . EMPTY ; } } return new ParsedAddress ( mailboxMatcherMatches , personalName , localPart , domain , internetAddress , returnPathMatches , returnPathAddress ) ; }
Parses email address. Returns {@link ParsedAddress parsed address}, that might be valid or not.
Parses email address . Returns {