After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 714922 - Multiple email addresses per account
Multiple email addresses per account
Status: RESOLVED FIXED
Product: geary
Classification: Other
Component: accounts
master
Other All
: High normal
: 0.10.0
Assigned To: Geary Maintainers
Geary Maintainers
: 724118 726636 733195 737034 744634 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2012-10-05 10:01 UTC by Jim Nelson
Modified: 2015-03-05 13:57 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Patch: Rebase "wip/714922-multiple-addresses" onto "master" (26.80 KB, patch)
2015-02-03 22:43 UTC, Marvin W
none Details | Review
Patch: "[WIP] Fix #714922: Multiple email addresses per account" (29.86 KB, patch)
2015-02-08 13:21 UTC, Marvin W
none Details | Review
Patch "Fix bugs, start adding support for multiple from + sender field" (10.94 KB, patch)
2015-02-11 01:03 UTC, Marvin W
none Details | Review
Patch "Add support for sender to RFC822.Message" (3.98 KB, patch)
2015-02-11 01:13 UTC, Marvin W
none Details | Review
Patch "Read alternate_email as RFC822 emails" (1.80 KB, patch)
2015-02-11 03:22 UTC, Marvin W
none Details | Review

Description Charles Lindsay 2013-11-21 23:13:04 UTC


---- Reported by jim@yorba.org 2012-10-05 15:01:00 -0700 ----

Original Redmine bug id: 5964
Original URL: http://redmine.yorba.org/issues/5964
Searchable id: yorba-bug-5964
Original author: Jim Nelson
Original description:

This is distinct from #3827 and has been reported at
https://bugs.launchpad.net/geary/+bug/1062572

It's possible for Gmail (and other mail systems) to support multiple email
addresses per account. For example, my Gmail account also pulls mail from my
other non-Gmail accounts. In turn, I can also send and reply to messages from
any of those email addresses. In the composer, I can select from them with a
dropdown menu.

