Re: [Patch] make IMAP messages translatable

Hi Albrecht:

On 01/12/2019 08:31:05 AM Sat, Albrecht Dreß wrote:
Hi Peter:

Am 12.01.19 02:39 schrieb(en) Peter Bloomfield:
(balsa:9235): autocrypt-CRITICAL **: 11:18:05.376: autocrypt_from_message: assertion 'LIBBALSA_IS_MESSAGE(message) && (message->headers != NULL) && 
(message->headers->from != NULL) && (message->headers->content_type != NULL) && GMIME_IS_OBJECT(message->mime_msg) && 
(autocrypt_db != NULL)' failed

and it fails because message->mime_msg is NULL. I see it only in IMAP mailboxes, and only for certain 
messages--perhaps those with HTML parts(?).

Ah!  I could actually reproduce the issue with /one/ message in an IMAP folder, which is not a text/html, 
btw., but a multipart/signed…  Good catch!

Am 12.01.19 04:51 schrieb(en) Peter Bloomfield:
Do we really need mime_msg, or can we get the autocrypt headers instead from message->headers?

No, we actually don't need mime_msg, but unfortunately your patch doesn't solve the issue completely, as the code 
shall (according to the specs) check if multiple valid Autocrypt headers are present, and 
libbalsa_message_get_user_header() returns the first one only.  So we have to scan 
message->headers->user_hdrs manually.

Carefully reading sect. 2.1 and 2.3 of the standard again, my original solution wasn't correct either, as it 
completely ignored messages in some corner cases where it actually should still update the last_seen state.  
The standard isn't absolutely clear (read: incomplete IMO) in these cases, though.

Attached is a patch which inspects all headers according to the specs.  Basically, I shifted the header 
processing to a separate function, and added some documentation.

Additionally, it extends the (debug) output when checking the key data from an Autocrypt header fails.

What do you think?

Thanks--the patch looks great, and appears to give the same functionality without warnings!

I've pushed it to the branch at GitLab. I'm inclined to merge it into master--do you see any reason not to?




Attachment: pgpQpDBVs7t7D.pgp
Description: PGP signature

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]