public static String extractEmailAddress(final String args, final int offset) {
        String address = args.substring(offset).trim();
        if (address.indexOf('<') == 0) {
            address = address.substring(1, address.indexOf('>'));
            // spaces within the <> are also possible, Postfix apparently
            // trims these away:
            return address.trim();
        }

        // find space (e.g. SIZE argument)
        final int nextarg = address.indexOf(" ");
        if (nextarg > -1) {
            address = address.substring(0, nextarg).trim();
        }
        return address;
    }
Extracts the email address within a &lt;&gt; after a specified offset.
src/main/java/de/gessnerfl/fakesmtp/smtp/util/EmailUtils.java