2021-01-14 04:23:19 +08:00
|
|
|
/**
|
2021-01-15 00:50:23 +08:00
|
|
|
* https://tools.ietf.org/html/rfc5429
|
2021-01-14 04:23:19 +08:00
|
|
|
*/
|
|
|
|
|
|
|
|
(Sieve => {
|
|
|
|
|
2021-01-15 00:50:23 +08:00
|
|
|
const Grammar = Sieve.Grammar;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* https://tools.ietf.org/html/rfc5429#section-2.1
|
|
|
|
*/
|
|
|
|
class Ereject extends Grammar.Command
|
2021-01-14 04:23:19 +08:00
|
|
|
{
|
|
|
|
constructor()
|
|
|
|
{
|
2021-01-15 00:50:23 +08:00
|
|
|
super('ereject');
|
|
|
|
this._reason = new Grammar.QuotedString;
|
2021-01-14 04:23:19 +08:00
|
|
|
}
|
|
|
|
|
2021-01-15 07:14:45 +08:00
|
|
|
get require() { return 'ereject'; }
|
|
|
|
|
2021-01-14 04:23:19 +08:00
|
|
|
toString()
|
|
|
|
{
|
2021-01-15 00:50:23 +08:00
|
|
|
return 'ereject ' + this._reason + ';';
|
2021-01-14 04:23:19 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
get reason()
|
|
|
|
{
|
2021-01-15 00:50:23 +08:00
|
|
|
return this._reason.value;
|
2021-01-14 04:23:19 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
set reason(value)
|
|
|
|
{
|
2021-01-15 00:50:23 +08:00
|
|
|
this._reason.value = value;
|
|
|
|
}
|
|
|
|
|
|
|
|
pushArguments(args)
|
|
|
|
{
|
|
|
|
if (args[0] instanceof Grammar.StringType) {
|
|
|
|
this._reason = args[0];
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* https://tools.ietf.org/html/rfc5429#section-2.2
|
|
|
|
*/
|
|
|
|
class Reject extends Grammar.Command
|
|
|
|
{
|
|
|
|
constructor()
|
|
|
|
{
|
|
|
|
super('reject');
|
|
|
|
this._reason = new Grammar.QuotedString;
|
2021-01-14 04:23:19 +08:00
|
|
|
}
|
2021-01-15 00:50:23 +08:00
|
|
|
|
2021-01-15 07:14:45 +08:00
|
|
|
get require() { return 'reject'; }
|
|
|
|
|
2021-01-15 00:50:23 +08:00
|
|
|
toString()
|
|
|
|
{
|
|
|
|
return 'reject ' + this._reason + ';';
|
|
|
|
}
|
|
|
|
|
|
|
|
get reason()
|
|
|
|
{
|
|
|
|
return this._reason.value;
|
|
|
|
}
|
|
|
|
|
|
|
|
set reason(value)
|
|
|
|
{
|
|
|
|
this._reason.value = value;
|
|
|
|
}
|
|
|
|
|
|
|
|
pushArguments(args)
|
|
|
|
{
|
|
|
|
if (args[0] instanceof Grammar.StringType) {
|
|
|
|
this._reason = args[0];
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2021-01-15 06:42:46 +08:00
|
|
|
Sieve.Commands.ereject = Ereject;
|
|
|
|
Sieve.Commands.reject = Reject;
|
2021-01-14 04:23:19 +08:00
|
|
|
|
|
|
|
})(this.Sieve);
|