Skip to main content
Help us improve PyPI by participating in user testing. All experience levels needed!

ManageSieve client library for remotely managing Sieve scripts

Project description

Author: Hartmut Goebel <>
Version: 0.5
Copyright: GNU Public License v3 (GPLv3)

Sieve scripts allow users to filter incoming email on the mail server. The ManageSieve protocol allows managing Sieve scripts on a remote mail server. These servers are commonly sealed so users cannot log into them, yet users must be able to update their scripts on them. This is what for the “ManageSieve” protocol is. For more information about the ManageSieve protocol see RFC 5804.

This module allows accessing a Sieve-Server for managing Sieve scripts there. It is accompanied by a simple yet functional user application ‘sieveshell’.

Changes since 0.4.2

  • Changed default port for the MANAGESIEVE protocol to 4190 as proposed by RFC 5804. Thanks to Guido Berhoerster for submitting the patch.
  • Added option --port. Thanks to Damien Aumaitre for submitting the patch and to Guido Berhoerster for an enhancement.
  • Added option --verbose for controlling debug output in managesieve. May be given several times to increase verbosity.
  • Switched to Python standard logging system. This introduces a minor interface change: MANAGESIEVE.debug and global Debug are gone. See source for information about debugging log levels.

Changes since 0.4

  • fixed short read (thanks to paurkedal for submitting the patch)
  • Use ssl.wrap_socket() instead of deprecated socket.ssl(). Thanks to Guido Berhoerster for submitting the patch.

Requirements and Installation

managesieve requires

  • Python 2.x or higher (tested with 2.5 and 2.6, but other versions should work, too, Python 3.x is not supported),
  • logging when using Python < 2.3 (logging is already included in Python 2.3 and higher)
  • setuptools or distribute for installation (see below)
Hints for installing on Windows:

Following the links above you will find .msi and .exe-installers. Simply install them and continue with installing managesieve.

Hints for installing on GNU/Linux:

Most current GNU/Linux distributions provide packages for the requirements. Look for packages names like python-setuptools and python-logging. Simply install them and continue with installing managesieve.

Hint for installing on other platforms:

Many vendors provide Python. Please check your vendors software repository. Otherwise please download Python 2.6 (or any higer version from the 2.x series) from and follow the installation instructions there.

After installing Python, install setuptools. You may want to read More Hints on Installing setuptools first.

Installing managesieve

When you are reading this you most probably already downloaded and unpacked managesieve. Thus installing is as easy as running:

python ./ install

Otherwise you may install directly using setuptools/easy_install. If your system has network access installing managesieve is a breeze:

easy_install managesieve

Without network access download managesieve from and run:

easy_install managesieve-*.tar.gz

More Hints on Installing setuptools

managesieve uses setuptools for installation. Thus you need either

  • network access, so the install script will automatically download and install setuptools if they are not already installed


  • the correct version of setuptools preinstalled using the EasyInstall installation instructions. Those instructions also have tips for dealing with firewalls as well as how to manually download and install setuptools.

Custom Installation Locations

If you want to install the managesieve Python module and the sieveshell script at a custom location, you can use commands like this:

# install to /usr/local/lib/ and /usr/local/bin
python ./ install --prefix /usr/local

# install to your Home directory (~/bin and ~/lib/python)
python ./ install --home ~

Please mind: This effects also the installation of logging (and setuptools) if they are not already installed.

For more information please refer to the Custom Installation Locations Instructions before installing managesieve.

Not yet implemented

  • sieve-names are only quoted dump (put into quotes, but no escapes yet).


Based on from Ulrich Eck <> which is part of of ‘ImapClient’ (see, a Zope product.

Some ideas taken from imaplib written by Piers Lauder <> et al.

Thanks to Tomas ‘Skitta’ Lindroos, Lorenzo Boccaccia, Alain Spineux, darkness and Gregory Boyce for sending patches.

Project details

Release history Release notifications

This version
History Node


History Node


History Node


History Node


History Node


History Node


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Filename, size & hash SHA256 hash help File type Python version Upload date
managesieve-0.5.tar.bz2 (16.4 kB) Copy SHA256 hash SHA256 Source None Mar 24, 2013 (24.3 kB) Copy SHA256 hash SHA256 Source None Mar 24, 2013

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging CloudAMQP CloudAMQP RabbitMQ AWS AWS Cloud computing Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page