Mail::Message::encodeAttachment should reset input stream afterwards
If a mail message is written more than once to an output stream, the attachment is empty the second time.
We should reset the input buffer to the beginning of the attachment after writing it.
This issue was reported by email.
AuthService::sendMail always writes the message to stdout. Maybe that write should be optional?