You are not logged in.

Announcement

 Téléchargez la dernière version stable de GLPI      -     Et vous, que pouvez vous faire pour le projet GLPI ? :  Contribuer
 Download last stable version of GLPI                      -     What can you do for GLPI ? :  Contribute

#1 2008-07-12 19:01:06

kpcomp
Member
Registered: 2008-07-12
Posts: 57

glpi 0.71 final - Mail followup: get only content from reply to ticket

As most current email clients (Outlook 2003, 2007, Express, WindowsMail) and webmails did not use ">" for quoting previous message I reworked it a liitle for our purpose.

It expects that almost all mail clients when reply to mail includes former sender email and if not there's no quoted previous message. So I get all content until admin email is reached minus 2 lines.

This i my part of inc/mailgate.class.php:
                if ( preg_match('/\[GLPI #(\d+)\]/',$this->textCleaner($this->decodeMimeString($head['subject'])),$match) ) {
                        // it's a reply to a previous ticket
                        $ID = (int)$match[1];
                        $tkt['tracking'] = $ID;
                        $job=new Job();
                        $job->getfromDB($ID);
                        // the job exists and the author is the same
                        if ( $job->getFromDB($ID) && ($job->fields["author"] == $tkt['author']) ) {

                                $exists = true;

                                // Convert <br> to "\n" for HTML only email missing "\n" and clean HTML
                                $tkt['contents'] = str_replace("<br>", "\n", $tkt['contents']);
                                $tkt['contents'] = html_clean($tkt['contents']);

                                $content=explode("\n",$tkt['contents']);
                                $tkt['contents']="";
                                $to_keep=array();
                                foreach($content as $ID => $val){
                                        if (isset($val) && strstr($val,$CFG_GLPI["admin_email"])) {
                                                unset($to_keep[$ID-1]);
                                                unset($to_keep[$ID-2]);
                                                break;
                                        } elseif (strlen($val)!=0) {
                                                $to_keep[$ID]=$ID;
                                        }
                                }
                                foreach($to_keep as $ID) {
                                        $tkt['contents'].=$content[$ID]."\n";
                                }
                        }
                }

WARNING: Removes blank lines.

If it's possible please include it (or something similiar) to next release version.
Tested with Outlook 2003, Windows Mail (Vista), IceWarp Merak Webmail for RE and FW.

Is there situation when sender email is different from $CFG_GLPI["admin_email"]? If so I have to make some more changes.

Pavel Kloud
KP Comp s.r.o.

Offline

#2 2008-07-12 19:24:22

remi
GLPI-DEV
From: Champagne
Registered: 2007-04-28
Posts: 7,127
Website

Re: glpi 0.71 final - Mail followup: get only content from reply to ticket

Your solution assume than response is top posted

Top posting is generally considered as a bad pratice .... (not Netiquette compliant)

Most reply i read are under the original quote, and often between line from it.

++


Dév. Fedora 29 - PHP 5.6/7.0/7.1/7.2/7.3/7.4 - MariaDB 10.3 - GLPI master
Certifié ITILv3 - RPM pour Fedora, RHEL et CentOS sur https://blog.remirepo.net/

Offline

#3 2008-07-12 19:41:57

MoYo
GLPI - Lead
From: Poitiers
Registered: 2004-09-13
Posts: 14,513
Website

Re: glpi 0.71 final - Mail followup: get only content from reply to ticket

I agree whit remi, your solution is not a good one.
You make a strong assumption on the mail structure.


MoYo - Julien Dombre - Association INDEPNET
Contribute to GLPI :    Support     Contribute     References     Freshmeat

Offline

#4 2008-07-12 19:50:26

kpcomp
Member
Registered: 2008-07-12
Posts: 57

Re: glpi 0.71 final - Mail followup: get only content from reply to ticket

So we have very different experience with people sending emails.

Our customers never write reply to bottom and very rarely inside text. They also complain about order of info in mailed tickets - it's same - needed info somewhere in the middle. And I have to agree with them that it makes no sense to spend more time on reading any email to scroll down to read or write a reply. And I never saw a user doing it different way.

Maybe Netiquette says its wrong but it means nothing when more then hundred of customers mean it different way and no one same way as Netiquette.

Back to topic: ANY solution which takes only content of followup is highly welcome.

Offline

#5 2008-07-12 19:54:12

EmpereurZorg
Member
From: ORLEANS
Registered: 2005-12-31
Posts: 604

Re: glpi 0.71 final - Mail followup: get only content from reply to ticket

remi wrote:

Your solution assume than response is top posted
Top posting is generally considered as a bad pratice .... (not Netiquette compliant)
Most reply i read are under the original quote, and often between line from it.

I not agree
Most of mail client are configured by default with quote under the response (Lotus, Outlook, ...?), just for history of discussion (not used as in forum). Top quote is an exception, particularly in a professional environment.


Version GLPI : 10.0.6 + Plug'in Glpi + Agent Fusion 2.4
Plateforme : Win Server 2019 , Apache 2.4, PHP 8.1

Offline

#6 2008-07-12 20:03:23

MoYo
GLPI - Lead
From: Poitiers
Registered: 2004-09-13
Posts: 14,513
Website

Re: glpi 0.71 final - Mail followup: get only content from reply to ticket

The problem is simple :
- there is several methods of quoting : top / bottom / interlaced

So it is not possible to use the position to detect quoted text

Maybe others chars than > are used to quote text. We can add them to the quote detection process.

I do not understand why this question have not been raised during the beta-test / RC period ?


MoYo - Julien Dombre - Association INDEPNET
Contribute to GLPI :    Support     Contribute     References     Freshmeat

Offline

#7 2008-07-12 20:14:02

kpcomp
Member
Registered: 2008-07-12
Posts: 57

Re: glpi 0.71 final - Mail followup: get only content from reply to ticket

MoYo wrote:

The problem is simple :
- there is several methods of quoting : top / bottom / interlaced

So it is not possible to use the position to detect quoted text

Maybe others chars than > are used to quote text. We can add them to the quote detection process.

It's not that simple - I have set a catch process to mailgate.class.php to get source from Merak WebMail, Outlook 2003 and Windows Mail (Vista). They did not use any character to quote and inside structure is very different. Try it - You will see. I was not able to find any other way to solve this.

One possible way is to get info about mail client which could be in many cases identified by mail header  and then program different ways to gather the content.

Or to find way used by most people and make it compatible at-least for them.

Pavel Kloud
KP Comp s.r.o.

Offline

#8 2008-07-13 01:14:24

JMD
GLPI - Lead
Registered: 2004-09-13
Posts: 9,180
Website

Re: glpi 0.71 final - Mail followup: get only content from reply to ticket

And I never saw a user doing it different way.

Perhaps you don't communcate with good people...

Maybe Netiquette says its wrong but it means nothing when more then hundred of customers mean it different way and no one same way as Netiquette.

hundred of customers use Windows and proprietary software so windows and proprietary software are the best ?

Merak WebMail, Outlook 2003 and Windows Mail (Vista). They did not use any character to quote

Wonderfull,  another workaround that we had to find to correct stupid conception of this software...


JMD / Jean-Mathieu Doléans - Glpi-project.org - Association Indepnet
Apportez votre pierre au  projet GLPI   : Soutenir

Offline

#9 2008-07-14 20:29:08

kpcomp
Member
Registered: 2008-07-12
Posts: 57

Re: glpi 0.71 final - Mail followup: get only content from reply to ticket

JMD wrote:

And I never saw a user doing it different way.

Perhaps you don't communcate with good people...

Maybe Netiquette says its wrong but it means nothing when more then hundred of customers mean it different way and no one same way as Netiquette.

hundred of customers use Windows and proprietary software so windows and proprietary software are the best ?

Merak WebMail, Outlook 2003 and Windows Mail (Vista). They did not use any character to quote

Wonderfull,  another workaround that we had to find to correct stupid conception of this software...

