smtp: Reuse existing connections where possible

This should speed up the system where several emails and alerts will be sent
through the same SMTP account in the same request.
tnef: Improve performance of checksum checks

Previously, the data blocks were inspected byte for byte. Now data blocks
are parsed 1k at a time. Fewer PHP function calls ultimately means faster
performance.
tnef: Support TNEF for fetched emails
pipe: Honor attachment ext and size restrictions
Register session close on shutdown at the start of session handling

This is necessary to make sure session data is saved on redirect.
Merge pull request #567 from greezybacon/issue/tnef-mail-fetch

tnef: Support TNEF for fetched emails

Reviewed-By: Peter Rotich <peter@osticket.com>
Merge pull request #462 from greezybacon/issue/reuse-smtp-conns

smtp: Reuse existing connections where possible

Reviewed-By: Peter Rotich <peter@osticket.com>
Merge pull request #568 from greezybacon/issue/mail-parse-file-exts

pipe: Honor attachment ext and size restrictions

Reviewed-By: Peter Rotich <peter@osticket.com>
Merge pull request #571 from protich/issue/close_session_on_shutdown

Register session close on shutdown at the start of session handling

Reviewed-By: Jared Hancock <jared@osticket.com>
filter: Implement priority action

The priority setting was broken when priority was added to the dynamic data
Merge pull request #574 from greezybacon/issue/honor-filter-priority

filter: Implement priority 

Reviewed-By: Peter Rotich <peter@osticket.com>
Merge remote branch 'upstream/develop' into develop-next