]> 91.132.146.200 Git - insipid.git/commitdiff
email imported update and changelog update SacredGrove 16/head 2.7_2022-06-12
authorBanana <mail@bananas-playground.net>
Sun, 12 Jun 2022 11:36:07 +0000 (13:36 +0200)
committerBanana <mail@bananas-playground.net>
Sun, 12 Jun 2022 11:36:07 +0000 (13:36 +0200)
ChangeLog
documentation/email-importer.txt
webroot/job/email-import.php
webroot/lib/simple-imap.class.php

index 44f3dd433ede2da796164eb888f3f640e66418d6..80e324040c4835813b3bfd5f2868ded0ad8c06ca 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,4 +1,4 @@
-version 2.7 - Sacred Grove ()
+version 2.7 - Sacred Grove (2022-06-12)
 
        + Fixed bug #12. Missing translation key
        + Adapted some new PHP code formatting
@@ -8,7 +8,8 @@ version 2.7 - Sacred Grove ()
        + New syntax in config file. See update.txt for more details
        + Fixed #13
        + Fixed #15
-       # Fixed #14
+       + Fixed #14
+       + Fixed some small email importer notices and warnings
 
 version 2.6 - Hypostyle (2021-03-21)
 
index 1207e05c27439415aa73e06f9f757742022ab069..af2c93ae2e08756823925b3e8ebf62d5c96f9146 100644 (file)
@@ -42,6 +42,9 @@ or active the "protection" with a secret given by URL / cli param.
 If you activate EMAIL_JOB_PROTECT you NEED to set an individual string in EMAIL_JOB_PROTECT_SECRET
 AND remove the provided .htaccess file in the job folder.
 
+cli: php email-import.php ----hiddenSouce=EMAIL_JOB_PROTECT_SECRET
+webaccess: email-import.php?hiddenSouce=EMAIL_JOB_PROTECT_SECRET
+
 Use the following settings in the config file:
 define('EMAIL_JOB_PROTECT', false); => Set to true if you want this kind of "protection"
-define('EMAIL_JOB_PROTECT_SECRET', 'YOUR_SOME_SECRET_STRING'); => Change to your liking
\ No newline at end of file
+define('EMAIL_JOB_PROTECT_SECRET', 'YOUR_SOME_SECRET_STRING'); => Change to your liking
index e786269c0ed3eb849b1e1e9bb122b57c127456df..64a60d740708f26cc3af89c0b15d8a1c038a0ef2 100644 (file)
@@ -3,7 +3,7 @@
  * Insipid
  * Personal web-bookmark-system
  *
- * Copyright 2016-2020 Johannes Keßler
+ * Copyright 2016-2022 Johannes Keßler
  *
  * Development starting from 2011: Johannes Keßler
  * https://www.bananas-playground.net/projekt/insipid/
@@ -32,7 +32,7 @@ ini_set('error_reporting',-1); // E_ALL & E_STRICT
 # time settings
 date_default_timezone_set('Europe/Berlin');
 
-define('DEBUG',false);
+const DEBUG = false;
 
 ## set the error reporting
 ini_set('log_errors',true);
@@ -146,7 +146,7 @@ if(!empty($emails)) {
     foreach($emails as $emailId=>$emailData) {
         $links = EmailImportHelper::extractEmailLinks($emailData['body']);
                if(!empty($links)) {
-                       if(DEBUG === true) var_dump($links);
+                       if(DEBUG === true) var_dump("Links in email:",$links);
 
                        foreach($links as $linkstring) {
                                # defaults
@@ -174,7 +174,7 @@ if(!empty($emails)) {
 
                                if (!filter_var($newdata['link'], FILTER_VALIDATE_URL)) {
                                        error_log("ERROR Invalid URL: ".var_export($newdata['link'],true));
-                                       if(DEBUG === true) var_dump($newdata['link']);
+                                       if(DEBUG === true) var_dump("Invalid URL:", $newdata['link']);
                                        continue;
                                }
 
@@ -198,7 +198,7 @@ if(!empty($emails)) {
                                        continue;
                                }
 
-                               if(DEBUG === true) var_dump($newdata);
+                               if(DEBUG === true) var_dump("New data", $newdata);
 
                 $linkObj = new Link($DB);
                 $linkID = false;
@@ -270,7 +270,6 @@ if(!empty($emails)) {
                                }
                        }
                }
-
     }
 }
 
index 8b09bc1a9ead0d4b33297749776ee607fb30a283..ff0a5bc1fd878487ace21cfe37ad88d39afb8c82 100644 (file)
@@ -3,7 +3,7 @@
  * Insipid
  * Personal web-bookmark-system
  *
- * Copyright 2016-2021 Johannes Keßler
+ * Copyright 2016-2022 Johannes Keßler
  *
  * Development starting from 2011: Johannes Keßler
  * https://www.bananas-playground.net/projekt/insipid/
@@ -50,14 +50,14 @@ class SimpleImap {
         */
        function __construct() {
            # create the mailboxstring
-           $this->_connectionstring = '{'.$this->_server.':'.$this->_port.'/imap/ssl}';
+           $this->_connectionstring = '{'.$this->_server.':'.$this->_port.'/imap/ssl/novalidate-cert}';
        }
 
        /**
         *
         */
        function __destruct() {
-           imap_close($this->_connection);
+           //imap_close($this->_connection);
        }
 
        /**
@@ -270,7 +270,8 @@ class SimpleImap {
             break;
 
             case ENC7BIT: # 0 7BIT
-                $ret = imap_qprint($body);
+                               // imap_qprint($body); does throws notices
+                $ret = quoted_printable_decode($body);
             break;
 
             case ENCOTHER: # 5 OTHER