libsieve-php is a library for managing and modifying Sieve (RFC3028) scripts. It contains a parser for the Sieve language (and some extensions).