Sifter3 - Sieve email filter (RFC 5228)

Sifter3 is a Python 3 implementation of the Sieve email filter language (RFC 5228)

Python package Documentation Status CodeFactor Github version PyPI version Supported Python versions PyPI downloads GitHub

FEATURES

INSTALL

pip install sifter3

EXAMPLE

import email
import sifter.parser
rules = sifter.parser.parse_file(open('my_rules.sieve'))
msg = email.message_from_file(open('an_email_to_me.eml'))
msg_actions = rules.evaluate(msg)

In the above example, msg_actions is a list of actions to apply to the email message. Each action is a tuple consisting of the action name and action-specific arguments. It is up to the caller to manipulate the message and message store based on the actions returned.

COMMAND LINE

The output of the command line tool can be parsed as json.

$ sifter tests/evaluation_1.rules tests/evaluation_1.msg
[['redirect', 'acm@example.com']]

WARNINGS

TODO

COPYRIGHT