Properly escape htmlchars in field errors
pipe: For wrapped messages, use wrapped headers

07fec4c4d19d27eade440bad0041a952ea4f99f8 introduced the ability to receive
and process messages forwarded as a message/rfc822. However, the email
headers that were saved on file in the %email_info_table were the headers of
the outer message.

This patch pulls the headers from the wrapped message to be saved in the
database. This mainly addresses the email References and In-Reply-To headers
for the email responses from the system.
Clear ticket locks on logout

Remove any ticket locks staff has on logout.
Merge pull request #516 from greezybacon/issue/wrapped-mail-headers

pipe: For wrapped messages, use wrapped headers

Reviewed-By: Peter Rotich <peter@osticket.com>
html2text: Use [title][1] for footnote references
Add %{recipient} and %{staff} variables to new ticket by staff scope
filter: Support matching on To and Cc headers
Always keep recipients list

If an email arrives at the system and the system cannot determine why the
mail arrived (ie. a system email was not found in the To or Cc headers), the
recipients list should be maintained.

This is useful for generating collaborator lists as well as filtering by the
To and Cc (Addressee) headers.
Merge pull request #527 from protich/issue/recipient-on-open-by-staff

New Ticket Notice

Reviewed-By: Jared Hancock <jared@osticket.com>
Merge pull request #529 from greezybacon/feature/to-cc-filter-match

Add addressee to filtering system

Reviewed-By: Peter Rotich <peter@osticket.com>
Merge pull request #522 from protich/feature/logout+ticket-locks

Clear ticket locks on logout

Reviewed-By: Jared Hancock <jared@osticket.com>
Add flush() call after writes

And allow plugin to support remotely-generated hashes for migration safety
verification
Ensure redirects are complete requests
Ensure HTTP filenames are encoded consistently
Add blocksize concept to the file storage API
Merge pull request #515 from greezybacon/feature/file-storage-api-2

File Storage API v2

Reviewed-By: Peter Rotich <peter@osticket.com>