tomolimo / ticketcleaner

Home for Ticket Cleaner GLPI plugin
8 stars 2 forks source link

Mail receiver hang while ticket cleaner clean sveral signatures in the same email #7

Closed Giudy closed 7 years ago

Giudy commented 7 years ago

Hello I did experience some issue with ticketcleaner so that I had to deactvate the rule. It seems that when I have several sigantures in the same email (it does happen ie when a thread has been forwarded) the plugin hang, The point is: is there any limit on the size of the text that has to be cancelled? I mean that the regular expression I did was having wildcard and was matching long part of the email. so I was wondering if this issue could be related to the size of the matched text.

thanx

davide

tomolimo commented 7 years ago

Hello, Sorry for my late answer, but I've been very busy upgrading our own GLPI installation.

is there any limit on the size of the text that has to be cancelled?

There is no limit on the size of the text being deleted.

I may help if you post more information about your configuration and about the rule you are using and the concerned email.

Thank you Regards, Tomolimo

Giudy commented 7 years ago

Hello Tomolino, the problem is that when there is a mail with several signatures (because of a thread for example) in the body and I use a reg exp like this: /beginning of the signature \:((.|\n)*)end of the signature\./ui the mailcollector hang. If I try to use glpi->setup->receiver->retrieve now the emails I get a timeout error in the ticketcleaner log no line is add and neither in any other glpi log. in the errorlog I get this: [pid 1365] AH00052: child pid 9775 exit signal Segmentation fault (11) the only way to go on is to delete the email in the mailbox. the mailbox is checked via POP, GLPI 9.1.2, ticketcleaner 2.0.4

thanx

tomolimo commented 7 years ago

Hello, Did you try your regex with the mentioned regex test web site (from here: (https://github.com/tomolimo/ticketcleaner/wiki/Debug-filters)? Also you may try to use something like this: /beginning of the signature :.*?end of the signature\./ui. this is similar to the one I'm using internally.

regards, Tomolimo

Giudy commented 7 years ago

Ciao Tomolino, The regxex works fine as it does its job when there is a single signature. I'll give anyway a try to the one you've given here. I'll be back with the results.

thanx

davide

Giudy commented 7 years ago

Thanx, it did the job! The funny thing is that my regex did work perfectly in the test site while your doesn't. Anyway, for me it is fine like this

davide

tomolimo commented 7 years ago

Explanation: the test web site doesn't use the same regex function than Ticketcleaner, and such needs the /g flag at the end of the regex to properly shows the matched parts. But Ticketcleaner doesn't need this /g flag as it uses PHP preg_replace that implies the /g flag.