Adding Warning Message to email body

icoso

Member
Jul 23, 2004
8
1
151
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
Staff member
Nov 14, 2017
13,296
1,252
313
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
Staff member
Nov 14, 2017
13,296
1,252
313
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