private RecipientAST parseRecipient() throws ParseException {
String DOMAIN_POSTMASTER_PREFIX = "<Postmaster@";
String SYSTEM_POSTMASTER_PREFIX = "<Postmaster>";
pushPosition();
if (inputEqualsIgnoreCase(DOMAIN_POSTMASTER_PREFIX)) {
PathAST pathAST = parsePath();
if (pathAST.mailboxAST.remotePartAST instanceof DomainRemotePartAST)
return new DomainPostmasterRecipientAST(popPosition(),
pathAST.mailboxAST);
else
return new MailboxRecipientAST(popPosition(), pathAST);
} else if (inputEqualsIgnoreCase(SYSTEM_POSTMASTER_PREFIX)) {
accept('<');
pushSpelling();
acceptThem(SYSTEM_POSTMASTER_PREFIX.length() - 2);
String postmasterSpelling = popSpelling();
accept('>');
return new SystemPostmasterRecipientAST(popPosition(), postmasterSpelling);
} else {
PathAST pathAST = parsePath();
return new MailboxRecipientAST(popPosition(), pathAST);
}
}