GNOME Bugzilla – Bug 213863
Allow multiple e-mail aliases for reply account matching
Last modified: 2015-08-21 21:20:28 UTC
The summary may be vague, but here's my scenario. I have an IMAP account set up for my work e-mail. I have my e-mail address set as dan.hensley@ata-engineering.com. When I get e-mail sent to me at that address, Evo automatically sets my From address to the right one. However, dan.hensley@ata-e.com is another valid address for the same account. Naturally this one doesn't match, so my e-mail From address is set to another account, which is my default. I would like to be able to specify multiple aliases (or perhaps aliases by regexp?) for a given mail account. This capability would be nice for other scenarios that I can imagine as well (someone sends you e-mail to two different accounts, but you always want your From address to be from one of them). Another potential solution for this is to have per-folder default e-mail addresses.
feature = future
I had implemented this feature myself, because I found it useful. You can attach a list of alternate addresses or a regexp to each account, which will be used in just the way you suggest. Then I found this bugzilla entry, so I'm attaching the diff. This is against today's HEAD.
Created attachment 40959 [details] [review] Patch against HEAD
Here's an updated patch. It correctly handles attempts to use invalid regexps (I didn't realize you had to regfree if regcomp returned an error), and patches the new account druid to only let you "Next>" if you've entered a valid one.
Created attachment 40960 [details] [review] Updated patch
This new patch also allows you to specify a list of addresses *not* to add to the Cc: list when you do a "reply to all". So for example, I could set my work account's "alternate addresses" to the regexp ".*@(zeroknowledge\.com|zks\.net)$" so that replying to any work-related email (including mailing lists, etc.) will use the work account. Then I set my "remove from cc list" regexp to "ian|iang|ian\.goldberg@(zeroknowledge\.com|zks\.net$" so that only my own addresses get removed. This patch is also cleaned up a bit, and includes a detailed ChangeLog.
Created attachment 40975 [details] [review] Patch file
*** bug 205848 has been marked as a duplicate of this bug. ***
related to bug 215161
setting the first and second patch to "obsolete" since only the latest is correct.
does this patch even still apply to current code?
I dont think most of the files dont even exist today. Moving it to obsolete.
The feature would be nice to have though. Or maybe configure it with folders. A lot of people triage bugs in folders, and usually the From: associated is unique for a folder. I think claws mail does that, and it seems very handy.
Created attachment 182219 [details] sample implementation of aliases exclusion
I sketched the implementation for the feature described in the comment 6 by ian. It uses gconf to store the list of "alternate addresses", so they can be removed from To: and Cc: headers. Please treat this as a pseudocode, because I had no chance to compile it. The diff was made against evolution-2.32.2-0ubuntu3 sources. Little things missing: - patching the schema (mail/evolution-mail.schemas.in) to include the key as a list of strings like with the headers, - little editor in the preferences window.
Comment on attachment 182219 [details] sample implementation of aliases exclusion >+ while (p) { >+ gint exc_index; >+ gchar *exclude = (gchar *) p->data; >+ >+ exc_index = camel_internet_address_find_address (to, exclude, NULL); >+ camel_address_remove (to, exc_index); >+ >+ exc_index = camel_internet_address_find_address (cc, exclude, NULL); >+ camel_address_remove (cc, exc_index); >+ >+ p = p->next; >+ } There are conditions missing: ... if (exc_index != -1) camel_address_remove (to, exc_index); ... if (exc_index != -1) camel_address_remove (cc, exc_index); ...
For POP/SMTP usage such a feature is _needed_. It should be possible to allocate a mailing list/recipient to one of the available accounts. The contact editor allows to check "Wants to receive HTML mail", an option I don't need, instead "Use account foo when sending to this recipient" would be comfortable, so it not only would work for replies, but also for new emails. Regards, Ralf
(In reply to comment #17) > It should be possible to allocate a mailing list/recipient to one of the > available accounts. That might be bug 215161 and bug 215115 instead.
I added related functionality within a fix for bug #215115, thus I mark this as a duplicate of it. *** This bug has been marked as a duplicate of bug 215115 ***