Adding Warning Message to email body

icoso

Member
Jul 23, 2004
9
1
153
Indy
This has become a major issue for my customers for compliance that they have a note added to their incoming messages that Warns them of external incoming messages. This is something that is forcing many users to move to an exchange service because this is easily implemented in Exchange/Outlook environments.

Is there a way to add a Warning Message to all incoming emails that do not match the current domain? For example, My domain that is configured in CPanel is mymaildomain.org. For every incoming email message to our domain that passes through all previous checks, and SPAM Assassin checks, that does not contain mymaildomain.org, I'd like to add the text to the top of the message body that states

"WARNING: EXTERNAL EMAIL. Do NOT CLICK on links or open attachments unless you are expecting it or have verified with the sender."

Or whatever I want it to say.

It seems like this would be pretty easy to implement within the CPanel Global Email Filters. If another option was added to the actions, ie: " Add Note to Body" then have a text box to define the "Text" of the message. This would solve this issue. All of the current rules already apply, such as the Rule for From - Does Not Contain - then we could specify the domain or any text, the Action would then be to "Add Note to Body".

Or another way to do this would be to Rewrite the subject with a short text: "EXTERNAL: " (Much like SPAM Assassin does with suspected SPAM) then we could use the existing the Rules to add a test for that same word, so it doesn't keep rewriting the subject if it contains that same word. To do this, we'd need an Action of "Rewrite Subject".

Another way to do this would be to use the Pipe to Program function, However I can't find any script out there that would do either of what Im suggesting.

Any help, suggestions, direction, assistance, with this matter would be greatly appreciated. If anyone can write a script that would do this I'd be very much appreciative.
 
  • Love
Reactions: Gino Viroli

cPanelLauren

Product Owner II
Staff member
Nov 14, 2017
13,266
1,301
363
Houston
Hello,

You can definitely rewrite the headers in the same way that Spam Assassin does to append ***SPAM*** to them. I believe you could also add a notice to the body of the message.

The thread here might be helpful for this: Filtering headers on a bounce

I'd recommend using the Exim System Filter to make these modifications which would do so globally
 

cPanelLauren

Product Owner II
Staff member
Nov 14, 2017
13,266
1,301
363
Houston
You'd want to use headers_add to do this. There are quite a few threads on the forums that go over headers add and headers remove:



The exim documentation provides informative steps on this as well: 48. Message processing
 

icoso

Member
Jul 23, 2004
9
1
153
Indy
This issue has become so widespread with all of my customers due to compliance and Fed regulations, that Im losing customers because CPanel email services cant add this to the subject or the beginning of the body. I need to know HOW to ADD to the beginning of the subject for EVERY incoming message that is NOT from the local domain, to something like this: "WARNING - EXTERNAL MESSAGE" UNLESS the subject already contains the word "EXTERNAL".

As in most cases I use a VPS from a hosting vendor, in which I have access to edit the exim config files, for my VPS using my WHM for all my domain accounts.

I've read all those posts listed above and they aren't quite specific enough for me to do this, some change the from address, some change the subject and then redirect, but they don't address this issue specifically.

Here is my case:
1 I have a VPS with multiple domains on it. ie: customeronedomain.com, custtwodomain.com, customerthree.com etc...
2. Someone from [email protected] domain sends an email to [email protected], OR [email protected], OR the recipient is part of a CC or BCC list, (notice the sending domain is not the same as the recipients domain).
3. If the sending domain is not the same as the recipients domain, then the subject needs to be changed to include "WARNING - EXTERNAL MESSAGE" at the beginning of the subject, UNLESS the word "EXTERNAL" is already in the subject.
4. continue delivery normally to the recipients.

This should be really easy and would be GREAT if CPANEL would simply make this a checkable option under the email addresses page in the CPanel or even on the Exim Config page in the WHM.
 

cPanelAnthony

Administrator
Staff member
Oct 18, 2021
1,041
111
118
Houston, TX
cPanel Access Level
Root Administrator
This issue has become so widespread with all of my customers due to compliance and Fed regulations, that Im losing customers because CPanel email services cant add this to the subject or the beginning of the body. I need to know HOW to ADD to the beginning of the subject for EVERY incoming message that is NOT from the local domain, to something like this: "WARNING - EXTERNAL MESSAGE" UNLESS the subject already contains the word "EXTERNAL".

As in most cases I use a VPS from a hosting vendor, in which I have access to edit the exim config files, for my VPS using my WHM for all my domain accounts.

I've read all those posts listed above and they aren't quite specific enough for me to do this, some change the from address, some change the subject and then redirect, but they don't address this issue specifically.

Here is my case:
1 I have a VPS with multiple domains on it. ie: customeronedomain.com, custtwodomain.com, customerthree.com etc...
2. Someone from [email protected] domain sends an email to [email protected], OR [email protected], OR the recipient is part of a CC or BCC list, (notice the sending domain is not the same as the recipients domain).
3. If the sending domain is not the same as the recipients domain, then the subject needs to be changed to include "WARNING - EXTERNAL MESSAGE" at the beginning of the subject, UNLESS the word "EXTERNAL" is already in the subject.
4. continue delivery normally to the recipients.

This should be really easy and would be GREAT if CPANEL would simply make this a checkable option under the email addresses page in the CPanel or even on the Exim Config page in the WHM.
Would it be possible for you to submit a feature request using the link in my signature?