hpk42 / muacrypt

Autocrypt and more for Mail User Agents
Other
36 stars 15 forks source link

fix: deal with emails without a From header #51

Closed azul closed 6 years ago

azul commented 6 years ago

Not sure if this actually is what we want. We have some tests that use an email without a From header. They were failing previously.

But what does the spec say about emails without a from address? Are they even RFC 2822 compliant? Maybe should fix the tests instead?

azul commented 6 years ago

RFC 2822 says:

The originator fields of a message consist of the from field, the sender field (when applicable), and optionally the reply-to field. The from field consists of the field name "From" and a comma-separated list of one or more mailbox specifications.

So i would say a message without from is not RFC 2822 complient and we should fix the test data and err out if a message has no from header.

hpk42 commented 6 years ago

yes, let's fix the test data.

hpk42 commented 6 years ago

wait a second, the tests failing are here: https://travis-ci.org/hpk42/muacrypt/jobs/338409309 and they indicate that there is an API/abstraction problem. mime.parse_one_ac_header_from_string(h)`` should not require knowing other than the Autocrypt header.