Fix PHP notice when property doesn't exist
authorpdontthink <pdontthink@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Tue, 24 May 2022 08:26:45 +0000 (08:26 +0000)
committerpdontthink <pdontthink@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Tue, 24 May 2022 08:26:45 +0000 (08:26 +0000)
git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@14965 7612ce4b-ef26-0410-bec9-ea0150e637f0

class/deliver/Deliver_SMTP.class.php

index 90075ccbc8061b26f4dace7b0f547b9ebd2507f1..6029acb62d8012111f20d77421164109bfb445d1 100644 (file)
@@ -347,7 +347,8 @@ class Deliver_SMTP extends Deliver {
             if (!$to[$i]->host) $to[$i]->host = $domain;
             if (strlen($to[$i]->mailbox)) {
                 // Ask for DSN if user has requested such and remote server supports it
-                if ($rfc822_header->dsn && array_key_exists('DSN',$this->ehlo)) {
+                if (isset($rfc822_header->dsn) && $rfc822_header->dsn
+                 && array_key_exists('DSN',$this->ehlo)) {
                     // TODO: Make the DSN parameters configurable by admin? user?
                     fputs($stream, 'RCPT TO:<'.$to[$i]->mailbox.'@'.$to[$i]->host."> NOTIFY=SUCCESS,DELAY,FAILURE\r\n");
                     // Retry without DSN fields for cranky MTAs
@@ -368,7 +369,8 @@ class Deliver_SMTP extends Deliver {
             if (!$cc[$i]->host) $cc[$i]->host = $domain;
             if (strlen($cc[$i]->mailbox)) {
                 // Ask for DSN if user has requested such and remote server supports it
-                if ($rfc822_header->dsn && array_key_exists('DSN',$this->ehlo)) {
+                if (isset($rfc822_header->dsn) && $rfc822_header->dsn
+                 && array_key_exists('DSN',$this->ehlo)) {
                     // TODO: Make the DSN parameters configurable by admin? user?
                     fputs($stream, 'RCPT TO:<'.$cc[$i]->mailbox.'@'.$cc[$i]->host."> NOTIFY=SUCCESS,DELAY,FAILURE\r\n");
                     // Retry without DSN fields for cranky MTAs
@@ -389,7 +391,8 @@ class Deliver_SMTP extends Deliver {
             if (!$bcc[$i]->host) $bcc[$i]->host = $domain;
             if (strlen($bcc[$i]->mailbox)) {
                 // Ask for DSN if user has requested such and remote server supports it
-                if ($rfc822_header->dsn && array_key_exists('DSN',$this->ehlo)) {
+                if (isset($rfc822_header->dsn) && $rfc822_header->dsn
+                 && array_key_exists('DSN',$this->ehlo)) {
                     // TODO: Make the DSN parameters configurable by admin? user?
                     fputs($stream, 'RCPT TO:<'.$bcc[$i]->mailbox.'@'.$bcc[$i]->host."> NOTIFY=SUCCESS,DELAY,FAILURE\r\n");
                     // Retry without DSN fields for cranky MTAs