X-Git-Url: https://vcs.fsf.org/?p=squirrelmail.git;a=blobdiff_plain;f=class%2Fmime%2FAddressStructure.class.php;h=34193eef94323fdd73c715ad2d3c27adff02845e;hp=97ebb532b1fb3e4a624b9b715216adae4a55b1cc;hb=c69bc63529c64510bdccbfb74bfcecc1d9d0d07b;hpb=0f459286b465c21d7a7807098b34ae610a635a11 diff --git a/class/mime/AddressStructure.class.php b/class/mime/AddressStructure.class.php index 97ebb532..34193eef 100644 --- a/class/mime/AddressStructure.class.php +++ b/class/mime/AddressStructure.class.php @@ -3,12 +3,11 @@ /** * AddressStructure.class.php * - * Copyright (c) 2003-2005 The SquirrelMail Project Team - * Licensed under the GNU GPL. For full terms see the file COPYING. - * - * This file contains functions needed to extract email address headers from + * This file contains functions needed to extract email address headers from * mime messages. * + * @copyright © 2003-2007 The SquirrelMail Project Team + * @license http://opensource.org/licenses/gpl-license.php GNU Public License * @version $Id$ * @package squirrelmail * @subpackage mime @@ -50,7 +49,7 @@ class AddressStructure { /** * Return address information from mime headers. - * @param boolean $full return full address (true) or only email (false) + * @param boolean $full return full address (true) or only personal if it exists, otherwise email (false) * @param boolean $encoded (since 1.4.0) return rfc2047 encoded address (true) or plain text (false). * @return string */ @@ -98,5 +97,17 @@ class AddressStructure { function getEncodedAddress() { return $this->getAddress(true, true); } + + /** + * Return just the email portion of this address + * @return string + * @since 1.5.2 + */ + function getEmail () { + $r = ''; + if (is_object($this)) { + $r = $this->host ? $this->mailbox.'@'.$this->host : $this->mailbox; + } + return $r; + } } -?> \ No newline at end of file