cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
1592
Views
0
Helpful
3
Replies

RegEx Help

Doug Maxfield
Level 1
Level 1

Good Afternoon,

Just starting to work on our new C370 server.  We are pretty much ready to start running mail through it but I have a question.

I'm trying to setup the IronPort Email Encryption.  I have it configured and working but have an issue.  We come from the original PostX environment so in order to "encrypt" a message, our users put "$C$" or "$c$" at the beginning of the subject of the e-mail.  The PostX appliance sees this, replaces the "$C$ or "$c$" with "Secure Message - " then the original subject without the string.

I have an outbound content filter setup to handle encrypting the e-mail, I just need help modifying the subject line.  What's the best way that I can accomplish this?

Thanks in advance!!

Doug

1 Accepted Solution

Accepted Solutions

Andreas Mueller
Level 4
Level 4

Hello Doug,

if I understand you correctly, a message like

Subject: "$C$ This is a test"

should be changed to

"Secure Message - This is a test"

and the flagged for encryption.  I don't see any possibilities to do that in a content filter, however in message filters we have an action called edit-header-text with the following syntax:

edit-header-text(“header-to-edit”, “match-regex”, “replace-text”);

A regex for your case would be


edit-header-text("Subject", "^\\$C\\$", "Secure Message -");

To make it case insensitive, a little more code:

edit-header-text("Subject", "(?i)^\\$C\\$", "Secure Message -");

Note that message filters work in any direction, so most likely you want to ensure that there is a condition checking for either IPs, listener, etc. here's an example how such a filter would look like:

Encrypt:  if (recv-listener == 'Outbound') AND (subject == '(?i)^\\$C\\$') {

     edit-header-text("Subject", "(?i)^\\$C\\$", "Secure Message -");

          encrypt('My_Encryption_Profile');

}

Did a quick test on that one a minute ago, and works like a charm.

Hope that helps,

Andreas

View solution in original post

3 Replies 3

Andreas Mueller
Level 4
Level 4

Hello Doug,

if I understand you correctly, a message like

Subject: "$C$ This is a test"

should be changed to

"Secure Message - This is a test"

and the flagged for encryption.  I don't see any possibilities to do that in a content filter, however in message filters we have an action called edit-header-text with the following syntax:

edit-header-text(“header-to-edit”, “match-regex”, “replace-text”);

A regex for your case would be


edit-header-text("Subject", "^\\$C\\$", "Secure Message -");

To make it case insensitive, a little more code:

edit-header-text("Subject", "(?i)^\\$C\\$", "Secure Message -");

Note that message filters work in any direction, so most likely you want to ensure that there is a condition checking for either IPs, listener, etc. here's an example how such a filter would look like:

Encrypt:  if (recv-listener == 'Outbound') AND (subject == '(?i)^\\$C\\$') {

     edit-header-text("Subject", "(?i)^\\$C\\$", "Secure Message -");

          encrypt('My_Encryption_Profile');

}

Did a quick test on that one a minute ago, and works like a charm.

Hope that helps,

Andreas

Andreas,

That did the trick!!!

Thanks for the help!!!

Doug

Hello,

Could you help please with the following:

I need to check the first line of body-message, the body message must match of the classification,
example:

"classification1" of the sender = classification1

"classification2" of the sender = classification --> reject (drop) ;

I know that the symbol "^" means beginning of the line.

What is the regex of beginning of the body message ?

Regards,

mxadmin

Getting Started

Find answers to your questions by entering keywords or phrases in the Search bar above. New here? Use these resources to familiarize yourself with the community: