]> git.mxchange.org Git - friendica.git/blobdiff - src/Protocol/Email.php
Add logging for unexpected empty published key in activity
[friendica.git] / src / Protocol / Email.php
index 06946d4830795d9987d237ff83d19ef7f7a38cad..f915e9f742b4385092c0e33bde6d5d1e4979cc82 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /**
- * @copyright Copyright (C) 2020, Friendica
+ * @copyright Copyright (C) 2010-2021, the Friendica project
  *
  * @license GNU AGPL version 3 or any later version
  *
@@ -50,12 +50,12 @@ class Email
 
                $errors = imap_errors();
                if (!empty($errors)) {
-                       Logger::log('IMAP Errors occured: ' . json_encode($errors));
+                       Logger::notice('IMAP Errors occured', ['errora' => $errors]);
                }
 
                $alerts = imap_alerts();
                if (!empty($alerts)) {
-                       Logger::log('IMAP Alerts occured: ' . json_encode($alerts));
+                       Logger::notice('IMAP Alerts occured: ', ['alerts' => $alerts]);
                }
 
                return $mbox;
@@ -77,21 +77,21 @@ class Email
                if (!$search1) {
                        $search1 = [];
                } else {
-                       Logger::log("Found mails from ".$email_addr, Logger::DEBUG);
+                       Logger::notice("Found mails from ".$email_addr);
                }
 
                $search2 = @imap_search($mbox, 'UNDELETED TO "' . $email_addr . '"', SE_UID);
                if (!$search2) {
                        $search2 = [];
                } else {
-                       Logger::log("Found mails to ".$email_addr, Logger::DEBUG);
+                       Logger::notice("Found mails to ".$email_addr);
                }
 
                $search3 = @imap_search($mbox, 'UNDELETED CC "' . $email_addr . '"', SE_UID);
                if (!$search3) {
                        $search3 = [];
                } else {
-                       Logger::log("Found mails cc ".$email_addr, Logger::DEBUG);
+                       Logger::notice("Found mails cc ".$email_addr);
                }
 
                $res = array_unique(array_merge($search1, $search2, $search3));
@@ -396,7 +396,7 @@ class Email
 
                //$message = '<html><body>' . $html . '</body></html>';
                //$message = html2plain($html);
-               Logger::log('notifier: email delivery to ' . $addr);
+               Logger::notice('notifier: email delivery to ' . $addr);
                mail($addr, $subject, $body, $headers);
        }