Hello JMD,

add good people: customers and employes - technicians and developers - very good people :-)

add Windows: maybe not best but working and used by more than 90% standard company users and home users in CZ (except technoids with Linux and MAC users)

add corrections: sure. we do the same for customers of our eshop platform and crm system - IE7 was not nice one, IE8 will take us also lot of work which nobody will pay for - that's how it is. same with Outlook 2007 changed email rendering which makes all nice HTML&CSS email news with pictures useless and had to be changed completely.

You did great job guys! So continue with it :-) No more about cons and pros. Let's concentrate on solution.

Give me info about email clients which use text after quote. We will try to find solution for most of clients.

Regards,

Pavel Kloud
KP Comp s.r.o.

Offline

#10 2008-07-15 00:49:37

remi
GLPI-DEV
From: Champagne
Registered: 2007-04-28
Posts: 7,127
Website

Re: glpi 0.71 final - Mail followup: get only content from reply to ticket

kpcomp wrote:

And I have to agree with them that it makes no sense to spend more time on reading any email to scroll down to read or write a reply.

Sorry, i really don't understand this.
How can you reply to a message you haven't read ?


No, here a sample of a reply :

xxxxx xxxxx  has wrote :
> Hello
> I'd like to meet you to ..
> What day are you free
> - Monday
> - Tuesday

Ok for me, but only the morning

> - Friday
>
> Regards

I think the reply, without the quote have no sense.

So i don't think we should delete it and we must keep the whole response.

And if someone decide to implement such a solution it MUST be an optional/configurable parameter.

++


Dév. Fedora 29 - PHP 5.6/7.0/7.1/7.2/7.3/7.4 - MariaDB 10.3 - GLPI master
Certifié ITILv3 - RPM pour Fedora, RHEL et CentOS sur https://blog.remirepo.net/

Offline

#11 2008-07-15 00:52:19

remi
GLPI-DEV
From: Champagne
Registered: 2007-04-28
Posts: 7,127
Website

Re: glpi 0.71 final - Mail followup: get only content from reply to ticket

kpcomp wrote:

Give me info about email clients which use text after quote. We will try to find solution for most of clients.

Thunderbird

++


Dév. Fedora 29 - PHP 5.6/7.0/7.1/7.2/7.3/7.4 - MariaDB 10.3 - GLPI master
Certifié ITILv3 - RPM pour Fedora, RHEL et CentOS sur https://blog.remirepo.net/

Offline

#12 2008-07-15 09:54:58

EmpereurZorg
Member
From: ORLEANS
Registered: 2005-12-31
Posts: 604

Re: glpi 0.71 final - Mail followup: get only content from reply to ticket

remi wrote:

I think the reply, without the quote have no sense.
So i don't think we should delete it and we must keep the whole response.
And if someone decide to implement such a solution it MUST be an optional/configurable parameter.
++

Personally I use top quote - or no quote at all -, because i respond to the persons who send the mail.
Professionally, I use quote under, to leave history for new people that would catch the subject on the fly... With this "method", you can delete all reply and archive only the final mail. I sometime use top quote, but very exceptionally.

If you parse and quote the mail, the response effectively should stay intact : probably not so easy, but glpi just need to suppress "full quotes", anywhere in the message.

Last edited by EmpereurZorg (2008-07-15 15:20:56)


Version GLPI : 10.0.6 + Plug'in Glpi + Agent Fusion 2.4
Plateforme : Win Server 2019 , Apache 2.4, PHP 8.1

Offline

#13 2008-07-15 13:16:24

MoYo
GLPI - Lead
From: Poitiers
Registered: 2004-09-13
Posts: 14,513
Website

Re: glpi 0.71 final - Mail followup: get only content from reply to ticket

great example of remi.
Maybe we need to keep all the response. But it will introduce lot of redundancy.


MoYo - Julien Dombre - Association INDEPNET
Contribute to GLPI :    Support     Contribute     References     Freshmeat

Offline

Board footer

Powered by FluxBB