astroidmail / astroid

A graphical threads-with-tags style, lightweight and fast, e-mail client for Notmuch
http://astroidmail.github.io
Other
613 stars 65 forks source link

Account manager picks wrong account for forwarded email #682

Open varac opened 4 years ago

varac commented 4 years ago

I get a message sent my account B, which is a forward of my account A. When I reply to this mail, the account manager wrongly picks account A as sender addr. and ignores the select_query values I set in the config.

I see this in the logs after hitting 'r' for reply:

[11:11:41] [0x00007fce68c65d00] [M] [debug] ac: found address involved in conversation: varac@varac.net
[11:11:41] [0x00007fce68c65d00] [M] [debug] same account: true

This looks like the code responsible for it: https://github.com/astroidmail/astroid/blob/526f73a6f5b7d8a3351feb0f44d98221c26c1c36/src/account_manager.cc#L180

for (Address &a : msg->all_to_from().addresses) {
  if (is_me (a)) {

I noticed that because of the forward, I have this header field (and it's the only header field with account A):

Envelope-to: varac@varac.net

and I guess that why the wrong account is chosen. So the accountmanager should ignore the Envelope-to field imo.

Or, as an alternative, users should be able to configure whether select_query or the auto-matching code should outvote each other. Does this make sense ?

gauteh commented 4 years ago

Varac writes on April 27, 2020 11:26:

Or, as an alternative, users should be able to configure whether select_query or the auto-matching code should outvote each other. Does this make sense ?

As in 'select_query' takes precedence?

varac commented 4 years ago

As in 'select_query' takes precedence?

Yes, that's the word I was looking for :)

gauteh commented 4 years ago

Varac writes on April 27, 2020 12:02:

As in 'select_query' takes precedence?

Yes, that's the word I was looking for :)

I think that makes sense.