mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-09-02 14:07:04 +03:00
Added Sieve parser code in master
This commit is contained in:
parent
e90e8a55ce
commit
f4cd25f8ad
21 changed files with 2126 additions and 8 deletions
81
dev/Sieve/Extensions/rfc5429.js
Normal file
81
dev/Sieve/Extensions/rfc5429.js
Normal file
|
|
@ -0,0 +1,81 @@
|
|||
/**
|
||||
* https://tools.ietf.org/html/rfc5429
|
||||
*/
|
||||
|
||||
import {
|
||||
GrammarCommand,
|
||||
GrammarQuotedString,
|
||||
GrammarString
|
||||
} from 'Sieve/Grammar';
|
||||
|
||||
/**
|
||||
* https://tools.ietf.org/html/rfc5429#section-2.1
|
||||
*/
|
||||
export class ErejectCommand extends GrammarCommand
|
||||
{
|
||||
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 GrammarCommand
|
||||
{
|
||||
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];
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue