mirror of
https://github.com/the-djmaze/snappymail.git
synced 2025-01-01 04:22:15 +08:00
81 lines
1.1 KiB
JavaScript
81 lines
1.1 KiB
JavaScript
/**
|
|
* https://tools.ietf.org/html/rfc5429
|
|
*/
|
|
|
|
import {
|
|
ActionCommand,
|
|
GrammarQuotedString,
|
|
GrammarString
|
|
} from 'Sieve/Grammar';
|
|
|
|
/**
|
|
* https://tools.ietf.org/html/rfc5429#section-2.1
|
|
*/
|
|
export class ErejectCommand extends ActionCommand
|
|
{
|
|
constructor()
|
|
{
|
|
super();
|
|
this._reason = new GrammarQuotedString;
|
|
}
|
|
|
|
get require() { return 'ereject'; }
|
|
|
|
toString()
|
|
{
|
|
return 'ereject ' + this._reason + ';';
|
|
}
|
|
|
|
get reason()
|
|
{
|
|
return this._reason.value;
|
|
}
|
|
|
|
set reason(value)
|
|
{
|
|
this._reason.value = value;
|
|
}
|
|
|
|
pushArguments(args)
|
|
{
|
|
if (args[0] instanceof GrammarString) {
|
|
this._reason = args[0];
|
|
}
|
|
}
|
|
}
|
|
|
|
/**
|
|
* https://tools.ietf.org/html/rfc5429#section-2.2
|
|
*/
|
|
export class RejectCommand extends ActionCommand
|
|
{
|
|
constructor()
|
|
{
|
|
super();
|
|
this._reason = new GrammarQuotedString;
|
|
}
|
|
|
|
get require() { return 'reject'; }
|
|
|
|
toString()
|
|
{
|
|
return 'reject ' + this._reason + ';';
|
|
}
|
|
|
|
get reason()
|
|
{
|
|
return this._reason.value;
|
|
}
|
|
|
|
set reason(value)
|
|
{
|
|
this._reason.value = value;
|
|
}
|
|
|
|
pushArguments(args)
|
|
{
|
|
if (args[0] instanceof GrammarString) {
|
|
this._reason = args[0];
|
|
}
|
|
}
|
|
}
|