It is compairing the domains in the Return-Path, Sender, and From headers to the domain of the person receiving the email.
The condition will actually flag messages anytime the domain in the Return-Path, Sender, or From headers are different than the domain of the person receiving a copy of the message. If you apply the rule to the remote queue, it can flag messages that are being sent out. You can control this when editing the rule, click on Local & Remote queue in the rule editor and uncheck Remote Queue.
This message is not matched by the External Sender condition.
Fri 2023-11-03 07:34:25.533: * Message return-path: arron@localdomain.com
Fri 2023-11-03 07:34:25.533: * Message from: arron@localdomain.com
Fri 2023-11-03 07:34:25.533: * Message to: george@localdomain.com
Fri 2023-11-03 07:34:25.533: * Message subject: Test 405
Fri 2023-11-03 07:34:25.533: * Message ID: <WC20231026160357.880001@localdomain.com>
Fri 2023-11-03 07:34:25.533: Start Content Filter results
Fri 2023-11-03 07:34:25.537: * Matched 0 of 1 active rules
This message is matched by the external sender condition:
Fri 2023-11-03 07:37:39.683: * Message return-path: arron@localdomain.com
Fri 2023-11-03 07:37:39.683: * Message from: arron@externaldomain.com
Fri 2023-11-03 07:37:39.683: * Message to: george@localdomain.com
Fri 2023-11-03 07:37:39.683: * Message subject: Test 406
Fri 2023-11-03 07:37:39.683: * Message ID: <WC20231026160357.880001@localdomain.com>
Fri 2023-11-03 07:37:39.683: Start Content Filter results
Fri 2023-11-03 07:37:39.684: * Message matched rule: 11 "Check External Sender" (Hits: 2)
Fri 2023-11-03 07:37:39.689: * Action: Message moved to bad queue (this action ends further rule processing)
Fri 2023-11-03 07:37:39.689: * Matched 1 of 1 active rules
We can repeat the same process, changing the email address in the Return-Path, Sender, and From headers. As long as the domain in any one of those headers does not match the domain of the recipient, then the message will be flagged by the condition. Also, the condition is looking at the email address it is send that specific copy of the message to, in order to determine the domain of the recipient. It is not looking at the To or CC headers.