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
Fixup isBounce detection logic
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>
Merge branch 'develop' into develop-next