Page 1 of 1

POP3 fetching - mail body regional signs missing

Posted: Sun May 19, 2013 8:08 pm
by scz
Script URL: hesk_pop3.php
Version of script: 2.4.2
Hosting company:
URL of phpinfo.php:
URL of session_test.php:
What terms did you try when SEARCHING for a solution:
- I checked iconv configuration on server and check encode/decode polish signs - OK.

Write your message below:
When run hesk_pop3.php, mail body is receiving and new ticked is created. In imported body, there is missing all regional (polish) letters. For example message "Szanowni Państwo" is imported as "Szanowni Pastwo" (letter ń is missing (n with apostrofe)). In subjects problem doesn't exist.

Re: POP3 fetching - mail body regional signs missing

Posted: Mon May 20, 2013 6:23 pm
by Klemen
It's probably an encoding-related issue.

Could you send a sample email with these problems to pop3test AT hesk DOT com?

Re: POP3 fetching - mail body regional signs missing

Posted: Tue May 21, 2013 9:54 pm
by scz
I can't duplicate problem from my scripts and e-mail accounts. So I created mail forwarding from fetching mail account to another e-mail, and where situation arrive, I will be have complete mail string in mirror. I expect problem may arrive by the end of this month.

Best regards
Sebastian

Re: POP3 fetching - mail body regional signs missing

Posted: Wed May 22, 2013 2:36 pm
by Klemen
OK, let me know when you are able to show an example and I will look into it.

Re: POP3 fetching - mail body regional signs missing

Posted: Sun May 26, 2013 6:39 pm
by scz
I just send You mail full header and body - original message.

Re: POP3 fetching - mail body regional signs missing

Posted: Mon May 27, 2013 6:24 pm
by Klemen
Thanks, I will look into it. I think this is already fixed in 2.5 because of some changes how special chars are handled in emails, but need to test it.

P.s.: please ignore the new ticket notification you received, I was just testing 2.5.0 beta when your email arrived and it was generated into a ticket :wink:

Re: POP3 fetching - mail body regional signs missing

Posted: Mon May 27, 2013 7:06 pm
by Klemen
Just as I though - this is indeed an encoding problem. The email client that generates these messages is not following encoding rules precisely (which is very common problem).

To fix the issue you will need to:

1. your server needs to have PHP Multibyte String extension enabled (php_mbstring), check with your host.

2. in file "inc/mail/email_parser.php" find

Code: Select all

// Run our defined search-and-replace
and just ABOVE that line add

Code: Select all

if ( function_exists('mb_decode_numericentity') )
{
$text = mb_decode_numericentity($text, array(0x0, 0x2FFFF, 0, 0xFFFF), 'UTF-8');
}
Note that this will only work if Multibyte String extension is enabled on your server (if function mb_decode_numericentity exists).

Re: POP3 fetching - mail body regional signs missing

Posted: Tue May 28, 2013 11:25 am
by scz
Thank You for take care of this problem.

My server has multibyte extension, so I implement Your code and test it, where sender send me next message.

I tried to duplicate this problem from ANY known me method (e-mail clients, PHPMailer, function mail)and accounts, but nowhere problem occured. Maybe this sender has some untypical mechanism not compliant with normal standard.

Best regards
Sebastian

Re: POP3 fetching - mail body regional signs missing

Posted: Sat Jun 01, 2013 2:06 pm
by scz
Implement Your proposition works fine.

Thank You for the help.

EOT

Best regards
Sebastian