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
- Download the latest RAR packages for Linux x64 from rarlab.com.
- 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.
- Edit the configuration file located at /etc/amavis/conf.d/01-debian .
- Un-comment the non-free binary entry and comment out the unrar-free entry.
- 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.