2b7baace480cb918b204c851a08eefa63626b588
4 * AddressStructure.class.php
6 * Copyright (c) 2003-2004 The SquirrelMail Project Team
7 * Licensed under the GNU GPL. For full terms see the file COPYING.
9 * This contains functions needed to handle mime messages.
12 * @package squirrelmail
17 * @package squirrelmail
19 class AddressStructure
{
26 function getAddress($full = true, $encoded = false) {
28 if (is_object($this)) {
29 $email = ($this->host ?
$this->mailbox
.'@'.$this->host
31 $personal = trim($this->personal
);
33 if (preg_match('/(=\?([^?]*)\?(Q|B)\?([^?]*)\?=)(.*)/Ui',$personal,$reg)) {
37 if ($encoded && !$is_encoded) {
38 $personal_encoded = encodeHeader($personal);
39 if ($personal !== $personal_encoded) {
40 $personal = $personal_encoded;
42 $personal = '"'.$this->personal
.'"';
46 $personal = '"'.$this->personal
.'"';
49 $addr = ($email ?
$personal . ' <' .$email.'>'
51 $best_dpl = $this->personal
;
56 $result = ($full ?
$addr : $best_dpl);
61 function getEncodedAddress() {
62 return $this->getAddress(true, true);