{"id":7,"date":"2012-06-17T05:30:00","date_gmt":"2012-06-17T05:30:00","guid":{"rendered":"http:\/\/pheonixsolutions.com\/?p=7"},"modified":"2026-09-05T10:13:11","modified_gmt":"2026-09-05T04:43:11","slug":"mailscanner-allow-extensions","status":"publish","type":"post","link":"https:\/\/pheonixsolutions.com\/blog\/mailscanner-allow-extensions\/","title":{"rendered":"How to Allow DOCX, XLSX, APP, and Other File Extensions in MailScanner"},"content":{"rendered":"<h2>Introduction<\/h2>\n<p class=\"isSelectedEnd\">MailScanner is a popular email security solution used on Linux and cPanel servers to protect users from spam, malware, viruses, and potentially dangerous email attachments. By default, MailScanner blocks certain file types based on predefined security rules to prevent malicious files from reaching users&#8217; inboxes.<\/p>\n<p class=\"isSelectedEnd\">However, there are situations where legitimate business files such as Microsoft Word documents (<code dir=\"ltr\">.docx<\/code>), Excel spreadsheets (<code dir=\"ltr\">.xlsx<\/code>), application packages (<code dir=\"ltr\">.app<\/code>), or other custom file formats need to be sent and received through email. In such cases, administrators must modify MailScanner&#8217;s configuration to allow specific file extensions.<\/p>\n<p class=\"isSelectedEnd\">This guide explains two methods for allowing blocked file extensions in MailScanner, either for a single domain or server-wide for all domains hosted on the server.<\/p>\n<div contenteditable=\"false\">\n<hr \/>\n<\/div>\n<h2>Solution 1: Disable MailScanner Protection for a Specific Domain<\/h2>\n<p class=\"isSelectedEnd\">If only one domain needs to send or receive restricted file types, the easiest solution is to disable MailScanner scanning for that domain.<\/p>\n<p><strong>Steps<\/strong><\/p>\n<ol start=\"1\" data-spread=\"false\">\n<li>Log in to <strong>cPanel<\/strong>.<\/li>\n<li>Navigate to:<\/li>\n<\/ol>\n<pre dir=\"ltr\"><code dir=\"ltr\">Email \u2192 MailScanner Configuration<\/code><\/pre>\n<ol start=\"3\" data-spread=\"false\">\n<li>Locate the domain name.<\/li>\n<li>Under the <strong>Spam Scanning<\/strong> option, select:<\/li>\n<\/ol>\n<pre dir=\"ltr\"><code dir=\"ltr\">No<\/code><\/pre>\n<ol start=\"5\" data-spread=\"false\">\n<li>Under the <strong>Virus Scanning<\/strong> option, select:<\/li>\n<\/ol>\n<pre dir=\"ltr\"><code dir=\"ltr\">No<\/code><\/pre>\n<ol start=\"6\" data-spread=\"false\">\n<li>Save the configuration.<\/li>\n<\/ol>\n<p><strong>Result<\/strong><\/p>\n<p class=\"isSelectedEnd\">MailScanner will no longer scan emails for that domain, allowing users to send and receive all file types without attachment restrictions.<\/p>\n<blockquote>\n<p class=\"isSelectedEnd\"><strong>Note:<\/strong> This method reduces email security for the selected domain and should only be used when necessary.<\/p>\n<\/blockquote>\n<div contenteditable=\"false\">\n<hr \/>\n<\/div>\n<h2>Solution 2: Allow Specific File Extensions Server-Wide<\/h2>\n<p class=\"isSelectedEnd\">If you want all domains hosted on the server to send and receive specific file types, update the MailScanner filename rules.<\/p>\n<p><strong>Step 1: Connect to the Server<\/strong><\/p>\n<p class=\"isSelectedEnd\">Log in as root via SSH.<\/p>\n<pre dir=\"ltr\"><code dir=\"ltr\">ssh root@server-ip<\/code><\/pre>\n<div contenteditable=\"false\">\n<hr \/>\n<\/div>\n<p><strong>Step 2: Locate the MailScanner Rules File<\/strong><\/p>\n<p class=\"isSelectedEnd\">On most cPanel servers:<\/p>\n<pre dir=\"ltr\"><code dir=\"ltr\">\/etc\/MailScanner\/filename.rules.conf<\/code><\/pre>\n<p class=\"isSelectedEnd\">Some installations may use:<\/p>\n<pre dir=\"ltr\"><code dir=\"ltr\">\/etc\/MailScanner\/filename.rules.conf<\/code><\/pre>\n<p class=\"isSelectedEnd\">Verify the exact file location before making changes.<\/p>\n<div contenteditable=\"false\">\n<hr \/>\n<\/div>\n<p><strong>Step 3: Edit the Configuration File<\/strong><\/p>\n<pre dir=\"ltr\"><code dir=\"ltr\">vi \/etc\/MailScanner\/filename.rules.conf<\/code><\/pre>\n<p class=\"isSelectedEnd\">Search for the section containing existing <strong>allow<\/strong> rules.<\/p>\n<div contenteditable=\"false\">\n<hr \/>\n<\/div>\n<p><strong>Step 4: Add the Required Extensions<\/strong><\/p>\n<p class=\"isSelectedEnd\">To allow Microsoft Office files and other extensions, add:<\/p>\n<pre dir=\"ltr\"><code dir=\"ltr\">allow \\.docx$ - -\nallow \\.xlsx$ - -\nallow \\.app$ - -\nallow \\.x(ml)?\\d{0,}\\.rel$ - -<\/code><\/pre>\n<p class=\"isSelectedEnd\">Additional examples:<\/p>\n<pre dir=\"ltr\"><code dir=\"ltr\">allow \\.pptx$ - -\nallow \\.csv$ - -\nallow \\.json$ - -\nallow \\.xml$ - -\nallow \\.zip$ - -<\/code><\/pre>\n<div contenteditable=\"false\">\n<hr \/>\n<\/div>\n<p><strong>Important Formatting Note<\/strong><\/p>\n<p class=\"isSelectedEnd\">When entering these rules:<\/p>\n<pre dir=\"ltr\"><code dir=\"ltr\">allow \\.docx$ - -<\/code><\/pre>\n<p class=\"isSelectedEnd\">Use the <strong>TAB key<\/strong> between the fields.<\/p>\n<p class=\"isSelectedEnd\">Correct:<\/p>\n<pre dir=\"ltr\"><code dir=\"ltr\">allow<span class=\"text-token-text-primary cursor-text rounded-sm\" data-placeholder-token=\"true\">[TAB]<\/span>\\.docx$<span class=\"text-token-text-primary cursor-text rounded-sm\" data-placeholder-token=\"true\">[TAB]<\/span>-<span class=\"text-token-text-primary cursor-text rounded-sm\" data-placeholder-token=\"true\">[TAB]<\/span>-<\/code><\/pre>\n<p class=\"isSelectedEnd\">Incorrect:<\/p>\n<pre dir=\"ltr\"><code dir=\"ltr\">allow \\.docx$ - -<\/code><\/pre>\n<p class=\"isSelectedEnd\">Using spaces instead of tabs may cause MailScanner to ignore the rule.<\/p>\n<div contenteditable=\"false\">\n<hr \/>\n<\/div>\n<p><strong>Step 5: Restart MailScanner<\/strong><\/p>\n<p class=\"isSelectedEnd\">After saving the file:<\/p>\n<pre dir=\"ltr\"><code dir=\"ltr\">service MailScanner restart<\/code><\/pre>\n<p class=\"isSelectedEnd\">or on newer systems:<\/p>\n<pre dir=\"ltr\"><code dir=\"ltr\">systemctl restart MailScanner<\/code><\/pre>\n<div contenteditable=\"false\">\n<hr \/>\n<\/div>\n<h2>Verify the Configuration<\/h2>\n<p class=\"isSelectedEnd\">Send a test email containing one of the newly allowed file types:<\/p>\n<ul data-spread=\"false\">\n<li>.docx<\/li>\n<li>.xlsx<\/li>\n<li>.pptx<\/li>\n<li>.app<\/li>\n<li>.xml<\/li>\n<\/ul>\n<p class=\"isSelectedEnd\">If the message is delivered successfully, the configuration is working correctly.<\/p>\n<p class=\"isSelectedEnd\">You can also monitor MailScanner logs:<\/p>\n<pre dir=\"ltr\"><code dir=\"ltr\">tail -f \/var\/log\/maillog<\/code><\/pre>\n<p class=\"isSelectedEnd\">or<\/p>\n<pre dir=\"ltr\"><code dir=\"ltr\">tail -f \/var\/log\/exim_mainlog<\/code><\/pre>\n<p class=\"isSelectedEnd\">depending on your mail server configuration.<\/p>\n<div contenteditable=\"false\">\n<hr \/>\n<\/div>\n<h2>Conclusion<\/h2>\n<p>MailScanner provides strong protection against malicious email attachments, but legitimate business requirements may require certain file types to be allowed. Whether you need to permit attachments for a single domain or implement server-wide changes, MailScanner offers flexible configuration options through cPanel settings and filename rule definitions. By carefully allowing only the required extensions and maintaining antivirus protection, administrators can balance usability and security effectively.<\/p>\n<div contenteditable=\"false\">\n<hr \/>\n<\/div>\n<h2>Frequently Asked Questions (FAQ)<\/h2>\n<p><strong>1. Why is MailScanner blocking DOCX and XLSX files?<\/strong><\/p>\n<p class=\"isSelectedEnd\">MailScanner uses filename rules to prevent potentially dangerous attachments from being delivered. Some server administrators configure stricter policies that block Microsoft Office and compressed file formats by default.<\/p>\n<div contenteditable=\"false\">\n<hr \/>\n<\/div>\n<p><strong>2. Will allowing file extensions reduce email security?<\/strong><\/p>\n<p class=\"isSelectedEnd\">Yes. Allowing additional file types increases the possibility of malicious files being delivered. It is recommended to allow only trusted file extensions and keep antivirus scanning enabled whenever possible.<\/p>\n<div contenteditable=\"false\">\n<hr \/>\n<\/div>\n<p><strong>3. Do I need to restart MailScanner after modifying filename.rules.conf?<\/strong><\/p>\n<p class=\"isSelectedEnd\">Yes. Changes to MailScanner rules are not applied until the service is restarted.<\/p>\n<pre dir=\"ltr\"><code dir=\"ltr\">systemctl restart MailScanner<\/code><\/pre>\n<p class=\"isSelectedEnd\">or<\/p>\n<pre dir=\"ltr\"><code dir=\"ltr\">service MailScanner restart<\/code><\/pre>\n<div contenteditable=\"false\">\n<hr \/>\n<\/div>\n<h2>Related Articles<\/h2>\n<ol start=\"1\" data-spread=\"true\">\n<li><strong>Allow ZIP, TAR, and GZ Attachments in MailScanner<\/strong><br \/>\nLearn how to permit compressed archive file types in MailScanner without disabling email security entirely.<br \/>\n<a href=\"https:\/\/pheonixsolutions.com\/blog\/mailscanner-allow-zip-tar-gz-extension-in-email\/\">Allow ZIP, TAR, and GZ Attachments in MailScanner<\/a><\/li>\n<li><strong>Send an Email Using Telnet from Remote Servers<\/strong><br \/>\nTest SMTP connectivity and troubleshoot email delivery issues using Telnet commands directly from the server.<br \/>\n<a href=\"https:\/\/pheonixsolutions.com\/blog\/send-an-email-using-telnet-from-remote-servers\/\">Send an Email Using Telnet from Remote Servers<\/a><\/li>\n<li><strong>Create an Email Account in cPanel<\/strong><br \/>\nStep-by-step guide for creating and managing email accounts through the cPanel interface.<br \/>\n<a href=\"https:\/\/pheonixsolutions.com\/blog\/create-an-email-account-in-cpanel-demo\/\">Create an Email Account in cPanel<\/a><\/li>\n<\/ol>\n<div contenteditable=\"false\">\n<hr \/>\n<\/div>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Introduction MailScanner is a popular email security solution used on Linux and cPanel servers to protect users from spam, malware, [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"site-sidebar-layout":"default","site-content-layout":"","ast-site-content-layout":"default","site-content-style":"default","site-sidebar-style":"default","ast-global-header-display":"","ast-banner-title-visibility":"","ast-main-header-display":"","ast-hfb-above-header-display":"","ast-hfb-below-header-display":"","ast-hfb-mobile-header-display":"","site-post-title":"","ast-breadcrumbs-content":"","ast-featured-img":"","footer-sml-layout":"","ast-disable-related-posts":"","theme-transparent-header-meta":"","adv-header-id-meta":"","stick-header-meta":"","header-above-stick-meta":"","header-main-stick-meta":"","header-below-stick-meta":"","astra-migrate-meta-layouts":"default","ast-page-background-enabled":"default","ast-page-background-meta":{"desktop":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"ast-content-background-meta":{"desktop":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2},"jetpack_post_was_ever_published":false},"categories":[1019],"tags":[263,228],"class_list":["post-7","post","type-post","status-publish","format-standard","hentry","category-cloud-aws","tag-cpanel","tag-mailscanner-2","psol-cat-cloud-aws"],"jetpack_publicize_connections":[],"jetpack_shortlink":"https:\/\/wp.me\/phn2x7-7","jetpack_sharing_enabled":true,"jetpack_featured_media_url":"","_links":{"self":[{"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/posts\/7","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/comments?post=7"}],"version-history":[{"count":2,"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/posts\/7\/revisions"}],"predecessor-version":[{"id":11391,"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/posts\/7\/revisions\/11391"}],"wp:attachment":[{"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/media?parent=7"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/categories?post=7"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/tags?post=7"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}