Stop delivery of email with certain attachments

nivekau

Well-Known Member
Jul 22, 2011
49
3
58
Australia
cPanel Access Level
Root Administrator
I use Mailscanner which blocks delivery of dangerous email attachments to mail boxes. It still delivers the email but replaces the attachment with a warning message. On rare occasions this warning can be useful because someone sends me something that I want to receive.

However some attachment types would never be welcome, such as .vbs.

Is there a way in WHM/cpanel to block any email which contains a .vbs attachment, so that it doesn't even reach mailscanner?
 

cPanelLauren

Forums Analyst II
Staff member
Nov 14, 2017
6,815
541
263
Houston
cPanel Access Level
DataCenter Provider

nivekau

Well-Known Member
Jul 22, 2011
49
3
58
Australia
cPanel Access Level
Root Administrator
For some reason my exim system filter file is set to a custom file /etc/antivirus.empty (which is an empty file), therefore the option 'Attachments: Filter messages with dangerous attachments' is greyed out (unavailable)

I'm not sure why this the case. I have ConfigServer MailScanner Front-End for cPanel which was installed by the company who provides it (Way to the Web Ltd), but I'm not sure what may have changed as part of the install process.

At the moment .vbs attachments are filtered out by Mailscanner (not by Exim). Mailscanner delivers the message to the mailbox but replaces the attachment with a warning message. I'll have to lodge a ticket with Way to the Web Ltd and ask them.
 

keat63

Well-Known Member
Nov 20, 2014
1,312
92
28
cPanel Access Level
Root Administrator
I believe the file in question is /etc/cpanel_exim_system_filter.

However, I also believe that this gets over written during any updates, so ideally you need to create a custom copy of this file and configure exim to refer to the custom copy instead.

Exim Configuration Manager - Basic Editor - Version 82 Documentation - cPanel Documentation

How to Customize the Exim System Filter File - cPanel Knowledge Base - cPanel Documentation

I could be wrong though, as it was a while ago that I last did this.
 

nivekau

Well-Known Member
Jul 22, 2011
49
3
58
Australia
cPanel Access Level
Root Administrator
I had a response from Way to the Web Ltd re the ConfigServer MailScanner installation and they said:

"...that is part of the install. We would recommend that you not use the exim attachment filter but use MailScanner to block these attachments instead. "
 

cPanelLauren

Forums Analyst II
Staff member
Nov 14, 2017
6,815
541
263
Houston
cPanel Access Level
DataCenter Provider