Class ManageSieveCommand.

Inherits EventHandler

This class represents a single ManageSieve command. It is analogous to a POP Command. Almost identical, in fact.

ManageSieveCommand::ManageSieveCommand( ManageSieve * sieve, Command cmd )

Creates a new ManageSieveCommand object representing the command cmd for the ManageSieve server sieve. It is also necessary to call setArguments() and execute().

bool ManageSieveCommand::authenticate()

Handles the AUTHENTICATE command.

bool ManageSieveCommand::deleteScript()

Handles the DELETESCRIPT command.

bool ManageSieveCommand::done()

Returns true if this ManageSieveCommand has finished executing: and false if execute() hasn't been called, or if it has work left to do.

static EString ManageSieveCommand::encoded( const EString & input )

Returns input encoded either as a managesieve quoted or literal string. Quoted is preferred, if possible.

void ManageSieveCommand::end()

Verifies that parsing has reached the end of the argument list, and logs an error else.

bool ManageSieveCommand::explain()

This Archiveopteryx extension explains what a sieve script (the first argument) does with a given message. It is intended for automated testing.

The command takes a number of name-value pairs as aguments. The possible names are from, to, keep, script and message. The arguments are syntactically valid addresses, mailbox name, sieve scripts and messages.

It runs the script on the rest of the data and reports what actions would be performed, if any, and whether the script completed. (If the message is not available, the script may or may not be able to complete.)

NOTE: This command uses static storage. If two managesieve clients use it at the same time, they'll overwrite each other's data.

bool ManageSieveCommand::getScript()

Handles the GETSCRIPT command.

bool ManageSieveCommand::haveSpace()

Handles the HAVESPACE command. Accepts any name and size, then reports OK: We don't do hard quotas.

bool ManageSieveCommand::listScripts()

Handles the LISTSCRIPTS command.

void ManageSieveCommand::no( const EString & message )

Records that this command is to be rejected, optionally with message.

bool ManageSieveCommand::noop()

Does nothing, either simply or with inscrutable features.

uint ManageSieveCommand::number()

Returns the next number from the client, or sends a NO if there isn't a number (in the 32-bit range).

bool ManageSieveCommand::putScript()

Handles the PUTSCRIPT command.

Silently creates any mailboxes referred to by fileinto commands, provided they're in the user's own namespace.

This solves the major problem caused fileinto commands that refer to unknown mailbox names. People can still delete or rename mailboxes while a script refers to them, and it's possible to fileinto "/users/someoneelse/inbox", but those are much smaller problem by comparison.

I also like the timing of this: Uploading a script containing fileinto "x" creates x at once (instead of later, which sendmail does).

bool ManageSieveCommand::renameScript()

The RENAMESCRIPT command. Nothing out of the ordinary.

bool ManageSieveCommand::setActive()

Handles the SETACTIVE command.

void ManageSieveCommand::setArguments( const EString & args )

Tells this command to parse args. This is usually the command's own arguments, but can also be supplementary data supplied later. SASL authentication uses supplmenetary data.

bool ManageSieveCommand::startTls()

Handles the STARTTLS command.

EString ManageSieveCommand::string()

Returns the next argument from the client, which must be a string, or sends a NO.

void ManageSieveCommand::whitespace()

Skips whitespace in the argument list. Should perhaps report an error if there isn't any? Let's keep it as it is, though.

This web page based on source code belonging to The Archiveopteryx Developers. All rights reserved.