for (MailAddress address : env.getRecipients()) {
replies.put(address, DeliveryReturnCode.TEMPORARY_FAILURE);
}
}
LMTPMultiResponse lmtpResponse = null;
for (MailAddress address : replies.keySet())
{
DeliveryReturnCode code = replies.get(address);
SMTPResponse response;
switch (code) {
case OK:
response = new SMTPResponse(SMTPRetCode.MAIL_OK,
DSNStatus.getStatus(DSNStatus.SUCCESS, DSNStatus.UNDEFINED_STATUS)
+ " Ok");
break;
case NO_SUCH_USER:
response = new SMTPResponse(SMTPRetCode.MAILBOX_PERM_UNAVAILABLE,
DSNStatus.getStatus(DSNStatus.PERMANENT, DSNStatus.ADDRESS_MAILBOX)
+ " Unknown user " + address.toString());
break;
case OVER_QUOTA:
response = new SMTPResponse(SMTPRetCode.QUOTA_EXCEEDED,
DSNStatus.getStatus(DSNStatus.PERMANENT, DSNStatus.MAILBOX_FULL)
+ " User over quota");
break;
case PERMANENT_FAILURE:
response = new SMTPResponse(SMTPRetCode.TRANSACTION_FAILED,
DSNStatus.getStatus(DSNStatus.PERMANENT, DSNStatus.SYSTEM_OTHER)
+ " Unable to deliver message");
break;
case TEMPORARY_FAILURE:
response = new SMTPResponse(SMTPRetCode.LOCAL_ERROR,
DSNStatus.getStatus(DSNStatus.TRANSIENT, DSNStatus.SYSTEM_OTHER)
+ " Unable to process request");
break;
default:
response = new SMTPResponse(SMTPRetCode.LOCAL_ERROR,
DSNStatus.getStatus(DSNStatus.TRANSIENT, DSNStatus.SYSTEM_OTHER)
+ " Unable to process request");
break;
}
if (lmtpResponse == null) {
lmtpResponse = new LMTPMultiResponse(response);
} else {
lmtpResponse.addResponse(response);
}
}
return lmtpResponse;