Fix incorrectly encoded headers in MailTransport.

When encoded values are present in header fields, they need to have
newlines removed as leaving the newlines in place and interfere with
delivery on Qmail based SMTP servers.

Fixes #2209
Add missing return type
Merge pull request #2282 from bcrowe/hotfix-returnType

Add missing return type
Merge branch 'master' into 2.5