How can I enable rar support in Amavis to fix the error: No ext program for .rar, tried: unrar, rar in the maillog?

Overview

This article provides step-by-step instructions for installing and configuring RAR/UnRAR binaries to support Amavis email scanning on Linux servers. Proper installation ensures compatibility with modern archive formats and mitigates known security vulnerabilities present in legacy versions.

Prerequisites

  • Administrative (root) or sudo privileges on the target server.
  • x86_64 system architecture. Note: These third-party binaries are exclusively compiled for x86 processors and do not support ARM architectures.

Installation: AlmaLinux/CloudLinux/RHEL

  1. Download the latest RAR packages for Linux x64 from rarlab.com.
  2. Extract the archive and copy the executable binaries to the system binary directory.
wget https://www.rarlab.com/rar/rarlinux-x64-722.tar.gz
tar -zxvf rarlinux-x64-722.tar.gz
cd rar
cp rar unrar /usr/local/bin

Configuration: Debian/Ubuntu

To ensure compatibility with modern `.rar` formats, update the Amavis configuration to utilize the non-free binaries. The free version only supports legacy archive structures and lacks current security support.

  1. Edit the configuration file located at /etc/amavis/conf.d/01-debian .
  2. Un-comment the non-free binary entry and comment out the unrar-free entry.
  3. Verify that the configuration matches the following structure:
$unrar      = ['rar', 'unrar']; #disabled (non-free, no security support)
#$unrar     = ['unrar-free'];

Restart Amavis Service

Apply the configuration changes by restarting the Amavis service. Execute the command corresponding to your operating system:

// AlmaLinux/CloudLinux/RHEL
systemctl restart amavisd

// Debian/Ubuntu
systemctl restart amavis

Maintenance & Security Guidelines

Rarlab periodically releases updated versions to address security vulnerabilities and improve format compatibility. It is critical to monitor for new releases and update the binaries regularly to maintain system integrity and compliance.

Troubleshooting / Common Issues

  • Architecture Mismatch: If installation fails or binaries refuse to execute, verify that your server uses an x86_64 architecture. ARM-based systems are unsupported by these packages.
  • Service Failure After Restart: Check the Amavis logs for syntax errors in /etc/amavis/conf.d/01-debian . Ensure the configuration file contains valid Perl syntax and that the binary paths are correctly referenced.
  • Command Not Found: Confirm that rar and unrar were successfully copied to /usr/local/bin and possess executable permissions (chmod +x /usr/local/bin/rar /usr/local/bin/unrar).
  • Archive Extraction Errors: If Amavis reports unsupported archive formats, verify that the non-free binaries are active in the configuration file and that the service was restarted after modification.
  • rar, amavis
  • 7 Users Found This Useful
Was this answer helpful?

Related Articles

How can I install or upgrade the extension?

We provide free installation and configuration for all our paid licenses. Open a support ticket...

How can I add stronger Postfix restrictions so that the bulk of spam is rejected at the SMTPD level before it gets processed by Amavis?

Overview Warden enables administrators to enforce stricter Postfix SMTPD restrictions. These...

How can I change the interface language of the extension?

Overview This article provides instructions on how to change the interface language within the...

How can I configure greylisting with Warden Anti-spam and Virus protection?

Overview Greylisting is an email filtering mechanism designed to mitigate spam by temporarily...