{"id":21735494,"url":"https://github.com/python-sifter/sifter3","last_synced_at":"2025-04-13T01:54:48.045Z","repository":{"id":62584622,"uuid":"298208585","full_name":"python-sifter/sifter3","owner":"python-sifter","description":"Sieve rule parser and evaluator implemented in pure Python (Python 3)","archived":false,"fork":false,"pushed_at":"2023-08-18T20:38:51.000Z","size":235,"stargazers_count":5,"open_issues_count":12,"forks_count":2,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-13T01:53:46.458Z","etag":null,"topics":["python","python3","sieve","sieve-email-filter","sieve-library"],"latest_commit_sha":null,"homepage":"https://sifter3.readthedocs.io/en/latest/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-2-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/python-sifter.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-09-24T07:57:33.000Z","updated_at":"2024-06-20T19:19:22.000Z","dependencies_parsed_at":"2022-11-03T22:15:41.399Z","dependency_job_id":null,"html_url":"https://github.com/python-sifter/sifter3","commit_stats":null,"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/python-sifter%2Fsifter3","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/python-sifter%2Fsifter3/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/python-sifter%2Fsifter3/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/python-sifter%2Fsifter3/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/python-sifter","download_url":"https://codeload.github.com/python-sifter/sifter3/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248654052,"owners_count":21140235,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["python","python3","sieve","sieve-email-filter","sieve-library"],"created_at":"2024-11-26T05:13:26.104Z","updated_at":"2025-04-13T01:54:48.023Z","avatar_url":"https://github.com/python-sifter.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Sifter3 - Sieve email filter (RFC 5228)\n\nSifter3 is a Python 3 implementation of the Sieve email filter language (RFC 5228)\n\n![Python package](https://github.com/python-sifter/sifter3/workflows/Python%20package/badge.svg)\n[![Documentation Status](https://readthedocs.org/projects/sifter3/badge/?version=latest)](https://sifter3.readthedocs.io/en/latest/?badge=latest)\n[![CodeFactor](https://www.codefactor.io/repository/github/python-sifter/sifter3/badge)](https://www.codefactor.io/repository/github/python-sifter/sifter3)\n[![Github version](https://img.shields.io/github/v/release/python-sifter/sifter3?label=github\u0026logo=github)](https://github.com/python-sifter/sifter3/releases)\n[![PyPI version](https://img.shields.io/pypi/v/sifter3.svg?logo=pypi\u0026logoColor=FFE873)](https://pypi.org/project/sifter3/)\n[![Supported Python versions](https://img.shields.io/pypi/pyversions/sifter3.svg?logo=python\u0026logoColor=FFE873)](https://pypi.org/project/sifter3/)\n[![PyPI downloads](https://pepy.tech/badge/sifter3/month)](https://pepy.tech/project/sifter3/month)\n[![GitHub](https://img.shields.io/github/license/python-sifter/sifter3.svg)](LICENSE)\n\n\n\nFEATURES\n========\n\n-   Supports all of the base Sieve spec from RFC 5228, except for\n    features still listed under TODO below\n    -   multiline strings (since version 0.2.2)\n    -   bracketed comments (since version 0.2.4)\n-   Extensions supported:\n    -   regex (draft-ietf-sieve-regex-01)\n    -   body (RFC 5173)\n    -   variables (RFC 5229)\n    -   enotify (RFC 5435, particularly the mailto method RFC 5436)\n    -   imap4flags (RFC 5232: setflag, addflag, removeflag; not supported: hasflags, :flags)\n    -   reject and ereject (RFC 5429)\n    -   ihave (RFC 5463)\n\n\nINSTALL\n=======\n\n    pip install sifter3\n\nEXAMPLE\n=======\n\n    import email\n    import sifter.parser\n    rules = sifter.parser.parse_file(open('my_rules.sieve'))\n    msg = email.message_from_file(open('an_email_to_me.eml'))\n    msg_actions = rules.evaluate(msg)\n\nIn the above example, `msg_actions` is a list of actions to apply to the\nemail message. Each action is a tuple consisting of the action name and\naction-specific arguments. It is up to the caller to manipulate the\nmessage and message store based on the actions returned.\n\nCOMMAND LINE\n============\n\nThe output of the command line tool can be parsed as json.\n\n    $ sifter tests/evaluation_1.rules tests/evaluation_1.msg\n    [['redirect', 'acm@example.com']]\n\n\nWARNINGS\n========\n\n-   No thought has been given yet to hardening against malicious user\n    input. The current implementation is aimed at users that are running\n    their own sieve scripts.\n-   The current implementation is not optimized for performance, though\n    hopefully it's not too slow for normal inputs.\n\nTODO\n====\n\n-   An example adaptor that provides Unix LDA behavior using sieve for\n    filtering\n-   Base spec features not yet implemented:\n    -   encoded characters (section 2.4.2.4)\n    -   message uniqueness (section 2.10.3)\n    -   envelope test (section 5.4)\n    -   handle message loops (section 10)\n    -   limit abuse of redirect action (section 10)\n    -   address test should limit allowed headers to those that contain\n        addresses (section 5.1)\n-   Make sure character sets are actually handled according to the spec\n-   Make string parsing comply with the grammar in section 8.1 and the\n    features described in section 2.4.2\n-   Check that python's `email.message` implements header comparisons\n    the same way as the sieve spec\n-   Make sure regular expressions are actually handled according to the\n    extension spec\n-   Add support for various extensions:\n    -   externally stored lists (draft-melnikov-sieve-external-lists)\n    -   relational (RFC 5231)\n    -   subaddress (RFC 5233)\n    -   copy (RFC 3894)\n    -   environment (RFC 5183)\n    -   date and index (RFC 5260)\n    -   editheader (RFC 5293)\n    -   mailbox metadata (RFC 5490)\n    -   xmpp notifications (RFC 5437)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpython-sifter%2Fsifter3","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpython-sifter%2Fsifter3","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpython-sifter%2Fsifter3/lists"}