Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Empty message body in 1.12 from outlook mail #68

Open
HaokePeng opened this issue Aug 23, 2019 · 8 comments
Open

Empty message body in 1.12 from outlook mail #68

HaokePeng opened this issue Aug 23, 2019 · 8 comments

Comments

@HaokePeng
Copy link

HaokePeng commented Aug 23, 2019

In version 1.12.

Whenever we got an FW or RE HTML email from OUTLOOK mail, the body will shows as (empty).

I have tried every solution related to the (empty) body that I can find on OSTicket forum, and nothing works.

Some other people also have the same issue. Links below:
Email with iso 8859-1
Empty message body on V1.12.2

@HaokePeng
Copy link
Author

When we use Apache to replace Nginx, it works fine

@jortkoopmans
Copy link

Seems to be same issue as reported at the end of thread here: osTicket/osTicket#3278

I have the same problem for iso 8859-1, even though I have the fixes in the mimeDecode.php and the regex in class.charset.php.

@jortkoopmans
Copy link

Still happening in latest v1.14.1 release (using this docker stack).

@libussa
Copy link

libussa commented Feb 10, 2020

so apparently this could be related to the use of nginx (unsupported officially) vs apache
osTicket/osTicket#3278 (comment)

@jortkoopmans
Copy link

It is difficult to get solid conclusions from it, but I agree that this is certainly a big difference between the stacks. Note that also the other image using nginx, devinsolutions/osticket, is supposedly having the same problem. (osTicket/osTicket/#3278(comment))

@yurividal
Copy link

Is there any fix for this?

@SoarinFerret
Copy link

I believe I have found the issue for this. It all boils down to an issue with how iconv is being compiled for Alpine vs how its compiled for other distros (glibc vs musl).

Installing apk add --repository http://dl-3.alpinelinux.org/alpine/edge/testing gnu-libiconv appeared to help with some emails, but the ones originating from iPhones still seemed to cause issues.

Instead of trying to fix the iconv package, in /data/upload/include/class.charset/php, I updated the default conversion from iconv to mb_convert_encoding. After doing so, all of our emails started working.

You simply need to replace:

if (function_exists('iconv'))
    $text = iconv($from, $to.'//IGNORE', $text);
elseif (function_exists('mb_convert_encoding'))
    $text = mb_convert_encoding($text, $to, $from);

with the following:

if (function_exists('mb_convert_encoding'))
    $text = mb_convert_encoding($text, $to, $from);
elseif (function_exists('iconv'))
    $text = iconv($from, $to.'//IGNORE', $text);

Sadly, this involves changing the source code for osTicket, so the change here will not scale when it comes to upgrading osTicket versions (for when that file gets updated). My company already has to maintain a separate code base for osTicket with our image due to us including some upstream patches, so its not as big of a deal for us. But I wanted to include my temporary fix here in case it can help others.

@SoarinFerret
Copy link

... and now I saw this #86

This is probably a better solution than what I just listed above.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants