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).