Open Bug 1774143 Opened 2 months ago Updated 2 months ago

Catchall hints are ignored when header contains the exact email address of an identity


(Thunderbird :: Message Compose Window, defect)

Thunderbird 102


(Not tracked)



(Reporter: bernat, Unassigned)


(Blocks 1 open bug)


User Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Firefox/102.0

Steps to reproduce:

  1. Configure and
  2. has a catchall hint set to *
  3. Reply to an email delivered to and with To field set to

Actual results: is used as the best identity

Expected results: should be used instead

In MailUtils.jsm, getBestIdentity() is checking first for an exact match in the provided hints:

      for (let hint of hints) {
        for (let identity of identities.filter(i => {
          if ( == {
            return [identity, hint];

Then, it looks at the catchall hints:

      // Lets search again, this time for a match from catchAll.
      for (let hint of hints) {
        for (let identity of identities.filter(
          i => && i.catchAll && i.catchAllHint
        )) {
          for (let caHint of identity.catchAllHint.toLowerCase().split(",")) {
            // If the hint started with *@, it applies to the whole domain. In
            // this case return the hint so it can be used for replying.
            // If the hint was for a more specific hint, don't return a hint
            // so that the normal from address for the identity is used.
            let wholeDomain = caHint.trim().startsWith("*@");
            caHint = caHint.trim().replace(/^\*/, ""); // Remove initial star.
            if ( {
              return wholeDomain ? [identity, hint] : [identity, null];

This makes it difficult to override an identity, notably when using mailing lists. The two checks could be reverted and it would work for me. I expect that when providing catchall hints, they have precedence over other stuff.

Blocks: tb102found
You need to log in before you can comment on or make changes to this bug.