Bug 459050

Summary: snippet variable reliably picks middle name instead of family name
Product: [Applications] kmail2 Reporter: m.eik michalke <bugs.kde.org>
Component: composerAssignee: kdepim bugs <kdepim-bugs>
Status: REPORTED ---    
Severity: normal    
Priority: NOR    
Version: 5.20.3   
Target Milestone: ---   
Platform: Ubuntu   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:

Description m.eik michalke 2022-09-13 09:52:48 UTC
SUMMARY
when you use the family name variable in a text snippet for kmail, but the from/to address name consists of more than two text strings, kmail consistently uses the second string for family name. most of the time, this is wrong and picks a middle name (perhaps depends on the language).


STEPS TO REPRODUCE
1. add a new text snippet in kmail's mail editor, e.g. call it "family name"
2. from variables, choose "To" -> "family name in To: field"
3. put "first middle last <foo@example.com>" in the To: field of the new email
4. use the "family name" template (drag & drop or double click)

OBSERVED RESULT
editor shows "middle".

EXPECTED RESULT
editor should show "last".

SOFTWARE/OS VERSIONS
this is the current backports packages for kubuntu 22.04, but this issue is acutally bugging me for years, it's not exclusive to a certain version or setup and likely still not fixed.

ADDITIONAL INFORMATION
handling addresses in the form of "last, first" <foo@example.com> also seems to be broken (produces an empty string).