Http auth

This pull request automatically logs in a user when email and password are supplied via HTTP basic auth, so that messages can be posted via a single (ajax) request.

It also adds a missing authentication check when creating new messages.