Clean up, improve, and test more of the EmailMessage functionality.
Review Request #8397 — Created Sept. 13, 2016 and submitted
EmailMessage had a number of parameters that were required, like an HTML body, that a caller may not have wanted to provide. Like Django's EmailMessage, all parameters are now optional. It also had some custom handling for the From field, added in 648eeaa377ab819b5a193e74241f529edf26a260, which was designed to prevent some SPF issues. Looking into this further, best I can tell, it appears that this code didn't actually solve any problems, but rather just provided another way of setting the same information (unless a caller wanted to access the "from_email" field on the attribute and get a different value from what's in the headers, but it doesn't appear we do this). That custom logic has been removed. A handful of new unit tests have been added to test functionality, and existing unit tests revised for improved naming and more specific test coverage.
Unit tests in Djblets and Review Board pass.
Looked at some sample e-mail message headers, checking that they looked
sane.