Package com.icegreen.greenmail.imap
Class ImapResponse
java.lang.Object
com.icegreen.greenmail.imap.ImapResponse
- All Implemented Interfaces:
ImapConstants
Class providing methods to send response messages from the server
to the client.
-
Field Summary
Fields inherited from interface com.icegreen.greenmail.imap.ImapConstants
BAD, BYE, HIERARCHY_DELIMITER, HIERARCHY_DELIMITER_CHAR, INBOX_NAME, MESSAGES, NAMESPACE_PREFIX, NAMESPACE_PREFIX_CHAR, NO, OK, SP, STORAGE, UNTAGGED, USER_NAMESPACE, VERSION -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidbadResponse(String message) Writes a standard untagged BAD response, together with a descriptive message.voidbyeResponse(String message) voidcommandComplete(ImapCommand command) Writes a standard tagged OK response on completion of a command.voidcommandComplete(ImapCommand command, String responseCode) Writes a standard tagged OK response on completion of a command, with a response code (eg READ-WRITE) Response is written as:voidcommandError(String message) Writes a standard BAD response on command error, together with a descriptive message.voidcommandFailed(ImapCommand command, String reason) Writes a standard NO response on command failure, together with a descriptive message.voidcommandFailed(ImapCommand command, String responseCode, String reason) Writes a standard NO response on command failure, together with a descriptive message.voidcommandResponse(ImapCommand command, String message) voidexistsResponse(int count) voidexpungeResponse(int msn) voidfetchResponse(int msn, String msgData) voidflagsResponse(jakarta.mail.Flags flags) voidokResponse(String responseCode, String message) Writes an untagged OK response, with the supplied response code, and an optional message.voidpermanentFlagsResponse(jakarta.mail.Flags flags) voidrecentResponse(int count) voidvoidtaggedResponse(String message) Writes the message provided to the client, prepended with the request tag.voiduntaggedResponse(String message) Writes the message provided to the client, prepended with the untagged marker "*".
-
Constructor Details
-
ImapResponse
-
-
Method Details
-
setTag
-
commandComplete
Writes a standard tagged OK response on completion of a command. Response is written as:a01 OK COMMAND_NAME completed.
- Parameters:
command- The ImapCommand which was completed.
-
commandComplete
Writes a standard tagged OK response on completion of a command, with a response code (eg READ-WRITE) Response is written as:a01 OK [responseCode] COMMAND_NAME completed.
- Parameters:
command- The ImapCommand which was completed.responseCode- A string response code to send to the client.
-
commandFailed
Writes a standard NO response on command failure, together with a descriptive message. Response is written as:a01 NO COMMAND_NAME failed. <reason>
- Parameters:
command- The ImapCommand which failed.reason- A message describing why the command failed.
-
commandFailed
Writes a standard NO response on command failure, together with a descriptive message. Response is written as:a01 NO [responseCode] COMMAND_NAME failed. <reason>
- Parameters:
command- The ImapCommand which failed.responseCode- The Imap response code to send.reason- A message describing why the command failed.
-
commandError
Writes a standard BAD response on command error, together with a descriptive message. Response is written as:a01 BAD <message>
- Parameters:
message- The descriptive error message.
-
badResponse
Writes a standard untagged BAD response, together with a descriptive message. -
okResponse
Writes an untagged OK response, with the supplied response code, and an optional message.- Parameters:
responseCode- The response code, included in [].message- The message to follow the []
-
flagsResponse
public void flagsResponse(jakarta.mail.Flags flags) -
existsResponse
public void existsResponse(int count) -
recentResponse
public void recentResponse(int count) -
expungeResponse
public void expungeResponse(int msn) -
fetchResponse
-
commandResponse
-
taggedResponse
Writes the message provided to the client, prepended with the request tag.- Parameters:
message- The message to write to the client.
-
untaggedResponse
Writes the message provided to the client, prepended with the untagged marker "*".- Parameters:
message- The message to write to the client.
-
byeResponse
-
permanentFlagsResponse
public void permanentFlagsResponse(jakarta.mail.Flags flags)
-