Instructions on how to remove email warning banners in Outlook @ Drexel
On or about March 11, 2019, Drexel IT began to tag all non-Drexel incoming email with a warning banner at the top of the email body that looks like this:
Caution: This message came from outside of Drexel. Do not click links or attachments unless you expected this email.
Apart from being ugly and annoying, it is downright insulting to those of us who understand security and are aware of phishing. To combat this annoyance, I figured out a way to strip these banners from all incoming messages using the Rules feature of Outlook. Unfortunately, this only works for the Outlook client on my Windows laptop, but it is a start. Basically, it amounts to running a custom script on every email received to remove the banner text if it is encountered.
- In Outlook, Alt-F11 to open the VBA interface. Then in Project1->'Microsoft Outlook Objects'->ThisOutlookSession paste this code:
Option Explicit
Sub InsertHyperLink(MyMail As MailItem)
Dim body As String
body = MyMail.HTMLBody
body = Replace(body, "border:solid black 1.0pt", "", 1, 1, vbTextCompare)
body = Replace(body, "Caution: This message came from outside of Drexel.", "", 1, 1, vbTextCompare)
body = Replace(body, "<u>Do not click links or attachments</u> unless you <em>expected</em> this email.", "", 1, 1, vbTextCompare)
MyMail.HTMLBody = body
MyMail.Save
End Sub
-
Now, you need to sign this with a certificate. If you don't have one, you can make your own:
- In powershell, navigate to
C:\Program Files (x86)\Microsoft Office\Office15
- Issue
SELFCERT.EXE
and create your own certificate - In IE, 'Internet Options'->Content->Certificates, export this personal certificate and then imported into the trusted root certificates.
- Sign your VBA script with this certificate (Tools->Digital Signature)
- In powershell, navigate to
-
Now, you need to edit your windows registry.
- Invoke
regedit
from the command line - Go to
HKEY_CURRENT_USER\Software\Microsoft\Office\15.0\Outlook\Security
- Create a new DWORD; name it
EnableUnsafeClientMailRules
and give it the value 1.
- Invoke
-
Finally, add the rule in Outlook.
- Manange Rules->New Rule->'Apply rule on messages I receive'
- No condition (all recevied messages will be subjected to the action)
- At the 'What do you and to do with the message? Select action(s):' check "run a script", and then click on the word "script" in the Step 2 window, and select your
Project1.ThisOutSession.Inse...
script. - Make a little folder in your mailbox and put some existing externally-sourced emails with the annoying banner in there. Run the script on those messages and verify the banner is removed cleanly.