python-managesieve is a Python module implementing the ManageSieve client protocol. It also includes an user application (the interactive sieveshell).
Find more info here:
The ManageSieve protocol allows managing Sieve scripts on a remote mail server. Sieve scripts allow users to filter incoming email on the 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 the ManageSieve Internet draft.
This module allows accessing a Sieve-Server for managing Sieve scripts there. It is accompanied by a simple yet functional user application 'sieveshell'.
sieveshell is a command line tool for talking to the Sieve server. One can
sieveshell is useful for user who wish to manage sieve scripts without installing a fat GUI-based mail client.
The source of managesieve is now maintained at gitorious.org
git clone git://gitorious.org/managesieve/managesieve.git