tomolimo / mailanalyzer

Mail Analyzer GLPI Plugin may be used to combine CC mails into one Ticket
25 stars 10 forks source link

Errors when opening e-mail calls #41

Closed phamorais closed 3 years ago

phamorais commented 4 years ago

Hello! I have a very strange problem. With Plugin 1.6.4 and GLPI 9.4.6, in some emails opened by email I get the following error

image

image

However, if I disable the plugin the error does not happen.

tomolimo commented 4 years ago

Hello @phamorais

This error may occur when the plugin delete an email from the email server, and when GLPI mailgate tries to retreive the deleted email from the mail server. This is due to the fact that the plugin will delete the email (duplicated email or followups to ticket,...) before GLPI gets it, but GLPI still have the email ID in its list, and GLPI will try to retrieve it from the email server. In fact this is not a real error.

Thank you Regards, Tomolimo

phamorais commented 4 years ago

Hello! @tomolimo I confess I didn't understand. Does the plugin delete the email before the mailgate is executed?

tomolimo commented 4 years ago

Hello @phamorais I just checked again the process, here it is in detail: On pre ticket add, then we do the following steps:

  1. check if a ticket has already been created with this email (uses Thread-Index and messageID) to detect this.
  2. check if a ticket has already been created within the list of existing email references in current received email: in this case it add a followup to the existing ticket (if not solved, nor closed).

For both cases, If found, then it will reset current inputs to prevent a new ticket creation (ticket is already existing). But this will not delete the email from the IMAP inbox, so that next time the cron will be executed, then it will take again the same email... To prevent this behavior the plugin deletes the current email (and send it to the REFUSED folder), but doing that GLPI will throw the error you can see.

For me, this error is not linked to the issue you described in your email....

Could you check the logs when you have the troubles with GLPI that doesn't want to open the ticket. I already had such behavior in the past, and it was due to HTML tags in the email body (like < and >)

could you do some tests with plain text emails?

thank you, regards,

Tomolimo

phamorais commented 4 years ago

@tomolimo Hello

Yes, I ran the test with simpler emails with plain text or some smaller attachments and the body of the email. And the vast majority was open normally

Follow the prints step by step like email --> With the Plugin Activated

1 - Ticket in INBOX awaiting cronjob

image

2 - mailgate run with sucess at 21:59pm

image

3 - Mail sent to refused box

image

4 - Logs php-erros.log

image

5 - GLPI Erros in Receiver > List of not imported

image

With the plugin disabled

1 - Ticket in INBOX awaiting cronjob

image

2 - mailgate run with sucess at 22:11pm

image

3 - Mail sent to accepted box

image

4 - Logs php-erros.log

image

5 - No refused itens in Recevers

image

6 - Ticket Open

image

phamorais commented 4 years ago

Any?

tomolimo commented 4 years ago

Hello @phamorais Sorry for being long to answer, but I'm still doing short work due to Covid-19 crisis... Give me some times to analyze your posts :) Thank you, Regards, Tomolimo

phamorais commented 4 years ago

@tomolimo

thx!

tomolimo commented 4 years ago

Hello @phamorais Could you post in a zip file the email that cause troubles? Thank you, Regards, Tomolimo

tomolimo commented 4 years ago

Hello @phamorais I have an idea, but I need to know which PHP version do you have? And I need a sample of the email. Thank you Regards, Tomolimo

phamorais commented 4 years ago

@tomolimo Hi!

Im use PHP 7.3.12

image

I will send u a mail. We can talk in telegram?

tomolimo commented 4 years ago

I'm sorry I don't use telegram, you may use my professional email address to send a zip file

phamorais commented 4 years ago

@tomolimo

I Send to u !

tomolimo commented 4 years ago

Hello Could you check? I didn't reçoive tant email. Thank you Regards Tomolimo

tomolimo commented 4 years ago

Sorry, I received an email from cibra, was it yours?

phamorais commented 4 years ago

@tomolimo

Yes Cibra is my client. Emails come from that customer

tomolimo commented 4 years ago

Hello @phamorais

I cannot reproduce the issue: I can open the newly created ticket without troubles... I've tested with only the mailanalyzer plugin activated (the others were not enabled). We need more details about: GLPI configuration and PHP configuration: from menu: Setup > System from the [code] tag to [/code] tag

Thank you, Regards, Tomolimo

tomolimo commented 4 years ago

Another question: image You mentioned PHP 7.3.12 NTS? And do you use Apache? That's strange to me to use NTS version if Apache is the web server... Normally NTS releases are only for FastCGI installation using IIS, and Apache is to use TS version of PHP. Do you have a mix of PHP versions?

tomolimo commented 4 years ago

Sorry, forget my previous POST: I made some tests with my Ubuntu VM, and I can see the same results than yours for the php -v

phamorais commented 4 years ago

@tomolimo HI

I did not understand. Can't you reproduce the error?

Follow / code

Server

