Add routing to check if a message is a bounced reply
Centralize how we check for auto replies.
Disable auto-response on a bounce.
Disable alerts to staff on auto-reply

The concern here is possible loop when an alert to staff bounces back to the
system.
Disable alerts to staff on bounces
Exclude the auto-responding email from possible alerts sent to staff
pipe: Use empty message token '--' if no message

Previously, the subject was duplicated, which is really confusing
pipe: Unwrap forwarded emails

If the mail received into the system has a content type of 'message/rfc822',
then unwrap the inner message and use it as the parsed email. Effectively,
assume the email was forwarded as an message/rfc822 attachment.
pipe: Honor inline bodies as valid message

Previously, if a message had a Content-Disposition header, then it could not
be considered as the body of the message.
Fixup isBounce detection logic
fetch: Implement parsing attached email

If the content of the message is of type `message/rfc822`, then support
downloading the body of the message and sending it off to the mail parsing
system, simulating a piped email.
Merge pull request #482 from greezybacon/issue/email-parse-issues

Fixup a few email piping issues

Reviewed-By: Peter Rotich <peter@osticket.com>
Use case-insensitive matching on email address

This patch addresses an issue where a client may have upper-case letters in
their email address. When visiting the client portal to check the ticket
status, previously, the exact same case would be required in the 'Email
Address' box.

This patch removes the case sensitivity for email logins.
Change from function specific static var to class var
Rename routines to make it a little clear on what they do
mysqli: Retry on deadlock-found error

If MySQL error #1213 (deadlock found when trying to get lock) is returned
from query, it is safe to retry the query.

This patch will retry queries up to two times for a total of three. If the
query cannot be executed without error #1213 after the third time, the error
is logged as usual, and the system continues with the failed query.
Merge pull request #493 from greezybacon/feature/retry-queries

mysqli: Retry on deadlock-found error

Reviewed-By: Peter Rotich <peter@osticket.com>
test: Add regression test for mail header matching

Fixes a few E_NOTICE messages
Drops bounce checking inside autoReply checking
Merge pull request #474 from protich/feature/auto-replies

Feature/auto replies

Reviewed-By: Jared Hancock <jared@osticket.com>
Fix clickable links which end in punctuation
Fix mailto: links to not route through l.php
i18n: Remove unused, possibly incorrect formatting

These functions don't appear to be used an could corrupt UTF-8 encoded text
htmLawed: Fix corruption to UTF8 encoded text

On some combinations of operating systems, PHP and libpcre versions, `\s`
will match the iso-8859-x non-breaking-space, 0xa0. This regular expression
will munge the UTF8 encoded version, 0xc2a0 to 0xc220, which is not a valid
UTF8 character.

When inserted into a UTF8 field in mysql, the text will be truncated at and
after the first invalid character.