diff options
author | Jason Cox <me@jasoncarloscox.com> | 2023-10-12 10:38:39 -0400 |
---|---|---|
committer | Robin Jarry <robin@jarry.cc> | 2023-10-22 15:12:45 +0200 |
commit | 863e124e8437ac2f5a92fe3f291b7e7e022787fc (patch) | |
tree | 54aca238e0c622b6a34e4095830c45c264c0fabf /commands/msg/invite.go | |
parent | 8fdabbc4bfcaf8f0214a66777336a356cc2a0616 (diff) | |
download | aerc-863e124e8437ac2f5a92fe3f291b7e7e022787fc.tar.gz |
accounts: allow fnmatch-style wildcards in aliases
Wildcard aliases make it possible to always reply from the same address
to which a message was addressed, which is useful for catch-all email
domains. Support fnmatch-style wildcards in only the address portion of
an alias.
When replying to a message that matches a wildcard alias, substitute the
matching email address for the wildcard address, but keep the name
specified with the wildcard address. For example, when the alias
"Someone Awesome" <*@someone.com> is present, the reply to an email
addressed to "Someone" <hi@someone.com> would be from
"Someone Awesome" <hi@someone.com>.
Signed-off-by: Jason Cox <me@jasoncarloscox.com>
Acked-by: Robin Jarry <robin@jarry.cc>
Diffstat (limited to 'commands/msg/invite.go')
-rw-r--r-- | commands/msg/invite.go | 21 |
1 files changed, 1 insertions, 20 deletions
diff --git a/commands/msg/invite.go b/commands/msg/invite.go index 76864f9a..60107480 100644 --- a/commands/msg/invite.go +++ b/commands/msg/invite.go @@ -78,26 +78,7 @@ func (invite) Execute(args []string) error { return fmt.Errorf("no participation status defined") } - conf := acct.AccountConfig() - from := conf.From - - // figure out the sending from address if we have aliases - if len(conf.Aliases) != 0 { - rec := newAddrSet() - rec.AddList(msg.Envelope.To) - rec.AddList(msg.Envelope.Cc) - // test the from first, it has priority over any present alias - if rec.Contains(from) { - // do nothing - } else { - for _, a := range conf.Aliases { - if rec.Contains(a) { - from = a - break - } - } - } - } + from := chooseFromAddr(acct.AccountConfig(), msg) var to []*mail.Address |