Operating system: Linux 3.10.0-957.10.1.el7.x86_64 #1 SMP Mon Mar 18 15:06:45 UTC 2019 x86_64 PHP 7.3.12 apache2handler (Core, PDO, Phar, Reflection, SPL, SimpleXML, Zend OPcache, apache2handler, apcu, bz2, calendar, ctype, curl, date, dom, exif, fileinfo, filter, ftp, gd, gettext, hash, iconv, imap, intl, json, ldap, libxml, mbstring, mysqli, mysqlnd, openssl, pcre, pdo_mysql, pdo_sqlite, posix, session, shmop, snmp, soap, sockets, sqlite3, standard, sysvmsg, sysvsem, sysvshm, tokenizer, wddx, xml, xmlreader, xmlrpc, xmlwriter, xsl, zlib) Setup: max_execution_time="30" memory_limit="128M" post_max_size="8M" safe_mode="" session.save_handler="files" upload_max_filesize="2M" Software: Apache/2.4.6 (CentOS) OpenSSL/1.0.2k-fips PHP/7.3.12 () Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/85.0.4183.121 Safari/537.36 Server Software: MariaDB Server Server Version: 10.4.14-MariaDB

Libraries

htmLawed version 1.2.4 in (/var/www/html/glpi/lib/htmlawed) phpmailer/phpmailer version 6.0.7 in (/var/www/html/glpi/vendor/phpmailer/phpmailer/src) simplepie/simplepie version 1.5.3 in (/var/www/html/glpi/vendor/simplepie/simplepie/library) tecnickcom/tcpdf version 6.3.2 in (/var/www/html/glpi/vendor/tecnickcom/tcpdf) michelf/php-markdown in (/var/www/html/glpi/vendor/michelf/php-markdown/Michelf) true/punycode in (/var/www/html/glpi/vendor/true/punycode/src) iamcal/lib_autolink in (/var/www/html/glpi/vendor/iamcal/lib_autolink) sabre/vobject in (/var/www/html/glpi/vendor/sabre/vobject/lib) zendframework/zend-cache in (/var/www/html/glpi/vendor/zendframework/zend-cache/src) zendframework/zend-i18n in (/var/www/html/glpi/vendor/zendframework/zend-i18n/src) zendframework/zend-serializer in (/var/www/html/glpi/vendor/zendframework/zend-serializer/src) monolog/monolog in (/var/www/html/glpi/vendor/monolog/monolog/src/Monolog) sebastian/diff in (/var/www/html/glpi/vendor/sebastian/diff/src) elvanto/litemoji in (/var/www/html/glpi/vendor/elvanto/litemoji/src) symfony/console in (/var/www/html/glpi/vendor/symfony/console) leafo/scssphp in (/var/www/html/glpi/vendor/leafo/scssphp/src) phpCas version 1.3.6 in (/usr/share/pear)

Plugins list

news Name: Alertas Version: 1.6.0 State: Enabled behaviors Name: Comportamental Version: 2.2.2 State: Enabled datainjection Name: Data injection Version: 2.7.1 State: Enabled escalade Name: Escalonamento Version: 2.4.4 State: Enabled formcreator Name: Form Creator Version: 2.9.2 State: Enabled fusioninventory Name: FusionInventory Version: 9.4+2.4 State: Enabled tag Name: Gerenciamento de Etiquetas Version: 2.6.0 State: Enabled pdf Name: Imprimir em PDF Version: 1.6.0 State: Enabled mailanalyzer Name: Mail Analyzer Version: 1.6.4 State: Enabled dashboard Name: Painel Version: 0.9.8 State: Enabled vip Name: VIP Version: 1.6.0 State: Enabled

tomolimo commented 4 years ago

I can't Sorry

tomolimo commented 4 years ago

I suggest to do a test disabling all plugins but mailanalyzer. Means keep mailanalyzer enabled.

phamorais commented 4 years ago

@tomolimo Hi!

Sorry I didn't understand your follow up. Does this mean that you were unable to correct, or failed to reproduce the error?

image

As for disabling all plugins leaving only the mailanalyzer, I did the test.

image

The email was in the test box for receipt

image

But Have Fail Again

image

tomolimo commented 4 years ago

Hello @phamorais

Thank you for the test you did. Tell me in which language do you use GLPI? Portuguese?

My comment was: I cannot reproduce the issue with the email you sent to me. And if I can't reproduce the issue, I can't fix it! Could you zip the email and send it to me (instead of forwarding it to me) (use my professional email address)? As you are using Outlook, you may drag/drop the email to your desktop, and then zip it and sent it to me. This is the best way to do: it prevents loses of information, and permits that the email will arrive at my mailbox without being touch by the mail servers.

Thank you, Regards, Tomolimo

phamorais commented 4 years ago

@tomolimo Hi!

my language is portuguese.

I sent the email by email to the account with the extension .msg and .rar (compressed)

image

tomolimo commented 3 years ago

Hello @phamorais I've not been able to reproduce the issue 😢 Could you try to reduce the complexity of issue to a very basic one, so that it will be possible to reproduce it? Thank you Regards, Tomolimo

phamorais commented 3 years ago

Hello Tolimo!

In fact, there is no complexity. In fact, some e-mails are refused by GLPI, when PLugin is active, but there is no (or has not yet been discovered) the pattern that generates the error

For your knowledge .. I did a test on version 9.5.2 with the plugin disabled. And the same email q is refused in version 9.4.6, it is opened normally in 9.5.2.

Honestly, I will spend energy adapting and studying the update to 9.5.2, given the complexity of its correction in 9.4.6