Issue with special characters when fetching pop3

Helpdesk for my helpdesk software

Moderator: mkoch227

Post Reply
Halwas
Posts: 2
Joined: Tue Oct 30, 2012 2:15 pm

Issue with special characters when fetching pop3

Post by Halwas »

Script URL: http://support.elcon-it.dk
Version of script: 2.4.1
Hosting company: EL:CON Kommunikation A/S
URL of phpinfo.php: http://support.elcon-it.dk/phpinfo.php
URL of session_test.php: http://support.elcon-it.dk/session_test.php
What terms did you try when SEARCHING for a solution:
[CUSTOMER], pop3, browsing around FAQ
Write your message below:
We use HESK in Denmark and have some troubles parsing pop3 mail from senders using special danish characters in their names.

When a user creates a ticket by sending an email to the hesk pop3 mailbox and the senders name contains special character æ, ø, å or Æ, Ø, Å, then the sender will be named: [Customer]

It only regards sendernames, special characters included in message body are parsed fine into the ticket.

Maybe someone can point me in the right direction, so I can fix it?

Best regards

Flemming Hansen
Klemen
Site Admin
Posts: 10136
Joined: Fri Feb 11, 2005 4:04 pm

Re: Issue with special characters when fetching pop3

Post by Klemen »

Hello,

Try this:

1. open file inc/pipe_functions.inc.php in a text/html editor
2. find

Code: Select all

$tmpvar['name'] = hesk_input($results['from'][0]['name']) or $tmpvar['name'] = $hesklang['pde'];
3. instead of that code use

Code: Select all

if ( empty($results['from'][0]['name']) )
{
	$tmpvar['name'] = $hesklang['pde'];
}
else
{
	$tmpvar['name'] = $results['from'][0]['name'];
	if (! empty($results['subject_encoding']) && strtoupper($results['subject_encoding']) != 'UTF-8' )
	{
		$tmpvar['name'] = iconv($results['subject_encoding'], 'UTF-8', $tmpvar['name']);
	}
}
4. save, upload and test.

Does this help with the name issue?
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
Halwas
Posts: 2
Joined: Tue Oct 30, 2012 2:15 pm

Re: Issue with special characters when fetching pop3

Post by Halwas »

Hello

It worked perfectly.

Thank You for a fast answer and a great solution to my problem.

And thank you for HESK itself. I simply love it.

Best regards

Flemming Hansen
spagr
Posts: 1
Joined: Sun Nov 04, 2012 11:35 pm

Re: Issue with special characters when fetching pop3

Post by spagr »

Hello,
I had the same problem in Czech language and POP3 fetching.

I resolved this problem in asimple step, in one line :

1. file inc/mail/email_parser.php
2. find function process_addrname_pairs($email_info) declaration
3. find line (in ver. 2.4.1 line no. 143)

Code: Select all

{
    $name = $info["name"];
}
4. change it to this

Code: Select all

{
    $name = array_key_exists("encoding", $info) ? iconv($info["encoding"], "UTF-8", $info["name"]) : $info["name"];
}
5. save & upload & test

Martin
Klemen
Site Admin
Posts: 10136
Joined: Fri Feb 11, 2005 4:04 pm

Re: Issue with special characters when fetching pop3

Post by Klemen »

That would work too, yes.

An official solution will be included in the next update.
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
ambitionen
Posts: 1
Joined: Mon Dec 03, 2012 8:35 pm

Re: Issue with special characters when fetching pop3

Post by ambitionen »

For me its not just a problem of name !!


Standard german text (containing "äöüß") is cut-off in the text sending mail by my mail-client (Foxmail).
When using a webmailer it works.

So maybe a problem of encoding, but very difficult to track for me
Klemen
Site Admin
Posts: 10136
Joined: Fri Feb 11, 2005 4:04 pm

Re: Issue with special characters when fetching pop3

Post by Klemen »

It's an encoding-related issue, but if the webmail shows it correctly it is possible that your mail client is having encoding problems.

What happens if you try with some other modern mail client, like Mozilla Thunderbird?
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
Post Reply