Place the message-id in the body of the email

This approach will help detect responses to the ticket thread from mail
clients which do not include the References and In-Reply-To MIME headers.
This also allows the Subject line to continue to omit the ticket number.
pwreset: Fixup password reset system

Turns out that the new authentication system incorrectly cancels the reset
tokens when it processes logins rather than after the user successfully
resets his/her password
Merge pull request #671 from greezybacon/issue/pwreset-broken

pwreset: Fixup password reset system

Reviewed-By: Peter Rotich <peter@osticket.com>
Predictable message-ids

Outbound message-ids are predictable, with a consistent code unique and
static to each osTicket installation. This will help detect email loops
where message is delivered back to the system in an email loop.
Log errors on email loop detection

If an email loop is detected, in addition to dropping the message, also log
an error to the system log, but do not send an email to the administrator in
the event that it is the administrator's email that is looped.
email: Fix incorrect matching of user ids
Merge pull request #676 from greezybacon/issue/615

email: Fix incorrect matching of user ids

Reviewed-By: Peter Rotich <peter@osticket.com>
Merge pull request #584 from greezybacon/issue/outbound-message-ids

Place the message-id in the body of the email

Reviewed-By: Peter Rotich <peter@osticket.com>
lint: Fix incorrect variable name
oops: Fix bug where $this object is used out of context.