mirror of
https://github.com/the-djmaze/snappymail.git
synced 2024-12-31 03:52:01 +08: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];
|
||||
}
|
||||
}
|
||||
}
|
|
@ -68,22 +68,10 @@ import {
|
|||
import { SpamTestTest, VirusTestTest } from 'Sieve/Extensions/rfc5235';
|
||||
import { DateTest, CurrentDateTest } from 'Sieve/Extensions/rfc5260';
|
||||
import { AddHeaderCommand, DeleteHeaderCommand } from 'Sieve/Extensions/rfc5293';
|
||||
|
||||
import {
|
||||
ErejectCommand,
|
||||
RejectCommand
|
||||
} from 'Sieve/Extensions/rfc5429';
|
||||
|
||||
import {
|
||||
MailboxExistsTest,
|
||||
MetadataTest,
|
||||
MetadataExistsTest
|
||||
} from 'Sieve/Extensions/rfc5490';
|
||||
|
||||
import {
|
||||
IncludeCommand,
|
||||
ReturnCommand
|
||||
} from 'Sieve/Extensions/rfc6609';
|
||||
import { ErejectCommand, RejectCommand } from 'Sieve/Extensions/rfc5429';
|
||||
import { IHaveTest, ErrorCommand } from 'Sieve/Extensions/rfc5463';
|
||||
import { MailboxExistsTest, MetadataTest, MetadataExistsTest } from 'Sieve/Extensions/rfc5490';
|
||||
import { IncludeCommand, ReturnCommand } from 'Sieve/Extensions/rfc6609';
|
||||
|
||||
const
|
||||
AllCommands = {
|
||||
|
@ -136,6 +124,9 @@ const
|
|||
// rfc5429
|
||||
ereject: ErejectCommand,
|
||||
reject: RejectCommand,
|
||||
// rfc5463
|
||||
ihave: IHaveTest,
|
||||
error: ErrorCommand,
|
||||
// rfc5490
|
||||
mailboxexists: MailboxExistsTest,
|
||||
metadata: MetadataTest,
|
||||
|
|
|
@ -17,7 +17,7 @@ https://www.iana.org/assignments/sieve-extensions/sieve-extensions.xhtml
|
|||
- [x] RFC5293 editheader
|
||||
- [x] RFC5429 ereject / reject
|
||||
- [ ] RFC5435 enotify
|
||||
- [ ] RFC5463 ihave
|
||||
- [x] RFC5463 ihave
|
||||
- [x] RFC5490 mailbox / mboxmetadata / servermetadata
|
||||
- [ ] RFC5703 enclose / extracttext / foreverypart / mime / replace
|
||||
- [ ] RFC6131 vacation-seconds
|
||||
|
|
Loading…
Reference in a new issue