diff options
author | Frederic Guillot <fred@kanboard.net> | 2015-04-19 19:23:42 -0400 |
---|---|---|
committer | Frederic Guillot <fred@kanboard.net> | 2015-04-19 19:23:42 -0400 |
commit | f190be9e2d4d285fb71d84e5d3884206067cf7af (patch) | |
tree | ca0c4bd21eeb85102731b79eb5dda526655ce82b /app/Core/Tool.php | |
parent | ac86c3100a1030026024c33c1cf02ec79f08ff51 (diff) |
Add Sendgrid integration (incoming email handling)
Diffstat (limited to 'app/Core/Tool.php')
-rw-r--r-- | app/Core/Tool.php | 20 |
1 files changed, 20 insertions, 0 deletions
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; + } } |