Background for my mailserver I use unique usernames/passwords per app/device, when I send an e-mail beyond the fact that I’d like the recipient to have an easy on the eyes sender address I obviously don’t want to leak one part of this unique combination.
I also extensively use mail extensions (like user+unique.for.company.or.mailinglist@gmail) and it would be nice if I can set my From to whatever I need it to be manually during mail composition.
The first could be accomplished in account settings by having another field from “real user” or “from address” or something along those lines.
The second actually can also already work in the current UI:
After pressing the … which brings up CC, BCC and the “From” dropdown in the “From” dropdown longpress the relevant account to be allowed to edit the “From” address just for this e-mail.
@vige
I’m looking at the code of EmailComposer.qml
If possible it would be great to have a github place where I can send a PR if I manage to figure this out as well as for discussing the why of some of the code there (like not allowing changing the “from” of an already stored draft, this should I think be possible and just result in the deletion of the message from the original account and storage in the account to which it was switched.
As far as I think there are ideally 2 things here:
I should be able to at the account level set what it’s From: field looks like, this would happen in the Settings app.
In an ideal world I should be able to manually change my From: on any message I write and just be able to tell the Mail app which account to use to send it (like on TB), setting a bad From: should be handled by the mailserver and is no business of the client to police.
I just checked the Accounts app and 1 is actually possible, there is an “email address” field at the top of the screen that does not need to match the usernames, not sure how I missed that before.
Stopping for now.
/Edit: @vige thanks for the quick reply, I hope they will be open to patches that allow 2.
As far as I know, the jolla-email code is not the only place to look at.
Actually, the email is internally composed by nemo-qml-plugin-email, from src/emailmessage.cpp.
Look at the ::setFrom() setter method. It is used to set both the From: field and guess the account based on the value. There is no ::setAccount() method to set the member variable m_account. So at the moment, there is no possibility to enter a free typed From: field, without creating another way to set-up the account.
I’ve been thinking at modifying these bits to allow multiple identities for an account (namely a given list of preset from-addresses). I think there is a way to use the already existing code from QMF (the email library, see https://codereview.qt-project.org/q/project:qt-labs/messagingframework) since it allows to define several addresses in a QMailAddress object. It would help to reuse the existing code with minor modifications : like that the existing ::setFrom() can still be used to find the sending account based on pre-entred email addresses. So far so good, but there are many other places in the code that expect QMailAccount::fromAddress() to return a single address and not a a QMailAddress with sub-adresses.
I’m currently busy with internal work in QMF to upstream Sailfish OS patches, but I would like to come back to this idea and see if it can result in something.
In the mean time, feel free to continue from your side and ask questions if needed.
For copyright/licensing type of reasons I can’t just apply some patches thrown at our side. With some extra paperwork that can be doable though.
Now, would be nice indeed to allow more custom email addresses and aliases. However I think the general case should be something like accounts settings having UI for adding an deleting them, and then the email composer just choosing between what’s been set. Typing the custom address for each composed email sounds quite error prone.
Quickly testing alternatives, on desktop Evolution does something like that. Google allows setting more emails address on the web UI too, not sure right now how the email client would get that list.
@pvuorela personally I would like a mix of both methods -
Have a list of predefined aliases I can chose from but also allow the immediate manual editing of the from field my reasoning for this is that if you use a mail provider that allows the use of a unique identifier part in your e-mail address like gmailuser+identifier@domain or postfixuser-identifier@domain you may want to write an e-mail with such an identifier, the workflow that has you go to settings and add an alias just to be able to send from such an address is encumbering and slows everything down.
Ideally I would also like to see that when I reply to a message I can easily set my From: field to whatever the address was that the message was sent to, it should not be default because that would be very annoying with things like mailing lists but it should be in the dropdown as an option.
Of all the implementations I have seen (gmail, nextcloud, thunderbird) I like Thunderbirds method most because it combines both, on the one hand I can preset different “identities” which may have different signatures, smtp servers etc. and on the other hand I can also just manually set my From: while I am writing an e-mail, to me that is the best of both worlds.
Yea, you sounded like heavier user of this feature. I can understand your preference there for how this would work, even if it feels a bit controversial to offer such a field for generic user. Anyhow, for order of adding features, I’d think the preset way should be coming first.
Tested btw that Thunderbird too. Choosing ‘modify sender address’ from drop-down menu, it shows a dialog with warning text about if mail provider supports it the address can be temporarily set to +something etc. Cancel and ok options, and a check box for ‘don’t show this again’.
If we add support, think we need some similar acknowledgement for “i know what i’m doing”.