Whitelist / Blacklist from domains or emails for email sending

Installs: 11 080

Dependents: 1

Stars: 6

Watchers: 6

Forks: 1

Language: PHP

0.1.2 2014-08-11 12:18 UTC


Build Status Coverage Status Latest Stable Version

A swiftmailer plugin that allows whitelist / blacklist to which emails to perform the sends. This is useful for example when you want to allow emails only to a certain domain in testing / staging


$mailer = Swift_Mailer::newInstance();

$mailer->registerPLugin(new FilterPlugin('', array('', ''));

First argument is whitelist, second is blacklist, they both allow string or an array of emails or domain names. If you assign a domain, all emails from that domain will be whitelisted / blacklisted.

There are additional getters / setters that you might use:

  • setWhitelist($whitelist)
  • getWhitelist()
  • setBlacklist($blacklist)
  • getBlacklist()


Copyright (c) 2013, OpenBuildings Ltd. Developed by Ivan Kerin as part of

Under BSD-3-Clause license, read LICENSE file.