Logout

Alt-N Discussion Groups > MDaemon Discussion Groups > MDaemon Content Filter > Count recipients and/or copy "cc" to "bcc"

 [F] Alt-N Discussion Groups  / MDaemon Discussion Groups  / MDaemon Content Filter  /

Count recipients and/or copy "cc" to "bcc"

[May, Klaus]
Klaus May
Newbie
Newbie
Posts: 15
Klaus May - 03:04am, Sep 8 2021

Hello,
we've got team members who sometimes send out mails like "I will be out office ..." to a dozens of our customers, but instead of sending it by "BCC", they "CC" it (sigh). So they are like shouting out loud our customer list.

So I wonder, if it's possible to count the number of recipients in the cc - field and then either
a) decline forwarding it (and send an info back to the sender); or/and
b) copy cc to bcc (and send an info back to the sender).

Best regards
Klaus

  All MessagesOldest ItemsOlder ItemsNewer ItemsNewest Items

Arron Caruth - Sep 8, 2021 8:51 am (#1 Total: 1)  

Guest User  

Photo of Author
Posts: 1
There are a couple of things to consider at this point.  

1. By the time the content filter processes the messages, a copy of the message has already been created for each recipient. This means if there are 10 recipients, the content filter will process 10 copies of the message and if you choose to have the content filter send a note back to the sender, the sender will get 10 emails.

2. The existence of the To and CC headers (There should be NO BCC header) is for user convenience.  They are not needed in order for the message to be delivered.  

I came up with a couple of ideas, the one I think is the best is to use a regular expression to attempt to determine how many recipients are listed in the To or CC header.  A rule like the following should work:

[Rule028]
RuleName=New Rule #28
Enable=Yes
ThisRuleCondition=All
ProcessQueue=BOTH
Condition01=CC|reg exp|AND|(.*>,){3,}|
Action01=remove header|"CC",""

This rule is searching the CC header for matches of the regular expression "(.*>,){3,}"  Basically its looking for at least 3 matches of the pattern ".*>,".  And that pattern is looking for any characters followed by a ">,". It looks for that pattern 3 times which means its looking for at least 4 recipients in the CC header.  If it matches the pattern the CC header is deleted from the email. I'm assuming you'll want to check for more than 4 recipients, in which case you just need to change the "3" to a higher number.  Remember if you set it to 50, its actually going to look for 51 recipients to be in the header. If a real name contains ">," it will match the pattern and essentially be counted as a recipient.  That is should not be a common string in real names though. 

You can do the same thing with the To field, although, I'd recommend adding an empty To header back into the message.  

I'd also recommend testing this before turning it on in a live environment.  There are a lot of different mail clients that do things in many different ways.  This may not work as expected in all cases.

--
Arron Caruth
Vice President of Product Development
o: 817-601-3222    e: Arron.Caruth@mdaemon.com

MDaemon Technologies
Simple Secure Email

Visit us on www.mdaemon.com | Facebook | LinkedIn | YouTube
Sent using the MDaemon Email Server

On Wed, 8 Sep 2021 03:04:07 -0500, "lists-md-content-filter@mdaemon.com (Klaus May)" <lists-md-content-filter@mdaemon.com> wrote:
Hello,
we've got team members who sometimes send out mails like "I will be out office ..." to a dozens of our customers, but forget to Bcc it and cc it. So they are like shouting out loud our customer list.

So I wonder, if it's possible to count the number of recipients in the cc - field and then either
a) decline forwarding it (and send an info back to the sender); or/and
b) copy cc to bcc (and send an info back to the sender).

Best regards
Klaus


View/reply at Count recipients and/or copy "cc" to "bcc"
--MD-CFILTER---------------------------------------------------------
This list is for questions and discussions about MDAEMON's Content 
Filter. To unsubscribe from this mailing list send an email to 
md-cfilter-unsubscribe@mdaemon.com .
--POWERED BY MDAEMON!------------------------------------------------

---------------------------------------------------------------------
These forums are provided by MDaemon Technologies for user-to-user 
support and discussion.  MDaemon staff members may participate in the 
forums periodically but please recognize that this is not the official
method of receiving technical support. To receive personal technical 
support please use the form here:
http://www.mdaemon.com/Support/RequestSupport/
---------------------------------------------------------------------

--MD-CFILTER---------------------------------------------------------
This list is for questions and discussions about MDAEMON's Content
Filter. To unsubscribe from this mailing list send an email to
md-cfilter-unsubscribe@mdaemon.com .
--POWERED BY MDAEMON!------------------------------------------------

---------------------------------------------------------------------
These forums are provided by MDaemon Technologies for user-to-user
support and discussion.  MDaemon staff members may participate in the
forums periodically but please recognize that this is not the official
method of receiving technical support. To receive personal technical
support please use the form here:
http://www.mdaemon.com/Support/RequestSupport/
---------------------------------------------------------------------



  All MessagesOldest ItemsOlder ItemsNewer ItemsNewest Items



 Content:

Read New | Search

 Guest:

Email to Admin



You are visiting as a Guest user.