getting headers, content and attachments from each e-mail. TODO: test