Server IP : 85.214.239.14 / Your IP : 3.144.42.61 Web Server : Apache/2.4.62 (Debian) System : Linux h2886529.stratoserver.net 4.9.0 #1 SMP Tue Jan 9 19:45:01 MSK 2024 x86_64 User : www-data ( 33) PHP Version : 7.4.18 Disable Function : pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,pcntl_unshare, MySQL : OFF | cURL : OFF | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : OFF Directory : /srv/modoboa/env/lib64/python3.5/site-packages/sievelib-1.1.1.dist-info/ |
Upload File : |
Metadata-Version: 2.0 Name: sievelib Version: 1.1.1 Summary: Client-side SIEVE library Home-page: https://github.com/tonioo/sievelib Author: Antoine Nguyen Author-email: tonio@ngyn.org License: MIT Description-Content-Type: UNKNOWN Keywords: sieve,managesieve,parser,client Platform: UNKNOWN Classifier: Programming Language :: Python Classifier: Development Status :: 4 - Beta Classifier: Intended Audience :: Developers Classifier: License :: OSI Approved :: MIT License Classifier: Operating System :: OS Independent Classifier: Topic :: Software Development :: Libraries :: Python Modules Classifier: Topic :: Communications :: Email :: Filters Requires-Dist: future Requires-Dist: six sievelib ======== |travis| |codecov| |latest-version| Client-side Sieve and Managesieve library written in Python. * Sieve : An Email Filtering Language (`RFC 5228 <http://tools.ietf.org/html/rfc5228>`_) * ManageSieve : A Protocol for Remotely Managing Sieve Scripts (`RFC 5804 <http://tools.ietf.org/html/rfc5804>`_) Installation ------------ To install ``sievelib`` from PyPI:: pip install sievelib To install sievelib from git:: git clone git@github.com:tonioo/sievelib.git cd sievelib python ./setup.py install Sieve tools ----------- What is supported ^^^^^^^^^^^^^^^^^ Currently, the provided parser supports most of the functionalities described in the RFC. The only exception concerns section *2.4.2.4. Encoding Characters Using "encoded-character"* which is not supported. The following extensions are also supported: * Copying Without Side Effects (`RFC 3894 <https://tools.ietf.org/html/rfc3894>`_) * Date and Index (`RFC 5260 <https://tools.ietf.org/html/rfc5260>`_) * Vacation (`RFC 5230 <http://tools.ietf.org/html/rfc5230>`_) Extending the parser ^^^^^^^^^^^^^^^^^^^^ It is possible to extend the parser by adding new supported commands. For example:: import sievelib class MyCommand(sievelib.commands.ActionCommand): args_definition = [ {"name": "testtag", "type": ["tag"], "write_tag": True, "values": [":testtag"], "extra_arg": {"type": "number", "required": False}, "required": False}, {"name": "recipients", "type": ["string", "stringlist"], "required": True} ] sievelib.commands.add_commands(MyCommand) Basic usage ^^^^^^^^^^^ The parser can either be used from the command-line:: $ cd sievelib $ python parser.py test.sieve Syntax OK $ Or can be used from a python environment (or script/module):: >>> from sievelib.parser import Parser >>> p = Parser() >>> p.parse('require ["fileinto"];') True >>> p.dump() require (type: control) ["fileinto"] >>> >>> p.parse('require ["fileinto"]') False >>> p.error 'line 1: parsing error: end of script reached while semicolon expected' >>> Simple filters creation ^^^^^^^^^^^^^^^^^^^^^^^ Some high-level classes are provided with the ``factory`` module, they make the generation of Sieve rules easier:: >>> from sievelib.factory import FiltersSet >>> fs = FiltersSet("test") >>> fs.addfilter("rule1", ... [("Sender", ":is", "toto@toto.com"),], ... [("fileinto", "Toto"),]) >>> fs.tosieve() require ["fileinto"]; # Filter: rule1 if anyof (header :is "Sender" "toto@toto.com") { fileinto "Toto"; } >>> Additional documentation is available within source code. ManageSieve tools ----------------- What is supported ^^^^^^^^^^^^^^^^^ All mandatory commands are supported. The ``RENAME`` extension is supported, with a simulated behaviour for server that do not support it. For the ``AUTHENTICATE`` command, supported mechanisms are ``DIGEST-MD5``, ``PLAIN`` and ``LOGIN``. Basic usage ^^^^^^^^^^^ The ManageSieve client is intended to be used from another python application (there isn't any shell provided):: >>> from sievelib.managesieve import Client >>> c = Client("server.example.com") >>> c.connect("user", "password", starttls=False, authmech="DIGEST-MD5") True >>> c.listscripts() ("active_script", ["script1", "script2"]) >>> c.setactive("script1") True >>> c.havespace("script3", 45) True >>> Additional documentation is available with source code. .. |latest-version| image:: https://badge.fury.io/py/sievelib.svg :target: https://badge.fury.io/py/sievelib .. |travis| image:: https://travis-ci.org/tonioo/sievelib.png?branch=master :target: https://travis-ci.org/tonioo/sievelib .. |codecov| image:: http://codecov.io/github/tonioo/sievelib/coverage.svg?branch=master :target: http://codecov.io/github/tonioo/sievelib?branch=master