[dev] Undefine property: host and mailbox

Serge Grondin SGrondin at csbf.qc.ca
Fri May 16 10:57:26 PDT 2003


Serge Grondin a écrit :

> Hi,
>
> In IMP RELENG_3 with Horde RELENG_2 and Turba RELENG_1, I have the
> following error in my php log when I send an email with a list ex:
> List name : My-buddy
> Content of list:  "John Doe" <john at doe.com>
>                   "Jane Doe" <jane at doe.com>
>
> PHP Notice:  Undefined property:  host in /..../horde/imp/lib/IMP.php on
> line 634
> PHP Notice:  Undefined property:  mailbox in /..../horde/imp/lib/IMP.php
> on line 634
> PHP Notice:  Undefined property:  host in /..../horde/imp/lib/IMP.php on
> line 634
>
> However, the message got sent to all the recipients.
>
> If you can point me in the right direction to finding how to get rid of
> these, I will try to find a solution and send a patch to correct this.
>
> Thanks

Hi,

It's bad manner to reply to self but I think I found a solution.  Here is
the patch.

[root at webmail lib]# cvs diff -u IMP.php
Index: IMP.php
===================================================================
RCS file: /repository/imp/lib/IMP.php,v
retrieving revision 1.198.2.54
diff -u -r1.198.2.54 IMP.php
--- IMP.php     15 May 2003 22:41:39 -0000      1.198.2.54
+++ IMP.php     16 May 2003 17:46:21 -0000
@@ -631,7 +631,9 @@

         $from = imap_rfc822_parse_adrlist($address,
$_SESSION['imp']['maildomain']);
         foreach ($from as $entry) {
-            $addressList[] = $entry->mailbox . '@' . $entry->host;
+            if (array_key_exists("mailbox",$entry) &&
array_key_exists("host",$entry)) {
+                $addressList[] = $entry->mailbox . '@' . $entry->host;
+            }
         }

         if ($multiple) {


I hope it's the right way to correct these PHP notice.

--
Serge Grondin
Technicien en Informatique
Commission Scolaire des Bois-Francs
Tel. bur.:   (819) 758-6453, poste 2920
e-Mail bur.: SGrondin at csbf.qc.ca
e-Mail per.: sergegro at sympatico.ca




More information about the dev mailing list