Mail Server Allow .com File Attachments

Issue: Google sends DMARC reports using a .com file attachment. Exim prevents .com attachments, thus DMARC reports are not received.
Server in use is Exim, managed by cPanel/WHM.

Solution: Create a custom cpanel_exim_system_filter that does not deny .com file attachments, and configure Exim (via WHM) to use the customized cpanel_exim_system_filter file.

Keep the original file in /etc/cpanel_exim_system_filter (in case of issue) and create a new one:

cp /etc/cpanel_exim_system_filter /etc/cpanel_exim_system_filter_without_com

Edit /etc/cpanel_exim_system_filter_without_com – Look for the following lines throughout that file, and remove references to: com

if $header_content-type: matches "(?:file)?name=(\"[^\"]+\\\\.(?:ad[ep]|ba[st]|chm|cmd|com|cpl|crt|eml|exe|hlp|hta|in[fs]|isp|jse?|lnk|md[be]|ms[cipt]|pcd|pif|reg|scr|sct|shs|url|vb[se]|ws[fhc])\")"
if $header_content-type: matches "(?:file)?name=(\\\\S+\\\\.(?:ad[ep]|ba[st]|chm|cmd|com|cpl|crt|eml|exe|hlp|hta|in[fs]|isp|jse?|lnk|md[be]|ms[cipt]|pcd|pif|reg|scr|sct|shs|url|vb[se]|ws[fhc]))"
if $message_body matches "(?:Content-(?:Type:(?>\\\\s*)[\\\\w-]+/[\\\\w-]+|Disposition:(?>\\\\s*)attachment);(?>\\\\s*)(?:file)?name=|begin(?>\\\\s+)[0-7]{3,4}(?>\\\\s+))(\"[^\"]+\\\\.(?:ad[ep]|ba[st]|chm|cmd|com|cpl|crt|eml|exe|hlp|hta|in[fs]|isp|jse?|lnk|md[be]|ms[cipt]|pcd|pif|reg|scr|sct|shs|url|vb[se]|ws[fhc])\")[\\\\s;]"
if $message_body matches "(?:Content-(?:Type:(?>\\\\s*)[\\\\w-]+/[\\\\w-]+|Disposition:(?>\\\\s*)attachment);(?>\\\\s*)(?:file)?name=|begin(?>\\\\s+)[0-7]{3,4}(?>\\\\s+))(\\\\S+\\\\.(?:ad[ep]|ba[st]|chm|cmd|com|cpl|crt|eml|exe|hlp|hta|in[fs]|isp|jse?|lnk|md[be]|ms[cipt]|pcd|pif|reg|scr|sct|shs|url|vb[se]|ws[fhc]))[\\\\s;]"

Log into WHM and navigate to:

Service Configuration => Exim Configuration Manager => Filters => System Filter File
Change the “System Filter File” setting to point to:

/etc/cpanel_exim_system_filter_without_com

In the even of an issue, you can always change the setting back to “default”.

Leave a comment

BlogLogistics