Sanitize and/or parse addresses in headers for incoming email
Standard email headers such as FROM, CC, TO, SENDER, etc. contain email addresses, groups, or lists of addresses as described in RFC 5322.
Mailgun currently passes on the (transcoded) data as it is received, including any errors that buggy MUAs or ESPs may send. Moreover, most libraries only do very strict parsing; This forces developers to implement lenient parsing themselves to ensure all incoming email is accepted.
Mailgun could sanitize these fields in a way that we can really trust the headers and use a strict parser on them. That would be a big plus.
It would even BETTER if besides POSTing the transcoded headers, Mailgun also included, for each header, an object with the addresses' (or as the RFC describes: "mailbox-list") structured data. That would be the "display name", actual address, whether it is a named group, an empty group (like "undisclosed recipients:;", etc.), gracefully degrading when the format is not entirely kosher.