4ch1m / mozext

Extensions / Add-Ons for Mozilla Firefox and Mozilla Thunderbird
https://www.achimonline.de/mozext
Mozilla Public License 2.0
20 stars 9 forks source link

Default signature is not applied (regexps in application rules could help) #65

Open AlexanderAmelkin opened 2 years ago

AlexanderAmelkin commented 2 years ago

I have 4 signatures:

  1. Short English (default, no matching rule)
  2. Full English (no matching rule)
  3. Short local (rule *@mycompany.mydomain, all recipients must match)
  4. Full local (no matching rule)

The idea was that for all recipients in mycompany.mydomain, signature 3 must be used, while for all others (default) it must be signature 1.

In fact, signature 1 is never used.

It would be must better if the match field was a regexp (perl-style), so one could use negations, grouping, etc.

4ch1m commented 2 years ago

The idea was that for all recipients in mycompany.mydomain, signature 3 must be used, while for all others (default) it must be signature 1.

The idea is that (whilst composing) every recipient must match with any of the given patterns:

image

As soon as there is even one recipient that doesn't fit to any pattern, the auto-switch won't get triggered.

In fact, signature 1 is never used.

Please provide a more concrete example with detailed test-data.

It would be must better if the match field was a regexp (perl-style), so one could use negations, grouping, etc.

Not everybody out there is a programmer. Using an asterisk as placeholder seems more user-friendly for me.

AlexanderAmelkin commented 2 years ago

The idea was that for all recipients in mycompany.mydomain, signature 3 must be used, while for all others (default) it must be signature 1.

The idea is that (whilst composing) every recipient must match with any of the given patterns:

Yes, I get that. My complain is that (IMO) if a match fails for some of the signatures, other signatures should still get checked, and if no rule matched, then as a final step the default signature should be used. Otherwise I don't get the idea of the 'default' signature.

image

As soon as there is even one recipient that doesn't fit to any pattern, the auto-switch won't get triggered.

That is clear, but that applies to that single signature for which the rule failed, doesn't it?

In fact, signature 1 is never used.

Please provide a more concrete example with detailed test-data.

Case 1: A message to colleague@mycompany.mydomain Expected result: "Short local" signature (by auto-switch, based on the recipient match) Actual result: "Short local" signature, as expected

Case 2: A message to john.doe@somewhere.com Expected result: "Short English" signature (the default one) Actual result: No signature at all

It would be must better if the match field was a regexp (perl-style), so one could use negations, grouping, etc.

Not everybody out there is a programmer. Using an asterisk as placeholder seems more user-friendly for me.

For non-programmers out there we could have a checkbox "Use regular expressions" that would be unchecked by default. Anyway, even if regexps are not added, I believe that even non-programmers would benefit from the ability to negate the pattern (auto-switch if none of the recipients match any of the provided patterns). You could then build more sophisticated rule cascades and probably even eliminate the need for the 'default' attribute for signatures (which anyway doesn't seem to work).