Skip to content

Auto switch only when all recepients match with a domain not working #96

@stmichaelis

Description

@stmichaelis

I have the exact use case fitting this implemented feature request: #51

Unfortunately, this does not seem to work (completely) for me. Simplified scenario: I have a signature for external recipients, which is set as default, and a signature for internal recipients. The latter should be used in cases where all addressees are internal only. The "auto switch" field is populated like *xyz.de,*xyz.com as multiple domains count as internal.

The signature switches fine when adding emails matching the first pattern (ending on xyz.de). But the signature still switches back to external once I add another email matching the second pattern, treating this as external.

Workaround:
Trying to understand the source code in

let anyAutoSwitchItemMatchesWithAllRecipients = (autoSwitchItems, recipients) => {
and the way regexp are used for the matching, I replaced the comma separating email patterns with | in the auto switch field, which should be the regexp-OR operator for matching multiple patterns?
Using this separator, the auto switch works as intended. I wonder about the exact why and implications, and why the pattern matching works for the other case, when the "all recipients need to match one of the criteria" is unchecked.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions