From f190be9e2d4d285fb71d84e5d3884206067cf7af Mon Sep 17 00:00:00 2001 From: Frederic Guillot Date: Sun, 19 Apr 2015 19:23:42 -0400 Subject: Add Sendgrid integration (incoming email handling) --- app/Core/Tool.php | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'app/Core') diff --git a/app/Core/Tool.php b/app/Core/Tool.php index ade99cad..84e42ba8 100644 --- a/app/Core/Tool.php +++ b/app/Core/Tool.php @@ -31,4 +31,24 @@ class Tool fclose($fp); } } + + /** + * Get the mailbox hash from an email address + * + * @static + * @access public + * @param string $email + * @return string + */ + public static function getMailboxHash($email) + { + if (! strpos($email, '@') || ! strpos($email, '+')) { + return ''; + } + + list($local_part,) = explode('@', $email); + list(,$identifier) = explode('+', $local_part); + + return $identifier; + } } -- cgit v1.2.3