mirror of
https://github.com/the-djmaze/snappymail.git
synced 2025-01-01 04:22:15 +08:00
58 lines
848 B
JavaScript
58 lines
848 B
JavaScript
/**
|
|
* https://tools.ietf.org/html/rfc5463
|
|
*/
|
|
|
|
import {
|
|
ControlCommand,
|
|
TestCommand,
|
|
GrammarQuotedString,
|
|
GrammarStringList
|
|
} from 'Sieve/Grammar';
|
|
|
|
/**
|
|
* https://datatracker.ietf.org/doc/html/rfc5463#section-4
|
|
*/
|
|
export class IHaveTest extends TestCommand
|
|
{
|
|
constructor()
|
|
{
|
|
super();
|
|
this.capabilities = new GrammarStringList;
|
|
}
|
|
|
|
get require() { return 'ihave'; }
|
|
|
|
toString()
|
|
{
|
|
return 'ihave ' + this.capabilities;
|
|
}
|
|
|
|
pushArguments(args)
|
|
{
|
|
this.capabilities = args.pop();
|
|
}
|
|
}
|
|
|
|
/**
|
|
* https://datatracker.ietf.org/doc/html/rfc5463#section-5
|
|
*/
|
|
export class ErrorCommand extends ControlCommand
|
|
{
|
|
constructor()
|
|
{
|
|
super();
|
|
this.message = new GrammarQuotedString;
|
|
}
|
|
|
|
get require() { return 'ihave'; }
|
|
|
|
toString()
|
|
{
|
|
return 'error ' + this.message + ';';
|
|
}
|
|
|
|
pushArguments(args)
|
|
{
|
|
this.message = args.pop();
|
|
}
|
|
}
|