Fix issue where Content-Length of some attachments could be set to wrong value causing browser errors (#1490482)