email: Handle poorly encoded email headers

Handle cases where email headers contain unicode or high-ascii characters
and are not encoded according to RFC-2047. This patch handles a special case
where a detectable unicode character set is used, such as UTF-8. For
high-ascii characters in a character set other than iso-8859-1, the result
of this patch is undefined.

Fixes #826
Properly handle htmlchars in web-based posts
Merge pull request #850 from greezybacon/issue/826

email: Handle poorly encoded email headers

Reviewed-By: Peter Rotich <peter@osticket.com>
Merge pull request #851 from greezybacon/issue/htmlchars

Properly handle htmlchars in web-based posts

Reviewed-By: Peter Rotich <peter@osticket.com>
api: Add example script to create tickets
Merge pull request #852 from greezybacon/feature/api-example-script

api: Add example script to create tickets

Reviewed-By: Peter Rotich <peter@osticket.com>
email: Accept inline body with disposition params

A mail client may indicate a header parameter (such as Novell Groupwise,
which may add something like

Content-Disposition: inline; modification-time: "Thu ..."

) Previously, the system would not consider the content to be a candidate
for the email body, because it has parameters to the content-disposition
header.

This patch will still consider the part to be a candidate for the body if
the mime types match and no filename is found in the content-disposition
parameters.
Merge pull request #853 from greezybacon/issue/inline-body-with-disposition-params

email: Accept inline body with disposition params

Reviewed-By: Peter Rotich <peter@osticket.com>
Merge remote branch 'upstream-1.7/develop' into develop

Roll a few commits made post 1.7.3

Conflicts:
	include/class.thread.php