diff options
author | Kevin McCarthy <kevin@8t8.us> | 2020-11-24 12:54:00 -0800 |
---|---|---|
committer | Kevin McCarthy <kevin@8t8.us> | 2020-11-24 18:14:13 -0800 |
commit | d73a83f77d66892701c58f0c1a8cde829c1486f0 (patch) | |
tree | 8b6aa70f85d6705362f53832673ebaad53d6ac5a /autocrypt | |
parent | d92689088dfe80a290ec836e292376e2d9984f8f (diff) |
Fix exact-address handling when addr->personal is set.
The exact-address compile-time option takes an exact copy of an
address when it is parsed, and prints that out when outputting the
address. The idea is to preserve older "user@host (Name)" syntax.
Unfortunately, when code tries to "update" the personal/name field, it
needs to clear the exact-address copy for it to have any effect.
An object-oriented design encapsulating the setting would help prevent
this problem. It might be desirable to create a C function instead,
but callers would have to remember it, and such a thing isn't common
in the Mutt codebase.
Another patch (I'm still debating applying) changes the address parser
to discard the exact-address copy when it exactly matches the
mailbox. However, that still won't fix every case (and it makes the
parser even more difficult to follow.)
So this commit (to stable) takes the straightforward approach.
It fixes bugs in:
* Alias creation. The "personal name" prompt was ignored.
* Autocrypt initialization from address setting with $realname.
* $pgp_getkeys_command handling.
* Query menu results.
* "unset $reverse_realname" handling.
* $from handling of $realname.
* Bounce Resent-From handling of $realname.
Diffstat (limited to 'autocrypt')
-rw-r--r-- | autocrypt/autocrypt.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/autocrypt/autocrypt.c b/autocrypt/autocrypt.c index 1aa02fff..d2508848 100644 --- a/autocrypt/autocrypt.c +++ b/autocrypt/autocrypt.c @@ -143,7 +143,12 @@ int mutt_autocrypt_account_init (int prompt) { addr = rfc822_cpy_adr_real (From); if (!addr->personal && Realname) + { addr->personal = safe_strdup (Realname); +#ifdef EXACT_ADDRESS + FREE (&addr->val); +#endif + } } do |