wangp / bower

A curses terminal client for the Notmuch email system
Other
119 stars 11 forks source link

Signatures appear as 'noname', some (non-bower ;)) clients don't handle as nicely #52

Closed dtzWill closed 4 years ago

dtzWill commented 5 years ago

I've noticed signatures appear as attachments with name 'noname' and perhaps unexpected mime type as well (will need to check that again). This style of signature doesn't seem to be well-supported in the UI of the clients my friends use, such as Thunderbird or Gmail.

It seems other mail programs name this "signature.asc" and maybe set a particular mime type, which apparently programs such as Thunderbird do recognize and display nicely. (Instead of showing a 'noname' attachment of unknown type at end of each message).

Do you know anything about this, or what it might take to be fixed? (Is this even a bower issue, or something is uses like notmuch or gpgme?)

Searching shows mutt has had similar issues/complaint with distributions long carrying patches for it: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=755538 . FWIW the change didn't meet any objections AFAICT other than some implementation details, which is to say that it doesn't appear to be controversial or likely to /break/ anything currently working. But I'm extrapolating a bit from that thread, haven't looked into it further.

Unfortunately 'noname' as a string isn't present in bower ;), so no luck with no-brainer trivial fix ;).

wangp commented 4 years ago

Maybe this is enough?

diff --git a/src/write_message.m b/src/write_message.m
index 865f19c..dec4ade 100644
--- a/src/write_message.m
+++ b/src/write_message.m
@@ -339,7 +339,8 @@ write_discrete_content_type(Stream, ContentType, !IO) :-
         Value = "application/pgp-encrypted"
     ;
         ContentType = application_pgp_signature,
-        Value = "application/pgp-signature"
+        % hack
+        Value = "application/pgp-signature; name=""signature.asc"""
     ;
         ContentType = content_type(Value)
     ),
wangp commented 4 years ago

I've committed the change on master as it seems like a good idea anyway. If it doesn't work, we can investigate further.

dtzWill commented 4 years ago

Thanks, been using and so far LGTM!