Diffusion GpgOL 72e95d2539e2

Improve protected headers handling

Authored by aheinecke on Jan 16 2020, 1:07 PM.


Improve protected headers handling

* src/mail.cpp (Mail::updateHeaders_o): New. Handle data from
protected headers.
(Mail::parsing_done): Call updateHeaders.
* src/mimedataprovider.cpp: Check for protected headers
(t2body): Handle that a part with protecteded headers might
also be data.
(MimeDataProvider::collect_input_lines): Collect potential
legacy part into a helper buffer.
(get_header): New helper.
(MimeDataProvider::finalize): Check for legacy part and
handle protected headers.
(MimeDataProvider::get_protected_header): New helper.
* src/oomhelp.cpp (invoke_oom_method_with_string): New helper.
* src/parsecontroller.cpp (get_internal_subject): Replace with

This fixes an issue where content might be hidden related
to the protected header parsing as shown by the
"unfortunately complex" test message of the protected
headers corpus. It also does the legacy part
handly as per spec and adds some code for
other headers. Except Date. The setting of the
From Addresses might also not work very well as
my tests have shown that the sender object was not
available at the update headers time.