Restrict email within an organization

As a G Suite administrator, you might want to restrict emails between certain users. For example, a school district might want to prevent high school students from sending email to elementary school students.

You can do this by creating one compliance rule for the sender and one for the recipient. For more information, see Set up rules for content compliance.

Create 2 compliance rules

In the example below, high school and middle school students will be prevented from sending mail to elementary school students.

Step 1: Create a sending rule

Create a sending rule to apply a header to internal messages that identifies a user type (for example, teacher, elementary student, or high school student).

 

  1. Sign in to your Google Admin console.

    Sign in using your administrator account (does not end in @gmail.com).

  2. From the Admin console Home page, go to Apps Nest and then image. G Suite Nest and then image. Gmail Nest and then image. Advanced settings.
    Tip: To see Advanced settings, scroll to the bottom of the Gmail page.
  3. On the left, select the organization of the users that you want to apply the sending rule to, such as High School Students.
  4. Scroll to the Compliance section, hover over the Content compliance setting, and choose an option:
    • Click Configure.
    • If the setting is already configured, click Edit or Add another.
  5. Add or update a description for the rule, such as Mark all messages sent by High School Students with high-school header.
  6. Under Email messages to affect, verify that only the Internal - sending box us checked.
    Don’t add any expressions under Add expressions that describe the content you want to search for in each message.
  7. Under If the above expressions match, do the following, select Modify message from the drop-down menu.
  8. Under Headers, check Add custom headers.
  9. Click Add.
  10. Under Add header, enter user-type for Header key and a name for Header value. For example: X-user-type: high-school
  11. Click Save.
  12. Click Add Setting or Save to save the compliance setting.

Repeat the above steps for additional organizations that you wish to prevent from sending messages to another organization, such as middle school students.

Step 2: Create a receiving rule

Create a receiving rule for users who shouldn’t receive email from some other internal users.

  1. From the Admin console Home page, go to Apps Nest and then image. G Suite Nest and then image. Gmail Nest and then image. Advanced settings.
    Tip: To see Advanced settings, scroll to the bottom of the Gmail page.
  2. On the left, select the organization of the users that you want to apply the receiving rule to, such as Elementary School Students.
  3. Scroll to the Compliance section, hover over the Content compliance setting, and choose an option:
    • Click Configure.
    • If the setting is already configured, click Edit or Add another.
  4. Add or update a description for the rule, such as Prevent elementary school students from receiving email from messages with high-school and middle-school headers.
  5. Under Email messages to affect, check Internal - receiving.
  6. Under Add expressions that describe the content you want to search for in each message, click Add.
  7. Under Expressions, select Advanced content match in the drop-down list.
  8. Under Location, select Full headers.
  9. Under Match type, select Not matches regex.
  10. Under Regexp, enter ^X-user-type: (high-school|middle-school)$.
  11. Under Regex Description, enter Reject message if it is marked with high-school or middle-school.
  12. Click Save.
  13. Under If the above expressions match, do the following, select Reject message from the drop-down menu.
  14. Under Customize rejection notice, enter a description for the sender to receive so that they understand why the message was returned to sender.
    For example, This message has been rejected because your organization is not allowed to send email to the Elementary School Students organization.
  15. Click Add setting.
  16. Click Save.
Was this helpful?
How can we improve it?