diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/state/templates.go | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/lib/state/templates.go b/lib/state/templates.go index 88c5eeae..92a25b72 100644 --- a/lib/state/templates.go +++ b/lib/state/templates.go @@ -8,6 +8,7 @@ import ( "git.sr.ht/~rjarry/aerc/config" "git.sr.ht/~rjarry/aerc/lib/parse" "git.sr.ht/~rjarry/aerc/models" + "github.com/danwakefield/fnmatch" sortthread "github.com/emersion/go-imap-sortthread" "github.com/emersion/go-message/mail" ) @@ -218,8 +219,10 @@ func (d *templateData) Peer() []*mail.Address { to, _ = d.headers.AddressList("to") } for _, addr := range from { - if d.myAddresses[addr.Address] { - return to + for myAddr := range d.myAddresses { + if fnmatch.Match(myAddr, addr.Address, 0) { + return to + } } } return from |