The Launchpad ticket links to a screenshot
(http://www.activewebhosting.com/faq/images/email-thunderbird-11.gif) which
shows how Thunderbird offers this feature.

Related issues:
related to geary - Feature #3827: multiple accounts (Fixed)
related to geary - 6071: always show the 'To:' header (Fixed)
related to geary - Feature #6647: support for forward-only accounts (Open)
duplicated by geary - Feature #6631: Multiple identities per account (Duplicate)



---- Additional Comments From geary-maint@gnome.bugs 2013-05-15 15:25:00 -0700 ----

### History

####

#1

Updated by Jim Nelson about 1 year ago

  * **Tracker** changed from _Bug_ to _Feature_

####

#2

Updated by Jim Nelson 10 months ago

  * **Category** set to _client+engine_

####

#3

Updated by Jim Nelson 10 months ago

  * **Category** changed from _client+engine_ to _accounts_

####

#4

Updated by Jim Nelson 10 months ago

  * **Target version** changed from _0.3.0_ to _0.4.0_

####

#5

Updated by Maia Kozheva 8 months ago

It should be possible to set not only different email addresses, but different
names as well.

####

#6

Updated by Christopher Small 7 months ago

This one is absolutely vital for me. So far I love Geary, but I really can't
use it until this feature is added.

####

#7

Updated by Jim Nelson 6 months ago

  * **Target version** changed from _0.4.0_ to _0.5.0_



--- Bug imported by chaz@yorba.org 2013-11-21 23:13 UTC  ---

This bug was previously known as _bug_ 5964 at http://redmine.yorba.org/show_bug.cgi?id=5964

Unknown milestone "unknown in product geary. 
   Setting to default milestone for this product, "---".
Setting qa contact to the default for this product.
   This bug either had no qa contact or an invalid one.
Resolution set on an open status.
   Dropping resolution 

Comment 1 Jason Pezzimenti 2013-12-07 12:18:17 UTC
Commit to fix bug 5964.
Comment 2 Charles Lindsay 2013-12-18 19:14:32 UTC
This feature should include letting you pick from among the email addresses in an account (at least) as the From: address when replying in the composer.
Comment 3 Jim Nelson 2014-02-11 18:39:11 UTC
*** Bug 724118 has been marked as a duplicate of this bug. ***
Comment 4 Khurshid Alam 2014-03-03 15:14:14 UTC
Does this feature also allow us to setup a account for smtp only? Some email providers also provides several email aliases, & you can also send mail from those aliases. 

For example, I want to send mail from email-1 & email-2 (email-2 being an alias), but don't want to setup imap for email-2, as it will only create a duplicate account in geary. (Thunderbird & Evolution can do this.)
Comment 5 Charles Lindsay 2014-03-03 18:54:24 UTC
I believe our current thinking was that this would only let you change the From header, and that the main account's SMTP server would be used to send the message still.  I know gmail for example allows for this scenario by letting you verify other addresses to use from your gmail account, and I've seen this feature in other mail providers too.  Many SMTP servers don't even check the From header for outgoing mail if you've authenticated.  If there's something we're missing here, we're happy to reconsider.
Comment 6 Charles Lindsay 2014-03-18 17:42:04 UTC
*** Bug 726636 has been marked as a duplicate of this bug. ***
Comment 7 Charles Lindsay 2014-03-18 17:42:31 UTC
This is something we should work on soon.
Comment 8 Khurshid Alam 2014-03-21 09:37:36 UTC
"I believe our current thinking was that this would only let you change the From
header, and that the main account's SMTP server would be used to send the
message still."

Does it also count for email-addresses in my domain(IMAP/SMTP) as well? I don't want it to be Gmail specific. 

BTW, I can still do this(something similar) in Geary-4.x. I can use separate email address in "Email address:" field when adding "other" account in geary & fill up IMAP & SMTP details for gmail. So when I send mail, "From" header is different.

However in this way we can use only two email-addresses & is not ideal for conversation view.
Comment 9 Jim Nelson 2014-03-21 18:27:43 UTC
(In reply to comment #8)
> Does it also count for email-addresses in my domain(IMAP/SMTP) as well? I don't
> want it to be Gmail specific. 

Whatever we do, we won't make it Gmail-specific.  What the comment you quoted meant to suggest was that the email being sent can have any From: header you configure Geary to support, but the SMTP account used to transmit the email will be your primary account.

This does assume that the SMTP server is configured to allow that, and I know that not every service does.  If you (or anyone) needs Geary to use a different set of credentials to send an email with a From: header different than the primary account's credentials, we'll need to ticket that as separate work.
Comment 10 Charles Lindsay 2014-03-22 00:44:06 UTC
I've got a head start on this up at wip/714922-multiple-addresses.

Right now, you have to manually add alternate email addresses by editing your .ini file and adding a line like:

alternate_emails=other@example.com;yet-another@example.com;

With some alternate email addresses, Geary will display them like "Your Name <alternate@address> via primary@address" in the From dropdown in the composer.  For replies, you can only select addresses on the account receiving the email, but for new messages you can select any email address on any account.  I've also made it so the conversation list displays "Me" for all addresses belonging to an account.

The bulk of the remaining work, I think, is to build the interface in the account editor so you don't have to edit the ini file to add addresses.  It could probably look something like the accounts dialog account selector page, but inside the account edit page.

I also haven't tested this very thoroughly, but I did run through some basic operations and it seems to work fine.  (Note: if using gmail, you have to add the alternate email address in gmail first, otherwise it resets the From address to the primary address for you.  Other ISPs may impose similar limitations.)  It changes a lot of code in the composer, so things like the logic for who shows up in replies, and proper saving of drafts, should be tested.
Comment 11 nw9165-3201 2014-05-27 08:49:37 UTC
Dear Geary developers,

any update on this one?

Please add this feature, it's very important IMHO.

And please make it so that one can use a different SMTP server as requested over there:

https://bugzilla.gnome.org/show_bug.cgi?id=714805

It would be much appreciated.

Regards
Comment 12 Robert Schroll 2014-07-15 16:10:16 UTC
*** Bug 733195 has been marked as a duplicate of this bug. ***
Comment 13 Federico Bruni 2014-07-30 13:13:53 UTC
So Bug 714805 addresses the scenario described by Jim in comment 9: "If you (or anyone) needs Geary to use a different set of credentials to send an email with a From: header different than the primary account's credentials, we'll need to ticket that as separate work."

I'm interested in this feature (even if also this issue would solve my problem).
Comment 14 Robert Schroll 2014-09-21 02:13:48 UTC
*** Bug 737034 has been marked as a duplicate of this bug. ***
Comment 15 Nikos Roussos 2014-09-26 11:20:55 UTC
(In reply to comment #10)
> I've got a head start on this up at wip/714922-multiple-addresses.
> 
> Right now, you have to manually add alternate email addresses by editing your
> .ini file and adding a line like:
> 
> alternate_emails=other@example.com;yet-another@example.com;

I built this branch and it seems to work pretty good. It would be great if you can develop the UI for some future release.
Comment 16 Nikos Roussos 2014-12-17 19:24:29 UTC
(In reply to comment #15)
> (In reply to comment #10)
> > I've got a head start on this up at wip/714922-multiple-addresses.
> > 
> > Right now, you have to manually add alternate email addresses by editing your
> > .ini file and adding a line like:
> > 
> > alternate_emails=other@example.com;yet-another@example.com;
> 
> I built this branch and it seems to work pretty good. It would be great if you
> can develop the UI for some future release.

Or at least merge this branch to master and keep this bug open for the pending UI work ;)
Comment 17 Marvin W 2015-02-03 22:43:55 UTC
Created attachment 296056 [details] [review]
Patch: Rebase "wip/714922-multiple-addresses" onto "master"
Comment 18 Nikos Roussos 2015-02-04 11:08:38 UTC
That's awesome!

I built it and it works great.

I built a repo for it here:
https://copr.fedoraproject.org/coprs/comzeradd/geary-git/
Comment 19 Nikos Roussos 2015-02-05 11:10:44 UTC
It seems to work only on replies. On new messages regardless of what identity you pick it's sent out with your default account address.
Comment 20 Marvin W 2015-02-08 13:21:24 UTC
Created attachment 296378 [details] [review]
Patch: "[WIP] Fix #714922: Multiple email addresses per account"

- Fixes the aforementioned bug.
- remove duplicated "from" field and change it from string to MailboxAddresses
- structure can now handle multiple addresses in "From:" field and a "Sender:" field, but is not read from config file, neither supported by geary's rfc822 message implementation yet.

Still missing:
- Full support for multiple addresses in a single from field and sender field support for sending messages
- Sender field when reading messages (not part of this bug though)
- New config file format to store identities (consisting of rfc822 addresses for from field and a single rfc822 address for sender field)
- User interface to configure identities.
Comment 21 Nikos Roussos 2015-02-10 13:45:27 UTC
Works smoothly. The only important feature missing right now IMO is the option to choose the "From" email when replying. For instance when receiving an email from a mailing list Geary can't tell which address this was sent to and just chooses the default.
Comment 22 Jim Nelson 2015-02-10 21:50:24 UTC
I forgot to mention last week that I've started work on the user interface portion of the ticket, i.e. a way in the Accounts dialog to add more email addresses.  I also forgot to push the new branch up to git.gnome.org.  I'll make sure it's up before the end of today.  It incorporates mar-v-in's rebased patch and my preliminary UI work.  I'll also include mar-v-in's lastest patch.
Comment 23 Marvin W 2015-02-10 23:51:19 UTC
> For instance when receiving an email from a mailing list Geary can't tell which address this was sent to and just chooses the default.

I agree that this is a problem, but I guess from UI perspective, it's a bad idea to always show the from field. Maybe it should only be shown if Geary is unsure about what should be selected?
Comment 24 Jim Nelson 2015-02-11 00:14:48 UTC
I've pushed the branch up to wip/714922-multiple-addresses-2.  mar-v-in, I believe I've properly merged your second patch, but it would helpd if you could double-check.  If you work on this more, please base your future patches off this branch.  Thanks!
Comment 25 Marvin W 2015-02-11 01:03:46 UTC
Created attachment 296551 [details] [review]
Patch "Fix bugs, start adding support for multiple from + sender field"

I guess you either did not upload the branch completely or did not apply the second patch properly, nonetheless I uploaded the single commit patch.
Comment 26 Marvin W 2015-02-11 01:13:41 UTC
Created attachment 296552 [details] [review]
Patch "Add support for sender to RFC822.Message"

This is not tested deeply yet and might be controversy as it changes the meaning of the "sender" field in rfc822 message (it was "first from or whatever" before, now is rfc822 sender field)
Comment 27 Marvin W 2015-02-11 01:23:51 UTC
Another idea for the from field problem when replying: Geary could parse the "Received: (...) for <mail@example.com>" headers, the oldest in path known address should be the reply from field. This should work for all kinds of mailing lists etc.

Another current bug: when replying to a thread, where the last message is send with an alternative address, reply does not set the from field correctly.

@Nikos Roussos: You can still open the full editor while replying by clicking detach (ctrl-d)
Comment 28 Jim Nelson 2015-02-11 02:37:26 UTC
mar-v-in, I *think* your patch in comment 25 is applied in its entirety to wip/714922-multiple-addresses-2.  Could you double-check?

As far as the Sender, change, I would prefer to file a separate ticket and work that out later.  This is going to be a large enough patch that we should stick to its details.

Nikos, have you tried out this From: issue with other mailers, i.e. Thunderbird or Gmail?  How do they deal this (if at all)?
Comment 29 Marvin W 2015-02-11 03:21:33 UTC
@Jim: sorry, it appears I pulled the branch just between you pushed the first and the second patch.

I'll add another patch in a few minutes that allows storing full rfc822 addresses in config, if you want to have a custom name next to your alternate email address.
Comment 30 Marvin W 2015-02-11 03:22:10 UTC
Created attachment 296555 [details] [review]
Patch "Read alternate_email as RFC822 emails"
Comment 31 Nikos Roussos 2015-02-11 08:21:36 UTC
@Jim Thunderburd also doesn't manage to discover the correct address but it gives you the chance to edit the "From" field. I guess that detaching the composer is a good workaround for now.
Comment 32 Jim Nelson 2015-02-11 23:45:55 UTC
I've pushed up your latest patch and some final touches on the UI portion of the work.  You can now add and remove additional email addresses to an account and have them stored persistently in the .ini file.

So, what's left here?  I haven't done any serious testing of this branch in terms of sending and receiving from alternate emails, but will soon.  What else is remaining?
Comment 33 Robert Schroll 2015-02-17 14:53:53 UTC
*** Bug 744634 has been marked as a duplicate of this bug. ***
Comment 34 Jim Nelson 2015-02-24 21:56:37 UTC
Has anyone had the chance to try the patch at wip/714922-multiple-addresses-2?
Comment 35 Federico Bruni 2015-02-24 22:47:56 UTC
I'd like to test it. Just downloaded and built that branch but I can't see any change..
I cannot edit the From field; I cannot add an identity to an existing account in the Accounts dialog.

What should I do?

What's the commit? Nnothing relevant on top of that branch and I've tried several 'git log --grep' with no success...
Comment 36 Federico Bruni 2015-02-25 07:57:11 UTC
Sorry, forget my last comment: I was checking out master in a new local branch instead of checking out the remote branch.

I just tried it and it seems to work great. I receive emails of another provider/domain into my gmail account. When I reply to an email sent to that domain, geary sets automatically the correct From: address.
Comment 37 Marvin W 2015-02-25 08:50:51 UTC
I noticed that when I use an identity with email and name (added in the rfc822 form "Test <test@example.com>"), this does work (while sending and receiving emails), however it is displayed wrongly in the identity editor (as "<b>Test <test@example.com></b>") I guess this is due to the HTML no longer being valid, when "<" is in there, so probably you need to do some escaping here. 

The editor also allows to add invalid identities (eg "test@test@example.com") that will then get broken when parsed as rfc822 address (will become "test@test"). Maybe you should do sth. like parsing the input as rfc822 address and convert back to string, if it matches the input, the input is valid, else do not allow adding the address.
Comment 38 Jim Nelson 2015-03-04 03:23:05 UTC
I've pushed up fixes for these problems.  The only proviso is that the current patch doesn't properly support the full RFC822 syntax for alternate addresses (at least, that's how it looks to me; I haven't really tested it).

I'll look more at this tomorrow and the day after.  If it looks good, and no on finds anything else, I'll see about merging it into master.
Comment 39 Marvin W 2015-03-04 18:23:55 UTC
alternate_emails=Test <test@example.com>;example@example.com;
does work and will allow to send with identities "Test <test@example.com>" and "[Name] <example@example.com>"

However, using the account settings to modify the additional addresses will change from rfc822 address to mail address only, resulting in
alternate_emails=test@example.com;example@example.com;
Comment 40 Jim Nelson 2015-03-05 00:02:24 UTC
Th original design was for the alternate emails only to store the simple format (i.e. test@example.com) and there were places in the code that wouldn't properly handle the expanded format (Test <test@example.com>).  I've gone through and done some cleanup to make that happen.  So, you can now use the expanded format in the Accounts editor and it will be saved properly; the composer lists them with the real name and uses it appropriately when sending, and so forth.

One upside to this is that now "jim@yorba.org" and "Jim Nelson <jim@yorba.org>" are recognized as the same address in the code, and not just in the new alternate-email code.  So, a bit of work to make this happen, but I think it's worth it.

I'll let this sit one more day for people to try out (thanks for your continued testing, mar-v-in and Federico!).  If all goes well, I don't see any reason this can't land this week.
Comment 41 Kate Adams 2015-03-05 00:24:51 UTC
Jim, just to let you know, I've been testing it for a bit and it works flawlessly here. Thanks a lot!
Comment 42 Marvin W 2015-03-05 00:40:22 UTC
Works great and fulfills all my needs now. Thanks!
Comment 43 Jim Nelson 2015-03-05 01:31:57 UTC
Two votes of confidence is enough for me.  I've merged and pushed the branch to master.  Nice to get this long-standing ticket off our plate.

Please note that I've pushed the commit's author as Charles Lindsay, who did the brunt of the early work, finding all the nooks and crannies in Geary that were affected by the addition of alternate emails.  Big thanks to everyone who helped out on top of that, with code and testing.

Pushed to master, commit 127045