-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implement RFC 8580: Sieve Extension: File Carbon Copy (FCC)
Fixes #60.
- Loading branch information
Showing
5 changed files
with
78 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
import unittest | ||
import checksieve | ||
|
||
class TestExamples(unittest.TestCase): | ||
|
||
def test_example_1(self): | ||
sieve = ''' | ||
require ["vacation", "fcc", "mailbox", "imap4flags"]; | ||
vacation :days 7 | ||
:from "[email protected]" "Gone Fishin'" | ||
:fcc "INBOX.Sent"; | ||
''' | ||
self.assertFalse(checksieve.parse_string(sieve, False)) | ||
|
||
def test_example_2(self): | ||
sieve = ''' | ||
require ["enotify", "fcc"]; | ||
notify :fcc "INBOX.Sent" | ||
:message "You got mail!" | ||
"mailto:[email protected]"; | ||
''' | ||
self.assertFalse(checksieve.parse_string(sieve, False)) | ||
|
||
def test_example_3(self): | ||
sieve = ''' | ||
require ["enotify", "fcc"]; | ||
if notify_method_capability "xmpp:" "fcc" "yes" { | ||
notify :fcc "INBOX.Sent" | ||
:message "You got mail" | ||
"xmpp:[email protected]?message;subject=SIEVE"; | ||
} else { | ||
notify :fcc "INBOX.Sent" | ||
:message "You got mail!" | ||
"mailto:[email protected]"; | ||
} | ||
''' | ||
self.assertFalse(checksieve.parse_string(sieve, False)) | ||
|
||
def test_no_reject(self): | ||
sieve = ''' | ||
require ["reject", "fcc"]; | ||
if size :over 100K { | ||
reject :fcc "foo" text: | ||
Your message is too big. If you want to send me a big attachment, | ||
put it on a public web site and send me a URL. | ||
. | ||
; | ||
} | ||
''' | ||
self.assertTrue(checksieve.parse_string(sieve, True)) |