Skip to content

Commit 287da00

Browse files
updated setup.py and readme
1 parent fa022e7 commit 287da00

5 files changed

Lines changed: 96 additions & 103 deletions

File tree

MANIFEST.in

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
11
include LICENSE.txt
22
include MANIFEST.in
33
include README.rst
4-
include requirements.txt

README.md

Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
# Sifter3 - Sieve email filter (RFC 5228)
2+
3+
Sifter3 is a Python 3 implementation of the Sieve email filter language (RFC 5228) and is based on the Python 2 version from <https://github.com/garyp/sifter>
4+
5+
![Python package](https://github.com/manfred-kaiser/sifter3/workflows/Python%20package/badge.svg)
6+
[![Documentation Status](https://readthedocs.org/projects/sifter3/badge/?version=master)](https://sifter3.readthedocs.io/de/master/?badge=master)
7+
[![CodeFactor](https://www.codefactor.io/repository/github/manfred-kaiser/sifter3/badge)](https://www.codefactor.io/repository/github/manfred-kaiser/sifter3)
8+
[![Github version](https://img.shields.io/github/v/release/manfred-kaiser/sifter3?label=github&logo=github)](https://github.com/manfred-kaiser/sifter3/releases)
9+
[![PyPI version](https://img.shields.io/pypi/v/sifter3.svg?logo=pypi&logoColor=FFE873)](https://pypi.org/project/sifter3/)
10+
[![Supported Python versions](https://img.shields.io/pypi/pyversions/sifter3.svg?logo=python&logoColor=FFE873)](https://pypi.org/project/sifter3/)
11+
[![PyPI downloads](https://pepy.tech/badge/sifter3/month)](https://pepy.tech/project/sifter3/month)
12+
[![GitHub](https://img.shields.io/github/license/manfred-kaiser/sifter3.svg)](LICENSE)
13+
14+
15+
16+
FEATURES
17+
========
18+
19+
- Supports all of the base Sieve spec from RFC 5228, except for
20+
features still listed under TODO below
21+
- Extensions supported:
22+
- regex (draft-ietf-sieve-regex-01)
23+
24+
EXAMPLE
25+
=======
26+
27+
import email
28+
import sifter.parser
29+
rules = sifter.parser.parse_file(open('my_rules.sieve'))
30+
msg = email.message_from_file(open('an_email_to_me.eml'))
31+
msg_actions = rules.evaluate(msg)
32+
33+
In the above example, `msg_actions` is a list of actions to apply to the
34+
email message. Each action is a tuple consisting of the action name and
35+
action-specific arguments. It is up to the caller to manipulate the
36+
message and message store based on the actions returned.
37+
38+
WARNINGS
39+
========
40+
41+
- No thought has been given yet to hardening against malicious user
42+
input. The current implementation is aimed at users that are running
43+
their own sieve scripts.
44+
- The current implementation is not optimized for performance, though
45+
hopefully it's not too slow for normal inputs.
46+
47+
TODO
48+
====
49+
50+
In rough order of importance:
51+
52+
- An example adaptor that provides Unix LDA behavior using sieve for
53+
filtering
54+
- Base spec features not yet implemented:
55+
- encoded characters (section 2.4.2.4)
56+
- multi-line strings (section 2.4.2)
57+
- bracketed comments (section 2.3)
58+
- message uniqueness (section 2.10.3)
59+
- envelope test (section 5.4)
60+
- handle message loops (section 10)
61+
- limit abuse of redirect action (section 10)
62+
- address test should limit allowed headers to those that contain
63+
addresses (section 5.1)
64+
- Make sure character sets are actually handled according to the spec
65+
- Make string parsing comply with the grammar in section 8.1 and the
66+
features described in section 2.4.2
67+
- Check that python's `email.message` implements header comparisons
68+
the same way as the sieve spec
69+
- Make sure regular expressions are actually handled according to the
70+
extension spec
71+
- Add support for various extensions:
72+
- variables (RFC 5229)
73+
- externally stored lists (draft-melnikov-sieve-external-lists)
74+
- body (RFC 5173)
75+
- relational (RFC 5231)
76+
- subaddress (RFC 5233)
77+
- copy (RFC 3894)
78+
- environment (RFC 5183)
79+
- date and index (RFC 5260)
80+
- editheader (RFC 5293)
81+
- ihave (RFC 5463)
82+
- mailbox metadata (RFC 5490)
83+
- notifications (RFC 5435), mailto notifications (RFC 5436), xmpp
84+
notifications (RFC 5437)

README.rst

Lines changed: 0 additions & 90 deletions
This file was deleted.

requirements.txt

Lines changed: 0 additions & 1 deletion
This file was deleted.

setup.py

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -5,27 +5,28 @@
55
# read the contents of your README file
66
from os import path
77
this_directory = path.abspath(path.dirname(__file__))
8-
with open(path.join(this_directory, 'README.rst'), encoding='utf-8') as f:
8+
with open(path.join(this_directory, 'README.md'), encoding='utf-8') as f:
99
long_description = f.read()
1010

11-
with open('requirements.txt') as f:
12-
requirements = f.read().splitlines()
13-
1411
setup(
15-
name="sifter",
12+
name="sifter3",
1613
version="0.2.0",
17-
author="Gary Peck, Manfred Kaiser",
18-
author_email="gary@realify.com, manfred.kaiser@logfile.at",
14+
author="Manfred Kaiser, Gary Peck",
15+
author_email="manfred.kaiser@logfile.at, gary@realify.com",
1916
url="https://github.com/garyp/sifter",
2017
license="BSD",
18+
description='Parser/evaluator for the Sieve filtering language (RFC 5228) - Python3 version',
2119
long_description=long_description,
22-
long_description_content_type='text/x-rst',
20+
long_description_content_type='text/markdown',
21+
keywords="sieve email filter parser",
2322
project_urls={
24-
'Source': 'https://github.com/garyp/sifter',
25-
'Tracker': 'https://github.com/garyp/sifter/issues',
23+
'Source': 'https://github.com/manfred-kaiser/sifter3',
24+
'Tracker': 'https://github.com/manfred-kaiser/sifter3/issues',
2625
},
2726
python_requires='>= 3.6',
28-
install_requires=requirements,
27+
install_requires=[
28+
'ply'
29+
],
2930
classifiers=[
3031
"Programming Language :: Python",
3132
"Programming Language :: Python :: 3",

0 commit comments

Comments
 (0)