Bug 400851

Summary: Allow selection of aliased emails in the composer window
Product: [Applications] kmail2 Reporter: Christophe Marin <christophe>
Component: composerAssignee: kdepim bugs <kdepim-bugs>
Status: REPORTED ---    
Severity: wishlist CC: hw2j453uw46kkk446, mail+kde, montel
Priority: NOR    
Version: Git (master)   
Target Milestone: ---   
Platform: Other   
OS: Linux   
Latest Commit: Version Fixed In:

Description Christophe Marin 2018-11-08 16:54:33 UTC
Following a question on irc:

The identities settings window allows adding aliases for a given identity but there's no way to select one when writing an email.

Wish:
If there are email aliases for a given identity, allow selecting it in the From: field of the composer window.
Comment 1 Laurent Montel 2018-11-09 06:13:33 UTC
Indeed... Now how to implement it...
No idea for the moment...
Comment 2 Mika 2018-11-09 13:51:07 UTC
A good solution would be searchable combobox, maybe?! Eg.: 

 + https://doc.qt.io/qt-5/qcompleter.html
 + https://forum.qt.io/topic/92105/qcombobox-filtering-by-typing

As this should help finding aliases even if an identity has a lot of aliases. Dropdowns still needs the user to search for an entry and they may not be sorted in a specific order.

Additionally, pressing enter should fill out "Reply-To" field, too, as in most use cases of using aliases the user wants to receive replies to the same address.

Another approach would be to let the user pre define the "Reply-To" default entry when adding a new alias via "Edit Identity" dialogue.
Comment 3 Mika 2018-11-09 14:04:00 UTC
Later one can add "top 5 recently used" or "top 5 used aliases with receiver's domain" entries on top of the searchable combobox results. Similar to Libreoffice's Writer fonts dropdown menu.

Btw. here is an code example of a searchable combobox:

 + https://doc.qt.io/qt-5/qtwidgets-tools-completer-example.html
Comment 4 Christophe Marin 2018-11-09 14:46:52 UTC
That's not *so* simple :) there are a couple more things to keep in mind, eg: removing the signature, not using the crypto settings...
Comment 5 Mika 2018-11-09 15:05:15 UTC
(In reply to Christophe Giboudeaux from comment #4)
> That's not *so* simple :) there are a couple more things to keep in mind,
> eg: removing the signature, not using the crypto settings...

True. This also includes allowing crypto for aliases. 

Enabling the searchable combobox and disabling crypto if non-linked keys are found is a start. This already helps a lot with using aliases.

Sure, ideally there is more to consider later on.
Comment 6 Mika 2018-11-10 12:00:22 UTC
If I'm not mistaken, the "Redirect Message" dialogue already has the proposed functionality implemented. Except for "top 5 recently used" list all is working fine. The "Transport" dropdown might be a nice addition, too.