PHPackages                             henrique-borba/php-sieve-manager - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Mail &amp; Notifications](/categories/mail)
4. /
5. henrique-borba/php-sieve-manager

ActiveLibrary[Mail &amp; Notifications](/categories/mail)

henrique-borba/php-sieve-manager
================================

A modern (started in 2022) PHP library for the ManageSieve protocol (RFC5804) to create/edit Sieve scripts (RFC5228). Used by Cypht Webmail.

v1.0.10(1y ago)23125.7k—0.6%4[1 issues](https://github.com/cypht-org/php-sieve-manager/issues)1MITPHPPHP &gt;=5.4

Since Jul 11Pushed 1y ago3 watchersCompare

[ Source](https://github.com/cypht-org/php-sieve-manager)[ Packagist](https://packagist.org/packages/henrique-borba/php-sieve-manager)[ Docs](https://github.com/cypht-org/php-sieve-manager)[ RSS](/packages/henrique-borba-php-sieve-manager/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (9)DependenciesVersions (12)Used By (1)

php-sieve-manager
=================

[](#php-sieve-manager)

A modern (started in 2022) PHP library for the ManageSieve protocol (RFC5804) to create/edit Sieve scripts (RFC5228). Used by [Cypht Webmail](https://github.com/cypht-org/cypht) and available to all PHP projects via

[Tiki Wiki CMS Groupware bundles Cypht webmail](https://doc.tiki.org/Cypht) and [extends filters beyond what is possible via the Sieve protocol](https://doc.tiki.org/Email-filters).

[Compare php-sieve-manager to other options](https://github.com/cypht-org/php-sieve-manager/wiki/Comparison-of-Sieve-libs-in-PHP)

How to use
==========

[](#how-to-use)

### Connect to ManageSieve

[](#connect-to-managesieve)

```
require_once "vendor/autoload.php";

$client = new \PhpSieveManager\ManageSieve\Client("localhost", 4190);
$client->connect("test@localhost", "mypass", false, "", "PLAIN");

$client->listScripts();
```

### Generate Sieve script

[](#generate-sieve-script)

```
$filter = \PhpSieveManager\Filters\FilterFactory::create('MaxFileSize');

$criteria = \PhpSieveManager\Filters\FilterCriteria::if('body')->contains('"test"');

// Messages bigger than 2MB will be rejected with an error message
$size_condition = new \PhpSieveManager\Filters\Condition(
    "Messages bigger than 2MB will be rejected with an error message", $criteria
);

$size_condition->addCriteria($criteria);
$size_condition->addAction(
     new \PhpSieveManager\Filters\Actions\DiscardFilterAction()
);

// Add the condition to the Filter
$filter->setCondition($size_condition);
$filter->toScript();
```

Actions
-------

[](#actions)

[\[RFC5293\]](https://www.rfc-editor.org/rfc/rfc5293.html)

```
addheader [":last"]

```

[\[RFC5293\]](https://www.rfc-editor.org/rfc/rfc5293.html)

```
deleteheader [":index"  [":last"]]
    [COMPARATOR] [MATCH-TYPE]

    []

```

[\[RFC8580\]](https://www.rfc-editor.org/rfc/rfc8580.html) [\[RFC5435\]](https://www.rfc-editor.org/rfc/rfc5434.html)

```
notify [":from" string]
    [":importance" ]
    [":options" string-list]
    [":message" string]
    [:fcc "INBOX.Sent"]

```

[\[RFC5230\]](https://www.rfc-editor.org/rfc/rfc5230.html) [\[RFC6131\]](https://www.rfc-editor.org/rfc/rfc6131.html) [\[RFC8580\]](https://www.rfc-editor.org/rfc/rfc8580.html)

```
vacation [[":days" number] | [":seconds"]]
    [":subject" string]
    [":from" string]
    [":addresses" string-list]
    [":mime"]
    [":handle" string]

```

[\[RFC5232\]](https://www.rfc-editor.org/rfc/rfc5232.html)

```
setflag []

```

[\[RFC5232\]](https://www.rfc-editor.org/rfc/rfc5232.html)

```
addflag []

```

[\[RFC5232\]](https://www.rfc-editor.org/rfc/rfc5232.html)

```
removeflag []

```

[\[RFC5703\]](https://www.rfc-editor.org/rfc/rfc5703.html)

```
replace [":mime"]
    [":subject" string]
    [":from" string]

```

[\[RFC5703\]](https://www.rfc-editor.org/rfc/rfc5703.html)

```
enclose

    string

```

[\[RFC5229\]](https://www.rfc-editor.org/rfc/rfc5229.html)

```
extracttext [MODIFIER]
    [":first" number]

```

[\[RFC6558\]](https://www.rfc-editor.org/rfc/rfc6558.html)

```
convert

```

[\[RFC5229\]](https://www.rfc-editor.org/rfc/rfc5232.html)

```
set [MODIFIER]

Modifiers:  ":lower" / ":upper" / ":lowerfirst" / ":upperfirst" /
           ":quotewildcard" / ":length"

```

[\[RFC5232\]](https://www.rfc-editor.org/rfc/rfc5232.html) [\[RFC3894\]](https://www.rfc-editor.org/rfc/rfc3894.html) [\[RFC5228\]](https://www.rfc-editor.org/rfc/rfc5228.html) [\[RFC5490\]](https://www.rfc-editor.org/rfc/rfc5490.html) [\[RFC9042\]](https://www.rfc-editor.org/rfc/rfc9042.html) [\[RFC8579\]](https://www.rfc-editor.org/rfc/rfc8579.html)

```
fileinto [:mailboxid ] [:specialuse ] [:create] [":copy"] [":flags" ]

```

[\[RFC5228\]](https://www.rfc-editor.org/rfc/rfc5232.html) [\[RFC3894\]](https://www.rfc-editor.org/rfc/rfc3894.html) [\[RFC6009\]](https://www.rfc-editor.org/rfc/rfc6009.html)

```
redirect [":copy"] [:notify "value"] [:ret "FULL"|"HDRS"] [":copy"]

```

[\[RFC5228\]](https://www.rfc-editor.org/rfc/rfc5232.html) [\[RFC5232\]](https://www.rfc-editor.org/rfc/rfc5232.html)

```
keep [":flags" ]

```

[\[RFC5228\]](https://www.rfc-editor.org/rfc/rfc5232.html)

```
discard

```

[\[RFC5429\]](https://www.rfc-editor.org/rfc/rfc5429.html)

```
reject

```

[\[RFC5429\]](https://www.rfc-editor.org/rfc/rfc5429.html)

```
ereject

```

###  Health Score

41

—

FairBetter than 89% of packages

Maintenance45

Moderate activity, may be stable

Popularity43

Moderate usage in the ecosystem

Community21

Small or concentrated contributor base

Maturity45

Maturing project, gaining track record

 Bus Factor2

2 contributors hold 50%+ of commits

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~62 days

Recently: every ~70 days

Total

11

Last Release

419d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/71781461232111b15968d3047f122772e0945c319e9ee9784871aca0948730ff?d=identicon)[henrique-borba](/maintainers/henrique-borba)

---

Top Contributors

[![henrique-borba](https://avatars.githubusercontent.com/u/1107499?v=4)](https://github.com/henrique-borba "henrique-borba (36 commits)")[![josaphatim](https://avatars.githubusercontent.com/u/80334370?v=4)](https://github.com/josaphatim "josaphatim (18 commits)")[![marclaporte](https://avatars.githubusercontent.com/u/1004261?v=4)](https://github.com/marclaporte "marclaporte (17 commits)")[![kroky](https://avatars.githubusercontent.com/u/2064350?v=4)](https://github.com/kroky "kroky (15 commits)")[![Shadow243](https://avatars.githubusercontent.com/u/28566468?v=4)](https://github.com/Shadow243 "Shadow243 (3 commits)")[![bienvenuushindi](https://avatars.githubusercontent.com/u/26736582?v=4)](https://github.com/bienvenuushindi "bienvenuushindi (2 commits)")[![wojt-janowski](https://avatars.githubusercontent.com/u/209190810?v=4)](https://github.com/wojt-janowski "wojt-janowski (1 commits)")

---

Tags

emailfilterimapmanagesievephprfc5228rfc5804sievesieve-librarysieve-parsingphpmailemailfiltersimapsievemanagesievecyphtRFC5228RFC5804

### Embed Badge

![Health badge](/badges/henrique-borba-php-sieve-manager/health.svg)

```
[![Health](https://phpackages.com/badges/henrique-borba-php-sieve-manager/health.svg)](https://phpackages.com/packages/henrique-borba-php-sieve-manager)
```

###  Alternatives

[jason-munro/cypht

Lightweight Open Source webmail written in PHP and JavaScript

1.5k146.0k](/packages/jason-munro-cypht)[php-imap/php-imap

Manage mailboxes, filter/get/delete emails in PHP (supports IMAP/POP3/NNTP)

1.7k12.9M42](/packages/php-imap-php-imap)[ddeboer/imap

Object-oriented IMAP for PHP

9153.9M11](/packages/ddeboer-imap)[opcodesio/mail-parser

Parse emails without the mailparse extension

226.8M8](/packages/opcodesio-mail-parser)[railsware/mailtrap-php

The Mailtrap SDK provides methods for all API functions.

56770.5k](/packages/railsware-mailtrap-php)[benhall14/php-imap-reader

A PHP class that makes working with IMAP in PHP simple.

3516.6k](/packages/benhall14-php-imap-reader)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
