Update class.mailparse.php

Best version of https://github.com/osTicket/osTicket-1.8/pull/348

static keyword added to enable strict test mode.
Update run-tests.php

Allow tester to run single test by specifying it on command line: php run-tests.php TestMyThing etc.

Still works for normal tests.
Create test.header_functions.php

Creates a regression test for the parsePriority function, as suggested by GreezyBacon https://github.com/osTicket/osTicket-1.8/pull/348#issuecomment-31326865
mail: Add signals to interact with mail processing

Signals added:
  * mail.received
    Called after the mail is received into the system and before it is
    processed by the mail system. This signal is useful to do header
    injection. Raw message/rfc822 included in 'raw' key in the info

  * mail.decoded
    Called after the initial decoding of the message. The header and bodies
    are broken out, however, Unicode decoded may not have been performed
    yet. This signal is useful to affect the interpretation of the message,
    such as TNEF processing, etc.

  * mail.processed
    Called after all internal processing is completed. All Unicode
    processing is complete, bounce detection and other mechanisms have
    completed. This signal is useful to do things like attachment scanning
    or content filtering.
mail: Add useful error log on failed mail processing
logging: Add signal for log handling
thread: Add searchable view to ThreadBody

This will be useful for plugins which might need to scan the message body
regardless of its encoding. This will also be required for full-text indexes
which will not need to index HTML tags, for instance.
mail: No auto responses for auto-reply mails

This requires extra processing in the mail backend, perhaps through a
plugin, which would detect and flag a message as an auto-reply. Auto-replies
are added to the ticket thread, but have the automated responses disabled.
Display external images and original links on thanks

Previously, external images were mucked up and links were routed through
l.php, which requires a client sign in. If a client were not signed in when
creating a ticket. The links would not work correctly.
Allow guests to sign out

Otherwise, a user's session cannot be voluntarily destroyed
Users can visit more than one ticket via link

Previously, once a client was authenticated to the system with an email
link, the user could utilize other email links to other tickets; however,
the same ticket page would be presented to the user regardless of which link
was utilized.

This patch allows the ticket in focus for the user to be changed after
visiting the client portal with a different ticket link.
forms: Fix corruption of company name on new ticket

New ticket by staff would cause the %{company.name} variable to be
incorrectly replaced as the user's name in email templates.
Retire %{ticket.client_link}

Affected users should upgrade the token to %{recipient.ticket_link}
Partially revert 37b8d549d610c

That patch introduced a bug where the list of dynamic fields for a form is
always empty
auth: Consider AccessDenied thrown in SSO process
Formatted Canned Responses

Centralize how canned responses are formatted
Add ability to quote original and last messages as a canned response
Add JSON encoder utility to Format class
Add ticket thread quotes to canned responses

Add original and last message quotes to canned responses
Style blockquote for ticket thread
Enable canned responses by default