Quantcast
Channel: Active questions tagged email - Stack Overflow
Viewing all articles
Browse latest Browse all 29935

Limit G Suite Outgoing mail to N recipient

$
0
0

I'm trying to create a routing rule, which through a regular expression can block the sending of an email if the recipients (To: Cc: and Bcc :) exceed a certain limit

e.g.

(^To:(.*@.*)+(\n|\r\n|\r)|^Cc:(.*@.*)(\n|\r\n|\r)|^Bcc:(.*@.*)(\n|\r\n|\r)){4,}

MIME-Version: 1.0
Date: Mon, 2 Dec 2019 18:51:05 +0100
Message-ID: <msgID-00000-11111-22222A@mail.gmail.com>
Subject: Test
From: Name <email@example.com>
To: Name <email@example.com>, Name <email@example.com>
Cc: Name <email@example.com>
Bcc: Name <email@example.com>
Content-Type: multipart/related; boundary="00000000000046fe3e0598bc3916"

the problem of this regular expression is that the count of occurrences limited to the fields: To, Cc and Ccn stops at the first value found in each row, so it would only match if I change to {3,}

I can not however count email addresses in a header without limiting to those fields, otherwise I could find several email addresses scattered in the header, like msgId, inside the body or in the signature


Viewing all articles
Browse latest Browse all 29935

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>