PHPackages                             uluru/antibounce - 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. uluru/antibounce

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

uluru/antibounce
================

Anti bounce plugin is able to prevent the email that bounceed from being sent it again once.

1.0(10y ago)04434MITPHPPHP &gt;=5.5

Since Sep 30Pushed 9y ago7 watchersCompare

[ Source](https://github.com/uluru/anti_bounce)[ Packagist](https://packagist.org/packages/uluru/antibounce)[ Docs](https://www.uluru.biz)[ RSS](/packages/uluru-antibounce/feed)WikiDiscussions master Synced 4w ago

READMEChangelogDependencies (1)Versions (3)Used By (0)

anti\_bounce
============

[](#anti_bounce)

「SES - SNS - アプリケーション」の連携でバウンス情報を取得し、アプリケーション側で対象のメールアドレスに対して処理を行うためのプラグインになります。

注意) アプリケーションサーバにIP制限などが掛かっていると、SNSから通知が来ませんので、SNSの通信制限を開放してやる必要があります。

SES, SNS のゾーンは US-EAST-1 (バージニア北部)

IP一覧:

1. プログラム側の準備
------------

[](#1-プログラム側の準備)

### 1-1. bounce\_logs テーブルを用意する

[](#1-1-bounce_logs-テーブルを用意する)

バウンス履歴を保存するテーブル（bounce\_logs）を作成してください。 （Model の作成は必要ありません）

FieldTypeNullKeyDefaultExtraCommentidint(11)NOPRINULLauto\_increment\*\*\*\_idint(11)NOMULNULLsettings.email に応じて設定messagetextNONULLcreateddatetimeNONULLmodifieddatetimeNONULL### 1-2. composer.json で本プラグインと aws-php-sns-message-validator をインストール

[](#1-2-composerjson-で本プラグインと-aws-php-sns-message-validator-をインストール)

```
"repositories": [{
  "type": "package",
  "package": {
      "name": "plugins/anti_bounce",
      "version": "1.0",
      "type": "cakephp-plugin",
      "require": {
          "composer/installers": "*"
      },
      "source": {
          "url": "git@github.com:uluru/anti_bounce.git",
          "type": "git",
          "reference": "master"
      }
  }
}]

"extra": {
    "installer-paths": {
        "app/plugins/anti_bounce": ["plugins/anti_bounce"]
    }
}

"require": {
    "plugins/anti_bounce": "1.0",
    "aws/aws-php-sns-message-validator": "1.1"
}

```

### 1-3. 設定ファイルの更新

[](#1-3-設定ファイルの更新)

**routes.php**

```
Router::connect(
    '/anti_bounce/receive',
    array(
        'plugin' => 'AntiBounce',
        'controller' => 'AntiBounce',
        'action' => 'receive'
    )
);

```

**bootstrap.php**

```
Configure::write(
    'AntiBounce',
    array(
        'topic' => '*****',
        'mail' => '*****',
        'settings' => array(
            'stopSending' => false, // true = stop mail sending, false = just write log
            'email' => array(
                'model' => 'User',
                'key' => 'id',
                'mailField' => 'mail_address',
            ), // メールアドレスのレコードを指定する
            'updateFields' => array(
                array(
                    'model' => 'User',
                    'key' => 'id',
                    'fields' => array(
                        'send' => 0,
                        'active' => 0,
                    )
                )
            ) // stopSending = true の場合に更新するレコードの設定
        )
    )
);

```

2. SESにメールアドレスを登録
-----------------

[](#2-sesにメールアドレスを登録)

「Verify a New Email Address」→「Verify This Email Address」→送信されてきたメールアドレスのリンク押下し、メールアドレスを有効化

**有効化したメールアドレスを bootstrap.php の mail 項目へ記載する。**

3. SESコンソールでSNSトピックを作成
----------------------

[](#3-sesコンソールでsnsトピックを作成)

1. 「Email Addresses」→ 2で登録したメールアドレスをクリック
2. 「Notifications」タブの「Edit Notification Configuration」をクリック
3. 「Edit Notification Configuration」をクリック
4. 「Topic Name」「Display Name」を適宜入力
5. 「Create Topic」すると Bounce 項目のプルダウンに作成したTopicが表示されるのでそれを選択します。

4. SNSのTopicを有効化
----------------

[](#4-snsのtopicを有効化)

3で作成したSNSトピックは、SNSのバージニア北部（ゾーン: US-EAST）に作成されています。

**Topic ARN 項目を bootstrap.php の topic 項目へ記載する。**

ARNリンクをクリック→「Create Subscription」をクリック

通信プロトコル : https

Endpoint : https://\*\*\*\*\*.\*\*\*\*/anti\_bounce/receive

とする。 数秒後コンソールをリロードすると

```
Subscription ID = PendingConfirmation
↓
Subscription ID = arn:aws:sns:us-east-1:\*\*\*\*

```

となり Endpoint への通信確認が取れます。

5. bounceメールをテスト送信
------------------

[](#5-bounceメールをテスト送信)

これで SES - SNS - アプリケーション 連携の準備が整ったので、SESにてbounceメールのテスト送信を行います。

テストメール送信方法

- [http://docs.aws.amazon.com/ja\_jp/ses/latest/DeveloperGuide/getting-started-send-from-console.html](http://docs.aws.amazon.com/ja_jp/ses/latest/DeveloperGuide/getting-started-send-from-console.html)
- [https://docs.aws.amazon.com/ja\_jp/ses/latest/DeveloperGuide/mailbox-simulator.html](https://docs.aws.amazon.com/ja_jp/ses/latest/DeveloperGuide/mailbox-simulator.html)

そうすると、4で設定したEndpoint宛にバウンスしたメール情報が通知されるようになります。

以降はアプリケーション側から送信されるメールアドレス（バウンスしたメールアドレス）に紐付くレコードがあった場合 bootstrap.php で設定したモデルが更新されます。

###  Health Score

29

—

LowBetter than 57% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity14

Limited adoption so far

Community12

Small or concentrated contributor base

Maturity59

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% 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

Unknown

Total

1

Last Release

3926d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/dbed420fb753f42dd6197ee8ca57c8109a6e70bd868ef93a3a647c3faf672459?d=identicon)[uluru-dev](/maintainers/uluru-dev)

---

Top Contributors

[![t-maehira](https://avatars.githubusercontent.com/u/4098836?v=4)](https://github.com/t-maehira "t-maehira (3 commits)")

---

Tags

awscakephpSNSses

### Embed Badge

![Health badge](/badges/uluru-antibounce/health.svg)

```
[![Health](https://phpackages.com/badges/uluru-antibounce/health.svg)](https://phpackages.com/packages/uluru-antibounce)
```

###  Alternatives

[async-aws/ses

SES client, part of the AWS SDK provided by AsyncAws.

5011.5M21](/packages/async-aws-ses)[serendipity_hq/bundle-aws-ses-monitor

Symfony bundle to monitor AWS SES bounces, complaints and deliveries through SNS. Comes with a command to fully configure the topics and includes configurable SwiftMailer filter to avoid sending emails to bounced and complained emails.

1380.7k](/packages/serendipity-hq-bundle-aws-ses-monitor)[mcfedr/awspushbundle

A set of services to simplify using Aws to send push notifications

40382.7k1](/packages/mcfedr-awspushbundle)[juhasev/laravel-ses

Allows you to track opens, deliveries, bounces, complaints and clicked links when sending emails through Laravel and Amazon SES

1710.2k](/packages/juhasev-laravel-ses)[joggapp/laravel-aws-sns

Laravel package for the SNS events by AWS

3175.9k](/packages/joggapp-laravel-aws-sns)[putyourlightson/craft-amazon-ses

Amazon SES mailer adapter.

1192.4k2](/packages/putyourlightson-craft-amazon-ses)

PHPackages © 2026

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