(05-03-16) Solve the Problem of Qmail + ClamAV scanning RAR format attachments

Source: Internet
Author: User
Tags qmail

Previously, I have set up the Qmail + MySQL + Vpopmail + ClamAV server platform. Only attachments in rar format cannot be scanned.

With the help of Cu altar friends, we found a solution.

Next, I will repeat the posts of my friends. For your reference

1. Modify TCP. SMTP
127.: Allow, relayclient = "", rblsmtpd = "", qmailqueue = "/var/Qmail/bin/qmail-scanner-queue.pl"
: Allow, qmailqueue = "/var/Qmail/bin/qmail-scanner-queue.pl"

Then # tcprules TCP. SMTP. cdb tcp. SMTP. tmp <TCP. SMTP

2. Install daemontools-0.76.tar.gz
The latest version is here: http://cr.yp.to/daemontools/install.html
Tar zxvf daemontools-0.76.tar.gz
CD admin/daemontools-0.76
Package/install
If an error is reported during installation, daemontools-0.76.errno.patch is required
Http://www.qmail.org/moni.csi.hu/pub/glibc-2.3.1/daemontools-0.76.errno.patch
Patch-P1 <daemontools-0.76.errno.patch

Adjust the value of softlimit according to the actual situation.
VI/var/Qmail/SMTP
Add/usr/local/bin/softlimit-M 25000000

3. download the latest unrar for Linux
Http://www.rarlab.com/
Tar xzvf rarlinux-3.4.0.tar.gz
CD RAR
Make install

VI/var/Qmail/bin/qmail-scanner-queue.pl
My $ clamscan_binary = '/usr/local/bin/clamscan ';
My $ clamscan_options = "-- unrar =/usr/local/bin/unrar-r -- mbox -- disable-Summary -- Max-recursion = 10 -- Max-Space = 1000000 ";

Enable the unrar Function

Restart the server to reload it (relatively simple and practically)

If not, execute the fourth method, but I have not tried it. (Some large RAR packages still report errors, but these three methods can solve most RAR packages)
4. qmail-scanner-queue.pl files can be modified
Modify here
Sub clamscan_detail {
# Clamscan finished
# Add the following sentence. If the value is greater than 10 MB, no check will be performed.
If ($ MS _ size> 10000000 ){
& Debug ("ClamAV: Message too big-Skip it ");
Return;
}
5. Send a letter to the company owner informing them of the ZIP format when sending the zip package ......

I am using the third method. Because I have already set TCP. SMTP.

Thank you for choosing Cu !!

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.