Go to file
2020-02-18 17:33:11 +03:00
src add ICloud Service 2020-02-18 17:33:11 +03:00
tests add ICloud Service 2020-02-18 17:33:11 +03:00
.coveralls.yml Initial public release 2016-09-10 00:41:21 +02:00
.gitignore Initial public release 2016-09-10 00:41:21 +02:00
.travis.yml Downgrade PHPUnit to version 6.5.14 and return PHP versions 7.0/7.1 2020-02-17 10:29:32 +03:00
composer.json Add new aliases for yandex and mail systems 2020-02-17 17:00:23 +03:00
LICENSE Initial public release 2016-09-10 00:41:21 +02:00
phpunit.xml.dist Upgrade PHPUnit version to 8.5.2 2020-02-13 16:36:15 +03:00
README.md add ICloud Service 2020-02-18 17:33:11 +03:00

Build Status Coverage Status Codacy Badge

Transparent Email

Transparent Email clears aliases from email address. Email John.Doe+alias@gmail.com will be transformed to johndoe@gmail.com.

Why?

To detect multi-accounts on your website.

Supported mailboxes

Usage

use bkrukowski\TransparentEmail\TransparentEmailFactory;
use bkrukowski\TransparentEmail\Emails\Email;
use bkrukowski\TransparentEmail\Emails\EmailInterface;
use bkrukowski\TransparentEmail\Emails\InvalidEmailException;

try {
    $factory = new TransparentEmailFactory();
    $cleaner = $factory->createDefault();
    $inputEmail = new Email('John.Doe+alias@gmail.com');
    /** @var EmailInterface $transformedEmail */
    $transformedEmail = $cleaner->getPrimaryEmail($inputEmail);
    echo $transformedEmail;
} catch (InvalidEmailException $exception) {
    echo 'Invalid email!';
}

Versioning

The version numbers follow the Semantic Versioning 2.0.0 scheme.

Yahoo.com

Aliases work different on Yahoo than on Gmail. On Gmail part after plus is skipped. For example message sent to janedoe+alias@gmail.com will be redirected to janedoe@gmail.com.

Yahoo uses the following pattern*:

baseName-keyword@yahoo.com

  • baseName - value defined by the user, different than email login;
  • keyword - one from a list of keywords defined by the user.

Therefore we do not know what is the real email, so in this case result will be baseName@yahoo.com, which actually does not exist.

Yandex.ru

In official documentation you can find some use-cases about aliases usage.

Mail.ru

Mail.ru service uses following aliases:

  • janedoe+alias@mail.ru will be redirected to janedoe@mail.ru
  • janeDoe@MAIL.RU will be redirected to janedoe@mail.ru

Icloud.com

Icloud.com service uses following aliases:

  • janedoe+alias@icloud.com will be redirected to janedoe@icloud.com
  • janeDoe@ICLOUD.COM will be redirected to janedoe@icloud.com