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

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

ksami007/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.12(5y ago)013LGPL-2.0-or-laterPHPPHP &gt;=5.3.2

Since Nov 17Pushed 5y agoCompare

[ Source](https://github.com/ksami007/php-mail-bounce-handler)[ Packagist](https://packagist.org/packages/ksami007/php-mail-bounce-handler)[ Docs](https://github.com/ksami007/php-mail-bounce-handler)[ RSS](/packages/ksami007-php-mail-bounce-handler/feed)WikiDiscussions master Synced 4w ago

READMEChangelog (2)DependenciesVersions (7)Used By (0)

[![Latest Stable Version](https://camo.githubusercontent.com/ee6990805533424c32d803d965b9ef3461efd96a0a71724d689fef54c50ad63e/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6b73616d693030372f7068702d6d61696c2d626f756e63652d68616e646c65722e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/ksami007/php-mail-bounce-handler)[![Minimum PHP Version](https://camo.githubusercontent.com/ed01d9ed58eeae6546ad914dfe36ffe4d8686fd4e56440892018169df0f3b5ec/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f7068702d253345253344253230352e332e322d3838393242462e7376673f7374796c653d666c61742d737175617265)](https://php.net/)[![Tested on PHP 5.4 to 7.4](https://camo.githubusercontent.com/8cafc6f5b59f27358118f8d7344d4b10aa8e48ab56c936f93180f841667f583b/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f7465737465642532306f6e2d504850253230352e34253230253743253230352e35253230253743253230352e36253230253743253230372e30253230253743253230372e31253230253743253230372e32253230253743253230372e33253230253743253230372e342532302d627269676874677265656e2e7376673f6d61784167653d32343139323030)](https://php.net/)

php-mail-bounce-handler
=======================

[](#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). 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.3.2
- 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 ksami007/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.

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.

License
-------

[](#license)

LGPL. See `LICENSE` for more details.

###  Health Score

27

—

LowBetter than 49% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity5

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity62

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

Recently: every ~400 days

Total

6

Last Release

1945d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/94781a0ee2d54ca3386f7824dcc79cf8a4a93ce408fd77d05b6de11947b320e3?d=identicon)[ksami007](/maintainers/ksami007)

---

Top Contributors

[![galata90](https://avatars.githubusercontent.com/u/1961676?v=4)](https://github.com/galata90 "galata90 (20 commits)")[![fpiccinali](https://avatars.githubusercontent.com/u/9351145?v=4)](https://github.com/fpiccinali "fpiccinali (12 commits)")[![ksami007](https://avatars.githubusercontent.com/u/3127659?v=4)](https://github.com/ksami007 "ksami007 (5 commits)")[![crazy-max](https://avatars.githubusercontent.com/u/1951866?v=4)](https://github.com/crazy-max "crazy-max (3 commits)")[![ickbinhier](https://avatars.githubusercontent.com/u/2810904?v=4)](https://github.com/ickbinhier "ickbinhier (1 commits)")

---

Tags

phpmaildsnbouncearf

### Embed Badge

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

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

###  Alternatives

[railsware/mailtrap-php

The Mailtrap SDK provides methods for all API functions.

56770.5k](/packages/railsware-mailtrap-php)[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)[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.

23125.7k2](/packages/henrique-borba-php-sieve-manager)[benhall14/php-imap-reader

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

3516.6k](/packages/benhall14-php-imap-reader)[shuchkin/react-smtp-client

ReactPHP async SMTP Client

245.7k](/packages/shuchkin-react-smtp-client)

PHPackages © 2026

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