[Vtigercrm-commits] [Vtiger development] #8089: Mail Converter ignore not encoded words in subject beginnig

Vtiger development vtiger-tickets at trac.vtiger.com
Mon Jun 16 15:54:50 GMT 2014


#8089: Mail Converter ignore not encoded words in subject beginnig
------------------------------------------------+--------------------------
 Reporter:  branokosik                          |       Owner:  developer
     Type:  defect                              |      Status:  new
 Priority:  major                               |   Milestone:  6.1.0
Component:  vtigercrm                           |     Version:  6.1.0 - wip
 Severity:  Critical                            |  Resolution:
 Keywords:  mail, converter, subject, encoding  |
------------------------------------------------+--------------------------

Comment (by branokosik):

 I test it and in function parseHeader I got subject header
 ($mailheader->subject) as:

 Re: TT4885 (ID:28374) - =?UTF-8?B?Tm92w6EgcG/FvmlhZGF2a2EgLSBURVM=?=
 =?UTF-8?B?VA==?=

 ...what is same as in mail source.

 After decoding from mime_decode($mailheader->subject) the subject is only:
 Nová požiadavka - TEST

 I think that my customization is needed.


 Merge with Your changes:

 {{{
 if(preg_match('/([^\?]+)(?=\=\?[^\?]+\?[^\?]+\?[^\?]+\?=)/', $input,
 $matches)) {
                         array_push($words, $matches[0]);
                 }
                 if(preg_match_all('/=\?([^\?]+)\?([^\?]+)\?([^\?]+)\?=/',
 $input, $matches)) {
                         array_filter($matches);
                         if(count($matches[0])>0){
                                 $decodedArray =
 imap_mime_header_decode($input);
                                 foreach($decodedArray as $part=>$prop){
                                         $decodevalue=$prop->text;
                                         $charset=$prop->charset;
                                         $value =
 self::__convert_encoding($decodevalue, $targetEncoding, $charset);
                                         array_push($words, $value);
                                 }
                         }
                 }
 }}}

 If I'm wrong, please correct me.

--
Ticket URL: <http://trac.vtiger.com/cgi-bin/trac.cgi/ticket/8089#comment:6>
Vtiger development <http://trac.vtiger.com/>
Vtiger CRM


More information about the vtigercrm-commits mailing list