PHPackages                             crazy-max/cws-mail-bounce-handler - 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. crazy-max/cws-mail-bounce-handler

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

crazy-max/cws-mail-bounce-handler
=================================

PHP class to help webmasters handle bounce-back, feedback loop and ARF mails in standard DSN (Delivery Status Notification, RFC-1894).

1.14.2(6y ago)4215.4k↓12.5%19[2 issues](https://github.com/crazy-max/CwsMailBounceHandler/issues)MITPHPPHP &gt;=5.4

Since Nov 17Pushed 6y ago10 watchersCompare

[ Source](https://github.com/crazy-max/CwsMailBounceHandler)[ Packagist](https://packagist.org/packages/crazy-max/cws-mail-bounce-handler)[ Docs](https://github.com/crazy-max/CwsMailBounceHandler)[ RSS](/packages/crazy-max-cws-mail-bounce-handler/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (10)Dependencies (1)Versions (11)Used By (0)

[![Latest Stable Version](https://camo.githubusercontent.com/3885d1b3059754c5d73313fb1d370a59434e3912af88659b10cf7aff2c59b759/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6372617a792d6d61782f6377732d6d61696c2d626f756e63652d68616e646c65722e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/crazy-max/cws-mail-bounce-handler)[![Minimum PHP Version](https://camo.githubusercontent.com/ed01d9ed58eeae6546ad914dfe36ffe4d8686fd4e56440892018169df0f3b5ec/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f7068702d253345253344253230352e332e322d3838393242462e7376673f7374796c653d666c61742d737175617265)](https://php.net/)[![Build Status](https://camo.githubusercontent.com/5004eca93c0f490b3d26798977b703144c172772952c7316b2de17615708cb20/68747470733a2f2f696d672e736869656c64732e696f2f7472617669732f636f6d2f6372617a792d6d61782f4377734d61696c426f756e636548616e646c65722f6d61737465722e7376673f7374796c653d666c61742d737175617265)](https://travis-ci.com/crazy-max/CwsMailBounceHandler)[![Code Quality](https://camo.githubusercontent.com/76488644d7f192644e6688a783a674ca6a344b691435d45602939c9253633e95/68747470733a2f2f696d672e736869656c64732e696f2f636f646163792f67726164652f38663766666536313537303634383437386564616262643737646361643634342e7376673f7374796c653d666c61742d737175617265)](https://www.codacy.com/app/crazy-max/CwsMailBounceHandler)[![Become a sponsor](https://camo.githubusercontent.com/2b64183536d3742cfdfdbe2a16c7a26ae05e6a3db44e513ff73defdeed344cc1/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f73706f6e736f722d6372617a792d2d6d61782d3138313731372e7376673f6c6f676f3d676974687562267374796c653d666c61742d737175617265)](https://github.com/sponsors/crazy-max)[![Donate Paypal](https://camo.githubusercontent.com/86518966c73798ed1c862566d92cd4cdd48152e30ab7f42fb7d5138138231d0d/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f646f6e6174652d70617970616c2d3030343537632e7376673f6c6f676f3d70617970616c267374796c653d666c61742d737175617265)](https://www.paypal.me/crazyws)

⚠️ Abandoned project
--------------------

[](#warning-abandoned-project)

This project is not maintained anymore and is abandoned. Feel free to fork and make your own changes if needed.

Thanks to everyone for their valuable feedback and contributions.

About
-----

[](#about)

📬 PHP class to help webmasters handle bounce-back, feedback loop and ARF mails in standard DSN (Delivery Status Notification, RFC-1894). It checks your IMAP inbox or eml files and delete or move all bounced emails. If a bounce is malformed, it tries to extract some useful information to parse status.

Requirements
------------

[](#requirements)

- PHP &gt;= 5.4
- Enable the [php\_imap](http://php.net/manual/en/book.imap.php) extension if you want to use the IMAP open mode.

Installation
------------

[](#installation)

```
composer require crazy-max/cws-mail-bounce-handler
```

And download the code:

```
composer install # or update
```

Getting started
---------------

[](#getting-started)

See `tests/test.php` file sample to help you.
You can use the eml files in the `tests/emls` folder for testing.

Post-process
------------

[](#post-process)

A result object `Cws\MailBounceHandler\Models\Result` is available to process custom post-actions :

[![](.res/example.png)](.res/example.png)

Methods
-------

[](#methods)

**openImapLocal** - Open a IMAP mail box in local file system.
**openImapRemote** - Open a remote IMAP mail box.
**openEmlFolder** - Open a folder containing eml files on your system.

**processMails** - Process the messages in a mailbox or a folder.

**getStatusCodeExplanations** -Get explanations from DSN status code via the RFC 1893.

**isMailboxOpenMode** - Check if open mode is mailbox.
**isFileOpenMode** - Check if open mode is file.
**isNeutralProcessMode** - Check if process mode is neutral mode.
**isMoveProcessMode** - Check if process mode is move mode.
**isDeleteProcessMode** - Check if process mode is delete mode.
**getProcessMode** - The method to process bounces.
**setNeutralProcessMode** - Set the method to process bounces to neutral. (default)
**setMoveProcessMode** - Set the method to process bounces to move.
**setDeleteProcessMode** - Set the method to process bounces to delete.
**setProcessMode** - Set the method to process bounces.
**getMailboxService** - Mailbox service.
**setImapMailboxService** - Set the mailbox service to IMAP. (default)
**setMailboxService** - Set the mailbox service.
**getMailboxHost** - Mailbox host server.
**setMailboxHost** - Set the mailbox host server. (default localhost)
**getMailboxUsername** - The username of mailbox.
**setMailboxUsername** - Set the username of mailbox.
**setMailboxPassword** - Set the password needed to access mailbox.
**getMailboxPort** - The mailbox server port number.
**setMailboxPortPop3** - Set the mailbox server port number to POP3 (110).
**setMailboxPortPop3TlsSsl** - Set the mailbox server port number to POP3 TLS/SSL (995).
**setMailboxPortImap** - Set the mailbox server port number to IMAP (143). (default)
**setMailboxPortImapTlsSsl** - Set the mailbox server port number to IMAP TLS/SSL (995).
**setMailboxPort** - Set the mailbox server port number.
**getMailboxSecurity** - The mailbox security option.
**setMailboxSecurity** - Set the mailbox security option. (default const MAILBOX\_SECURITY\_NOTLS)
**getMailboxCert** - Certificate validation.
**setMailboxCertValidate** - Set the certificate validation to VALIDATE.
**setMailboxCertNoValidate** - Set the certificate validation to NOVALIDATE. (default)
**setMailboxCert** - Set the certificate validation.
**getMailboxName** - Mailbox name.
**setMailboxName** - Set the mailbox name, other choices are (Tasks, Spam, Replies, etc...). (default INBOX)
**getMailboxHandler** - The resource handler for the opened mailbox (POP3/IMAP/NNTP/etc...).
**getMaxMessages** - Maximum limit messages processed in one batch.
**setMaxMessages** - Set the maximum limit messages processed in one batch (0 for unlimited).
**isPurge** - Check if purge unknown messages.
**setPurge** - Set the mailbox server port number.
**getError** - The last error message.

How can I help ?
----------------

[](#how-can-i-help-)

All kinds of contributions are welcome 🙌! The most basic way to show your support is to star 🌟 the project, or to raise issues 💬 You can also support this project by [**becoming a sponsor on GitHub**](https://github.com/sponsors/crazy-max) 👏 or by making a [Paypal donation](https://www.paypal.me/crazyws) to ensure this journey continues indefinitely! 🚀

Thanks again for your support, it is much appreciated! 🙏

License
-------

[](#license)

MIT. See `LICENSE` for more details.

###  Health Score

38

—

LowBetter than 84% of packages

Maintenance19

Infrequent updates — may be unmaintained

Popularity38

Limited adoption so far

Community18

Small or concentrated contributor base

Maturity64

Established project with proven stability

 Bus Factor1

Top contributor holds 58.5% of commits — single point of failure

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 ~159 days

Recently: every ~205 days

Total

10

Last Release

2388d ago

PHP version history (2 changes)1.8PHP &gt;=5.3.2

1.12PHP &gt;=5.4

### Community

Maintainers

![](https://www.gravatar.com/avatar/a2ac50dd173150fc9339728d7b2b1c872b6853111b20e4569844e215f644f632?d=identicon)[crazy-max](/maintainers/crazy-max)

---

Top Contributors

[![crazy-max](https://avatars.githubusercontent.com/u/1951866?v=4)](https://github.com/crazy-max "crazy-max (24 commits)")[![fpiccinali](https://avatars.githubusercontent.com/u/9351145?v=4)](https://github.com/fpiccinali "fpiccinali (12 commits)")[![ickbinhier](https://avatars.githubusercontent.com/u/2810904?v=4)](https://github.com/ickbinhier "ickbinhier (5 commits)")

---

Tags

arf-mailsbouncedelivery-status-notificationeml-filesfeedback-loopimapmailmailboxmailbox-servicephppop3webmasters-handle-bouncemaildsnbouncearf

### Embed Badge

![Health badge](/badges/crazy-max-cws-mail-bounce-handler/health.svg)

```
[![Health](https://phpackages.com/badges/crazy-max-cws-mail-bounce-handler/health.svg)](https://phpackages.com/packages/crazy-max-cws-mail-bounce-handler)
```

###  Alternatives

[zbateson/mail-mime-parser

MIME email message parser

53949.2M79](/packages/zbateson-mail-mime-parser)[galata90/php-mail-bounce-handler

PHP class to help webmasters handle bounce-back, feedback loop and ARF mails in standard DSN (Delivery Status Notification, RFC-1894).

122.4k](/packages/galata90-php-mail-bounce-handler)[zbateson/stream-decorators

PHP psr7 stream decorators for mime message part streams

4748.6M6](/packages/zbateson-stream-decorators)[voku/bounce-mail-handler

Bounce Mail Handler

49230.9k2](/packages/voku-bounce-mail-handler)[opcodesio/mail-parser

Parse emails without the mailparse extension

216.8M8](/packages/opcodesio-mail-parser)[bashkarev/email

Faster MIME Mail Parser could be used to parse emails in MIME format.

208.8k](/packages/bashkarev-email)

PHPackages © 2026

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