External email addresses are treated as internal

Problem:

External email addresses are treated as internal by CodeTwo software. As a result, your email rule conditions do not work as expected. For example, rules designed to cover only internal users are also triggered for external users.

Solution:

By default, when external users are added as contacts to your organization's Active Directory, our software treats such users (and their messages) as internal. If this is your case, then conditions/exceptions based on email direction (e.g. Message direction is internal/outgoing) or sender's/recipient's affiliation (e.g. Sender/Recipient is internal/external) might not work correctly in your environment. You can override this behavior by modifying your rule's conditions. See examples below.

How to send emails to external recipients only

If you need a rule that sends emails only to external recipients, and some of them are contacts in your AD, the Recipient is external condition (or the Message direction is outgoing condition) is not a good choice. Instead, you should define an exception not to apply the rule if the recipient's email address matches your domain - see an example in Fig. 1. Use wildcards to match all of your domain's email addresses (if you have multiple domains, separate the address patterns with a semicolon (;), for example: *@codetwo.com; *@codetwo.de). Leave the Conditions tab empty so that the rule applies to all users.

292-1
Fig. 1. Adding an exception that applies only to external emails (excludes internal users from receiving emails).

How to send emails to internal recipients only

If you want a rule that sends emails only to internal recipients, and you have external accounts added as contacts in your AD, you need to avoid using the Recipient is internal condition (or the Message direction is internal condition). Instead, use the Recipient matches email address condition and add a pattern for your company's email addresses by using wildcards (Fig. 2.). If you have more than one domain, separate the addresses with a semicolon.

292-2
Fig. 2. Adding a condition that applies only to internal emails.

How to apply a rule to internal senders only

If you have external users added as contacts to your AD, the Sender is internal condition should not be used. It's better to use the Sender matches email address condition instead, and add a pattern for your domain's email addresses as the value (Fig. 3.).

292-3
Fig. 3. The condition that applies the rule to internal senders only.

How to apply a rule to external senders only

If you have external users added as contacts in your Active Directory, the Sender is external condition might not apply to these external contacts. That is why you should remove this condition and replace it with a new exceptionSender matches email address, and add a pattern for your domain's email addresses in the Value field (Fig. 4.).

292-4
Fig. 4. If a rule should apply to external senders only, you can achieve this by excluding internal senders.

Guidelines for users of older versions of CodeTwo Exchange Rules (Pro)

If you use an older version of CodeTwo software, the available options might look slightly different but the principle is the same. As a reference, see below how to send emails to external recipients only.

  • If you use CodeTwo Exchange Rules 2003/2007/2010/2013, you need to set Scope of recipients to All users and set Exceptions to your domain's email addresses (Fig. 5.).

292-1
Fig. 5. Configuration of exceptions in CodeTwo Exchange Rules (2013).

  • In CodeTwo Exchange Rules Pro 1.x, leave the Scope of recipients empty, set Exceptions to E-mail, and type in your domain name(s) as in Fig. 6.

292-2
Fig. 6. Configuration of exceptions in CodeTwo Exchange Rules Pro 1.