mikel/mail — Issue #367: Stricter .read! method
Author: rurounijones
Created: 2012-03-08 04:22:43+00:00
State: open

Currently the .read method is very forgiving.

You can do something like ```mail = Mail.read('test.jpg')``` and the mail gem will do its best and create a weird email object with binary data in the headers etc.

I want to check for bad email files before sending. One way so far appears to be to read a file and then check if the message_id is nil but I am not sure if this is a good method or not.

I think having a .read! (with a bang to signify that this method will raise exceptions if something is wrong) method which would read a file then throw an exception unless it is a valid email would be extremely useful I think