I host my company's mail server via the cloud using Sophos Mail Security
I want to block an excel file containing a certain name from sending via email
How can I do thisI like your suggestion
As long as the excel file is not encrypted or password protected, Sophos Central Email Gateway should recognize a name as a keyword. You could even use a regular expression, to catch other spellings. Make sure to activate Subject, body, and attachments (content & name) in your outbound DLP rule.
“First things first, but not necessarily in that order” – Doctor Who
I can confirm this simply works. Outbound mails that have an excel attachment containing the string MahmoudMohsen are quarantained in my test environment. This would of course happen to all outbound mails containing that name in either subject, body or attachment, if the policy applies. Can also work for inbound mails.
If your intention is to just block attachments containing a name instead of all mails, I recommend to take a look at CIXA and its DLP capabilities, which can take care of that.