Retrieve messages from the database in raw form to avoid creating unnecessary short-lived objects. Added timestamps to headers.