Skip to content

Commit 53dc873

Browse files
Merge branch 'develop'
2 parents 6d95ba9 + 098712d commit 53dc873

File tree

4 files changed

+143
-8
lines changed

4 files changed

+143
-8
lines changed

README.md

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,16 @@ FEATURES
2020
features still listed under TODO below
2121
- Extensions supported:
2222
- regex (draft-ietf-sieve-regex-01)
23+
- body (RFC 5173)
24+
- variables (RFC 5229)
25+
- enotify (RFC 5435, particularly the mailto method RFC 5436)
26+
- imap4flags (RFC 5232: setflag, addflag, removeflag; not supported: hasflags, :flags)
27+
- compatible with the python 2 version from https://github.com/garyp/sifter
28+
29+
INSTALL
30+
=======
31+
32+
pip install sifter3
2333

2434
EXAMPLE
2535
=======
@@ -47,8 +57,6 @@ WARNINGS
4757
TODO
4858
====
4959

50-
In rough order of importance:
51-
5260
- An example adaptor that provides Unix LDA behavior using sieve for
5361
filtering
5462
- Base spec features not yet implemented:
@@ -69,9 +77,7 @@ In rough order of importance:
6977
- Make sure regular expressions are actually handled according to the
7078
extension spec
7179
- Add support for various extensions:
72-
- variables (RFC 5229)
7380
- externally stored lists (draft-melnikov-sieve-external-lists)
74-
- body (RFC 5173)
7581
- relational (RFC 5231)
7682
- subaddress (RFC 5233)
7783
- copy (RFC 3894)
@@ -80,5 +86,4 @@ In rough order of importance:
8086
- editheader (RFC 5293)
8187
- ihave (RFC 5463)
8288
- mailbox metadata (RFC 5490)
83-
- notifications (RFC 5435), mailto notifications (RFC 5436), xmpp
84-
notifications (RFC 5437)
89+
- xmpp notifications (RFC 5437)

docs/conf.py

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
# Configuration file for the Sphinx documentation builder.
2+
#
3+
# This file only contains a selection of the most common options. For a full
4+
# list see the documentation:
5+
# https://www.sphinx-doc.org/en/master/usage/configuration.html
6+
7+
# -- Path setup --------------------------------------------------------------
8+
9+
# If extensions (or modules to document with autodoc) are in another directory,
10+
# add these directories to sys.path here. If the directory is relative to the
11+
# documentation root, use os.path.abspath to make it absolute, like shown here.
12+
#
13+
# import os
14+
# import sys
15+
# sys.path.insert(0, os.path.abspath('.'))
16+
17+
18+
# -- Project information -----------------------------------------------------
19+
20+
project = 'Sifter3 - Sieve email filter'
21+
copyright = '2020, Manfred Kaiser' # pylint: disable=redefined-builtin
22+
author = 'Manfred Kaiser'
23+
24+
master_doc = 'index'
25+
26+
# -- General configuration ---------------------------------------------------
27+
28+
# Add any Sphinx extension module names here, as strings. They can be
29+
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
30+
# ones.
31+
extensions = [
32+
"sphinx_rtd_theme"
33+
]
34+
35+
# Add any paths that contain templates here, relative to this directory.
36+
templates_path = ['_templates']
37+
38+
# The language for content autogenerated by Sphinx. Refer to documentation
39+
# for a list of supported languages.
40+
#
41+
# This is also used if you do content translation via gettext catalogs.
42+
# Usually you set "language" from the command line for these cases.
43+
language = 'de'
44+
45+
# List of patterns, relative to source directory, that match files and
46+
# directories to ignore when looking for source files.
47+
# This pattern also affects html_static_path and html_extra_path.
48+
exclude_patterns = []
49+
50+
51+
# -- Options for HTML output -------------------------------------------------
52+
53+
# The theme to use for HTML and HTML Help pages. See the documentation for
54+
# a list of builtin themes.
55+
#
56+
html_theme = "sphinx_rtd_theme"
57+
58+
# Add any paths that contain custom static files (such as style sheets) here,
59+
# relative to this directory. They are copied after the builtin static files,
60+
# so a file named "default.css" will overwrite the builtin "default.css".
61+
html_static_path = ['_static']

docs/index.rst

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
Sifter3 - Sieve email filter (RFC 5228)
2+
=======================================
3+
4+
Sifter3 is a Python 3 implementation of the Sieve email filter language (RFC 5228)
5+
6+
7+
FEATURES
8+
--------
9+
10+
- Supports all of the base Sieve spec from RFC 5228, except for
11+
features still listed under TODO below
12+
- Extensions supported:
13+
14+
- regex (draft-ietf-sieve-regex-01)
15+
- body (RFC 5173)
16+
- variables (RFC 5229)
17+
- enotify (RFC 5435, particularly the mailto method RFC 5436)
18+
- imap4flags (RFC 5232: setflag, addflag, removeflag; not supported: hasflags, :flags)
19+
20+
- compatible with the Python 2 version from https://github.com/garyp/sifter
21+
22+
INSTALL
23+
-------
24+
25+
26+
.. code-block:: bash
27+
28+
pip install sifter3
29+
30+
31+
EXAMPLE
32+
-------
33+
34+
.. code-block:: python
35+
36+
import email
37+
import sifter.parser
38+
rules = sifter.parser.parse_file(open('my_rules.sieve'))
39+
msg = email.message_from_file(open('an_email_to_me.eml'))
40+
msg_actions = rules.evaluate(msg)
41+
42+
In the above example, ``msg_actions`` is a
43+
list of actions to apply to the email message. Each action is a tuple
44+
consisting of the action name and action-specific arguments. It is up to
45+
the caller to manipulate the message and message store based on the
46+
actions returned.
47+
48+
WARNINGS
49+
--------
50+
51+
- No thought has been given yet to hardening against malicious user
52+
input. The current implementation is aimed at users that are running
53+
their own sieve scripts.
54+
- The current implementation is not optimized for performance, though
55+
hopefully it's not too slow for normal inputs.
56+
57+
TODO
58+
----
59+
60+
- An example adaptor that provides Unix LDA behavior using sieve for
61+
filtering
62+
- Base spec features not yet implemented:
63+
- encoded characters (section 2.4.2.4)
64+
- multi-line strings (section 2.4.2)
65+
- bracketed comments (section 2.3)
66+
- message uniqueness (section 2.10.3)
67+
- envelope test (section 5.4)
68+
- handle message loops (section 10)
69+
- limit abuse of redirect action (section

setup.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,10 @@
1010

1111
setup(
1212
name="sifter3",
13-
version="0.2.0",
13+
version="0.2.1",
1414
author="Manfred Kaiser, Gary Peck",
1515
16-
url="https://github.com/garyp/sifter",
16+
url="https://sifter3.readthedocs.io/en/latest/",
1717
license="BSD",
1818
description='Parser/evaluator for the Sieve filtering language (RFC 5228) - Python3 version',
1919
long_description=long_description,

0 commit comments

Comments
 (0)