POP3 fetching - mail body regional signs missing

Helpdesk for my helpdesk software

Moderator: mkoch227

Post Reply
scz
Posts: 17
Joined: Sat Jan 12, 2013 6:15 pm

POP3 fetching - mail body regional signs missing

Post 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.
Klemen
Site Admin
Posts: 10147
Joined: Fri Feb 11, 2005 4:04 pm

Re: POP3 fetching - mail body regional signs missing

Post by Klemen »

It's probably an encoding-related issue.

Could you send a sample email with these problems to pop3test AT hesk DOT com?
Klemen, creator of HESK and PHPJunkyardWas this helpful? You can buy me a drink here Image

Image You should follow me on Twitter here

Help desk software | Cloud help desk | Guestbook | Link manager | Click counter | more PHP Scripts ...

Also browse for php hosting companies, read php books, find php resources and use webmaster tools
scz
Posts: 17
Joined: Sat Jan 12, 2013 6:15 pm

Re: POP3 fetching - mail body regional signs missing

Post 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
Klemen
Site Admin
Posts: 10147
Joined: Fri Feb 11, 2005 4:04 pm

Re: POP3 fetching - mail body regional signs missing

Post by Klemen »

OK, let me know when you are able to show an example and I will look into it.
Klemen, creator of HESK and PHPJunkyardWas this helpful? You can buy me a drink here Image

Image You should follow me on Twitter here

Help desk software | Cloud help desk | Guestbook | Link manager | Click counter | more PHP Scripts ...

Also browse for php hosting companies, read php books, find php resources and use webmaster tools
scz
Posts: 17
Joined: Sat Jan 12, 2013 6:15 pm

Re: POP3 fetching - mail body regional signs missing

Post by scz »

I just send You mail full header and body - original message.
Klemen
Site Admin
Posts: 10147
Joined: Fri Feb 11, 2005 4:04 pm

Re: POP3 fetching - mail body regional signs missing

Post 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:
Klemen, creator of HESK and PHPJunkyardWas this helpful? You can buy me a drink here Image

Image You should follow me on Twitter here

Help desk software | Cloud help desk | Guestbook | Link manager | Click counter | more PHP Scripts ...

Also browse for php hosting companies, read php books, find php resources and use webmaster tools
Klemen
Site Admin
Posts: 10147
Joined: Fri Feb 11, 2005 4:04 pm

Re: POP3 fetching - mail body regional signs missing

Post 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).
Klemen, creator of HESK and PHPJunkyardWas this helpful? You can buy me a drink here Image

Image You should follow me on Twitter here

Help desk software | Cloud help desk | Guestbook | Link manager | Click counter | more PHP Scripts ...

Also browse for php hosting companies, read php books, find php resources and use webmaster tools
scz
Posts: 17
Joined: Sat Jan 12, 2013 6:15 pm

Re: POP3 fetching - mail body regional signs missing

Post 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
scz
Posts: 17
Joined: Sat Jan 12, 2013 6:15 pm

Re: POP3 fetching - mail body regional signs missing

Post by scz »

Implement Your proposition works fine.

Thank You for the help.

EOT

Best regards
Sebastian
Post Reply