Articles in this section

Plesk Email Security rejects some messages with attached docx files: BANNED: .exe,.exe-ms,[trash]/0000.dat

kb: technical ext: pes Plesk Obsidian for Linux kb: ai-edited

Applicable to:

  • Plesk for Linux

Symptoms

  • Some messages with attached docx files can't be delivered to a Plesk server with the Plesk Email Security extension installed.
  • An error like the one below can be found in the mail log (/var/log/maillog on RHEL-based systems, /var/log/mail.log on Debian/Ubuntu):

    CONFIG_TEXT: Reject, id=1234567 - BANNED: .exe,.exe-ms,[trash]/0000.dat (in reply to end of DATA command)

  • The sender receives a non-delivery notification with a message like the one below:

    CONFIG_TEXT: "Our content checker found banned name: .exe,.exe-ms,0000.dat"

Cause

The attached document contains a [trash]/0000.dat file inside it. Default Amavis rules don't allow such files, as there is a risk of the file being infected.

Resolution

Add an allowing rule to the Amavis configuration:

CentOS / RHEL / AlmaLinux / Rocky Linux
  1. Connect to the server via SSH.
  2. Create a backup of the Amavis configuration file:

    # cp -a /etc/amavisd/amavisd.conf /etc/amavisd/amavisd.conf.bak

  3. Open the /etc/amavisd/amavisd.conf file in a text editor.
  4. Warning: The rule below allows attachments containing [trash]/hhhh.dat files for all domains on the server.

    Find the $banned_filename_re = new_RE( line and insert the following section under it:

    ## Custom rule to allow trash files in documents
     [ qr'^\[trash\]/[0-9a-f]{4}\.dat$' => 0 ],   # allow [trash]/hhhh.dat in docx files

    Save the changes and close the file.

  5. Restart Amavis:

    # systemctl restart amavisd

Debian / Ubuntu
  1. Connect to the server via SSH.
  2. Create a backup of the Amavis configuration file:

    # cp -a /etc/amavis/conf.d/20-debian_defaults /root/20-debian_defaults.bak

  3. Open the /etc/amavis/conf.d/20-debian_defaults file in a text editor.
  4. Warning: The rule below allows attachments containing [trash]/hhhh.dat files for all domains on the server.

    Find the $banned_filename_re = new_RE( line and insert the following section under it:

    ## Custom rule to allow trash files in documents
     [ qr'^\[trash\]/[0-9a-f]{4}\.dat$' => 0 ],   # allow [trash]/hhhh.dat in docx files

    Save the changes and close the file.

  5. Restart Amavis:

    # systemctl restart amavis

Was this article helpful?

Comments

0 comments

Please sign in to leave a comment.