From a9ea1c8fbbc0cbd7316ce570add4470cb6160e0e Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 3 Jun 2022 13:51:47 +0200 Subject: [PATCH] More logs --- htdocs/emailcollector/class/emailcollector.class.php | 5 +++++ htdocs/langs/en_US/admin.lang | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/htdocs/emailcollector/class/emailcollector.class.php b/htdocs/emailcollector/class/emailcollector.class.php index 8a46ea24d2d..57df1d311d7 100644 --- a/htdocs/emailcollector/class/emailcollector.class.php +++ b/htdocs/emailcollector/class/emailcollector.class.php @@ -1266,12 +1266,14 @@ class EmailCollector extends CommonObject if ($searchfilterdoltrackid > 0) { if (empty($headers['References']) || !preg_match('/@'.preg_quote($host, '/').'/', $headers['References'])) { $nbemailprocessed++; + dol_syslog(" Discarded - No header References found"); continue; // Exclude email } } if ($searchfilternodoltrackid > 0) { if (!empty($headers['References']) && preg_match('/@'.preg_quote($host, '/').'/', $headers['References'])) { $nbemailprocessed++; + dol_syslog(" Discarded - Header References found and matching signature of application"); continue; // Exclude email } } @@ -1279,6 +1281,7 @@ class EmailCollector extends CommonObject if ($searchfilterisanswer > 0) { if (empty($headers['In-Reply-To'])) { $nbemailprocessed++; + dol_syslog(" Discarded - Email is not an answer (no In-Reply-To header"); continue; // Exclude email } // Note: we can have @@ -1292,6 +1295,7 @@ class EmailCollector extends CommonObject if (!$isanswer) { $nbemailprocessed++; + dol_syslog(" Discarded - Email is not an answer (no RE prefix in subject)"); continue; // Exclude email } } @@ -1307,6 +1311,7 @@ class EmailCollector extends CommonObject //if ($headers['In-Reply-To'] != $headers['Message-ID'] && !empty($headers['References']) && strpos($headers['References'], $headers['Message-ID']) !== false) $isanswer = 1; if ($isanswer) { $nbemailprocessed++; + dol_syslog(" Discarded - Email is an answer"); continue; // Exclude email } } diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang index 14e7649fec2..4fc81e2fb2a 100644 --- a/htdocs/langs/en_US/admin.lang +++ b/htdocs/langs/en_US/admin.lang @@ -2059,7 +2059,7 @@ VATIsUsedIsOff=Note: The option to use Sales Tax or VAT has been set to SwapSenderAndRecipientOnPDF=Swap sender and recipient address position on PDF documents FeatureSupportedOnTextFieldsOnly=Warning, feature supported on text fields and combo lists only. Also an URL parameter action=create or action=edit must be set OR page name must end with 'new.php' to trigger this feature. EmailCollector=Email collector -EmailCollectors=Emails collectors +EmailCollectors=Email collectors EmailCollectorDescription=Add a scheduled job and a setup page to scan regularly email boxes (using IMAP protocol) and record emails received into your application, at the right place and/or create some records automatically (like leads). NewEmailCollector=New Email Collector EMailHost=Host of email IMAP server