PHPackages                             seracid/php-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. seracid/php-mail-bounce-handler

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

seracid/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).

1.20(8y ago)7812LGPLPHPPHP &gt;=5.4

Since Nov 17Pushed 8y ago4 watchersCompare

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

READMEChangelog (4)Dependencies (1)Versions (13)Used By (0)

[![Latest Stable Version](https://camo.githubusercontent.com/210ce3face9c8b9c6ada084b6d7619f65cdfed2467cf9b4e7aec8ed0190d6ee4/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f736572616369642f7068702d6d61696c2d626f756e63652d68616e646c65722e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/seracpd/php-mail-bounce-handler)[![Minimum PHP Version](https://camo.githubusercontent.com/b52c83f3d45755ebcb1e6863ebb202ab192aaf773424369ffdeedae107f027ef/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f7068702d253345253344253230352e342d3838393242462e7376673f7374796c653d666c61742d737175617265)](https://php.net/)[![Codacy Badge](https://camo.githubusercontent.com/a1ecffd681341d4aee52701c5479601e85a2d308a38f7107913e70c51eeb765a/68747470733a2f2f6170692e636f646163792e636f6d2f70726f6a6563742f62616467652f47726164652f6364383364323938636130303435353861653664336338656566666564653762)](https://www.codacy.com/app/seracid/PhpMailBounceHandler?utm_source=github.com&utm_medium=referral&utm_content=seracid/phpMailBounceHandler&utm_campaign=Badge_Grade)[![StyleCI](https://camo.githubusercontent.com/4bc6db71eab1f1a23336cf5f74427878f8f6d971d03272fdf2e6360ee3a0f62a/68747470733a2f2f7374796c6563692e696f2f7265706f732f3130303832313038322f736869656c643f7374796c653d666c61742d737175617265)](https://styleci.io/repos/100821082)[![Gemnasium](https://camo.githubusercontent.com/65b0b36a8ae089693ecc3e941d46d842e480c0938ede654c7960cde30bf79822/68747470733a2f2f696d672e736869656c64732e696f2f67656d6e617369756d2f736572616369642f7068704d61696c426f756e636548616e646c65722e7376673f7374796c653d666c61742d737175617265)](https://gemnasium.com/github.com/seracid/phpMailBounceHandler)

PhpMailBounceHandler
====================

[](#phpmailbouncehandler)

The original project for this handler was: [CwsMailBounceHandler](https://github.com/crazy-max/CwsMailBounceHandler).

📬 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 deletes or moves 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 with Composer
--------------------------

[](#installation-with-composer)

```
composer require seracid/php-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 `SGT\MailBounceHandler\Models\Result` is available to process custom post-actions.

Methods
=======

[](#methods)

ImapHandler
-----------

[](#imaphandler)

**openLocal** - Open a IMAP mail box in local file system.
**openRemote** - Open a remote IMAP mail box.
**processMails** - Process the messages in a mailbox or a folder.
**processMailMove** - Request mail message to be moved.
**processMailDelete** - Request mail message be deleted.
**isImapMailboxExists** - Confirms a mailbox exists (and optionally create it).
**closeMailbox** - Closes IMAP connection in use and logs it.

EmlFileHandler
--------------

[](#emlfilehandler)

**openEmlFolder** - Open a folder containing eml files on your system.
**processMails** - Process the messages in a mailbox or a folder.
**processMailMove** - Request mail message to be moved.
**processMailDelete** - Request mail message be deleted.

Handler
-------

[](#handler)

**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.

License
-------

[](#license)

LGPL. See `LICENSE` for more details.

###  Health Score

33

—

LowBetter than 75% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity22

Limited adoption so far

Community13

Small or concentrated contributor base

Maturity65

Established project with proven stability

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

Recently: every ~8 days

Total

11

Last Release

3170d ago

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

1.12PHP &gt;=5.4

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/14010740?v=4)[Dan](/maintainers/seracid)[@seracid](https://github.com/seracid)

---

Top Contributors

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

---

Tags

maildsnbouncearf

### Embed Badge

![Health badge](/badges/seracid-php-mail-bounce-handler/health.svg)

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

###  Alternatives

[zbateson/mail-mime-parser

MIME email message parser

54149.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

226.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)
