mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-08-31 21:19:21 +03:00
Added Sieve extension rfc5463
This commit is contained in:
parent
c76823dc5f
commit
c01c02d723
3 changed files with 72 additions and 17 deletions
64
dev/Sieve/Extensions/rfc5463.js
Normal file
64
dev/Sieve/Extensions/rfc5463.js
Normal file
|
|
@ -0,0 +1,64 @@
|
|||
/**
|
||||
* https://tools.ietf.org/html/rfc5463
|
||||
*/
|
||||
|
||||
import {
|
||||
GrammarCommand,
|
||||
GrammarTest,
|
||||
GrammarString,
|
||||
GrammarStringList
|
||||
} from 'Sieve/Grammar';
|
||||
|
||||
/**
|
||||
* https://datatracker.ietf.org/doc/html/rfc5463#section-4
|
||||
*/
|
||||
export class IHaveTest extends GrammarTest
|
||||
{
|
||||
constructor()
|
||||
{
|
||||
super();
|
||||
this.capabilities = new GrammarStringList;
|
||||
}
|
||||
|
||||
get require() { return 'ihave'; }
|
||||
|
||||
toString()
|
||||
{
|
||||
return 'ihave ' + this.capabilities;
|
||||
}
|
||||
|
||||
pushArguments(args)
|
||||
{
|
||||
let l = args.length;
|
||||
if (args[l-1] instanceof GrammarString) {
|
||||
this.method = args[l-1];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* https://datatracker.ietf.org/doc/html/rfc5463#section-5
|
||||
*/
|
||||
export class ErrorCommand extends GrammarCommand
|
||||
{
|
||||
constructor()
|
||||
{
|
||||
super();
|
||||
this.message = new GrammarString;
|
||||
}
|
||||
|
||||
get require() { return 'ihave'; }
|
||||
|
||||
toString()
|
||||
{
|
||||
return 'error ' + this.message + ';';
|
||||
}
|
||||
|
||||
pushArguments(args)
|
||||
{
|
||||
let l = args.length;
|
||||
if (args[l-1] instanceof GrammarString) {
|
||||
this.method = args[l-1];
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue