LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 07-01-2009, 05:56 AM   #1
a7mlinux
Member
 
Registered: Apr 2009
Distribution: RHEL 5, Fedora 10
Posts: 116

Rep: Reputation: 17
Question how to connect between procmail and clamAV


I've Installed clamAV (version 0.95.2) and I want to connect it with procmail, I found that I should install trashscan first to do this, but I didn't found it in /clamav-0.95.2/contrib folder, should I download and install it to make procmail work with clamAV?

Last edited by a7mlinux; 07-01-2009 at 06:02 AM.
 
Old 07-01-2009, 08:18 AM   #2
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,415
Blog Entries: 55

Rep: Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600
You could use clamassassin (http://jameslick.com/clamassassin/) if you use clamdscan instead of clamscan, a procmail recipe like
Code:
CLAMDSCAN=/usr/bin/clamdscan
MBOX=/dev/null

:0
{
  RESULT=`$CLAMDSCAN --mbox --disable-summary --stdout -`

  :0 Di
  * RESULT ?? FOUND
  $MBOX
}
as it seems thrashcan was removed from /contrib due to an email header bypass flaw (X-Virus-Scan).
 
Old 07-01-2009, 09:12 AM   #3
a7mlinux
Member
 
Registered: Apr 2009
Distribution: RHEL 5, Fedora 10
Posts: 116

Original Poster
Rep: Reputation: 17
Question

when I try to run clamd I got the error:
Code:
ERROR: Please edit the example config file /usr/local/etc/clamd.conf
ERROR: Can't open/parse the config file /usr/local/etc/clamd.conf
is that mean I don't need trashscan to scan incoming e-mails?

Last edited by a7mlinux; 07-01-2009 at 09:14 AM.
 
Old 07-01-2009, 09:47 AM   #4
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,415
Blog Entries: 55

Rep: Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600
clamd.conf governs the configuration settings for the ClamAV daemon. That is a separate issue from running procmail/clamassassin/trashscan. If you don't run thrashscan you need to run clamassassin (or a Sendmail milter) or use a procmail recipe.
 
Old 07-01-2009, 09:54 AM   #5
a7mlinux
Member
 
Registered: Apr 2009
Distribution: RHEL 5, Fedora 10
Posts: 116

Original Poster
Rep: Reputation: 17
Question

is there a way to use procmail recipes to scan email-s without using clamAV?
 
Old 07-01-2009, 10:02 AM   #6
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,415
Blog Entries: 55

Rep: Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600
Procmail delivers email according to recipes.
ClamAV scans files.
If you do not want to use ClamAV you can choose another antivirus package.
You can not scan email messages for viruses or malware without an antivirus package.
 
Old 07-01-2009, 10:11 AM   #7
a7mlinux
Member
 
Registered: Apr 2009
Distribution: RHEL 5, Fedora 10
Posts: 116

Original Poster
Rep: Reputation: 17
Cool

yes I know that but you confused me with:
Quote:
clamd.conf governs the configuration settings for the ClamAV daemon. That is a separate issue from running procmail/clamassassin/trashscan
all I need to run clamAV with clamd command without error:
Code:
ERROR: Please edit the example config file /usr/local/etc/clamd.conf
ERROR: Can't open/parse the config file /usr/local/etc/clamd.conf
and the recipe I should write in procmailrc
 
Old 07-01-2009, 11:08 AM   #8
repo
LQ 5k Club
 
Registered: May 2001
Location: Belgium
Distribution: Arch
Posts: 8,529

Rep: Reputation: 899Reputation: 899Reputation: 899Reputation: 899Reputation: 899Reputation: 899Reputation: 899
Quote:
ERROR: Please edit the example config file /usr/local/etc/clamd.conf
Edit the file and
Quote:
# Comment or remove the line below.
Example
Here an ex for procmail and clamassassin


Code:
#####################
# Scan for Virusses #
#####################
# safe the subject line, and put [VIRUS] at the beginning of the subjectline, if any virus is found. 

SUBJ_=`formail -xSubject: \
       | expand | sed -e 's/^[ ]*//g' -e 's/[ ]*$//g'`

# run clamassassin
:0fw
| /usr/bin/clamassassin

:0:
* ^X-Virus-Status: Yes
{

        :0 fhw
        | formail -I"Subject: [VIRUS] ${SUBJ_}"
        :0 fhw
        | formail -A "X-VIRUS-INFO: BLOCKED BY CLAMASSASSIN"
        LOG="VIRUS "
        :0
        ${VIRUS}
}
 
Old 07-01-2009, 11:29 AM   #9
a7mlinux
Member
 
Registered: Apr 2009
Distribution: RHEL 5, Fedora 10
Posts: 116

Original Poster
Rep: Reputation: 17
Cool

welcome back repo
Quote:
Originally Posted by repo View Post
Here an ex for procmail and clamassassin
should I install clamassassin or clamav is enough, now I've installed clamav version 0.95.2 and clamassassin work with version lower than I have
thanks in advance
 
Old 07-01-2009, 11:40 AM   #10
repo
LQ 5k Club
 
Registered: May 2001
Location: Belgium
Distribution: Arch
Posts: 8,529

Rep: Reputation: 899Reputation: 899Reputation: 899Reputation: 899Reputation: 899Reputation: 899Reputation: 899
You need to install clamassassin.

clamassassin is a simple virus filter wrapper for ClamAV for use in procmail filters
 
Old 07-02-2009, 03:21 AM   #11
a7mlinux
Member
 
Registered: Apr 2009
Distribution: RHEL 5, Fedora 10
Posts: 116

Original Poster
Rep: Reputation: 17
Cool

Quote:
You need to install clamassassin.
clamassassin is a simple virus filter wrapper for ClamAV for use in procmail filters
ok I've installed clamassassin version 1.2.4 and it's compatible with clamav version 0.90 and higher, do I need to use this recipe directly:
Code:
#####################
# Scan for Virusses #
#####################
# safe the subject line, and put [VIRUS] at the beginning of the subjectline, if any virus is found. 

SUBJ_=`formail -xSubject: \
       | expand | sed -e 's/^[ ]*//g' -e 's/[ ]*$//g'`

# run clamassassin
:0fw
| /usr/bin/clamassassin

:0:
* ^X-Virus-Status: Yes
{

        :0 fhw
        | formail -I"Subject: [VIRUS] ${SUBJ_}"
        :0 fhw
        | formail -A "X-VIRUS-INFO: BLOCKED BY CLAMASSASSIN"
        LOG="VIRUS "
        :0
        ${VIRUS}
}
or there is a somthign I need to do before?
thanks in advance
 
Old 07-02-2009, 07:13 AM   #12
a7mlinux
Member
 
Registered: Apr 2009
Distribution: RHEL 5, Fedora 10
Posts: 116

Original Poster
Rep: Reputation: 17
Cool

suppose that it's working properly, I need A message with a virus to test my work where do I can find something like this?
 
Old 07-02-2009, 07:26 AM   #13
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,415
Blog Entries: 55

Rep: Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600
Search for the word "EICAR". That should yield a "test virus" any AV should recognise.
 
Old 07-02-2009, 09:20 AM   #14
repo
LQ 5k Club
 
Registered: May 2001
Location: Belgium
Distribution: Arch
Posts: 8,529

Rep: Reputation: 899Reputation: 899Reputation: 899Reputation: 899Reputation: 899Reputation: 899Reputation: 899
You should name the variable ${VIRUS}
at the beginning of your procmailrc file

Something like

Quote:
PATH=/bin:/usr/bin:/usr/local/bin
LINEBUF=4096
MAILDIR=$HOME/mail
TRASH=$MAILDIR/junkmail
DEFAULT=$MAILDIR/inbox
SPAM=$MAILDIR/spam
LOGFILE=$HOME/pm.log
VERBOSE = on
FGREP=/bin/fgrep
FROM=`formail -x From:`
REC=`formail -x Received:`
TMP=/var/tmp
DROPPRIVS=yes
 
Old 07-02-2009, 09:57 AM   #15
a7mlinux
Member
 
Registered: Apr 2009
Distribution: RHEL 5, Fedora 10
Posts: 116

Original Poster
Rep: Reputation: 17
Cool

Quote:
You should name the variable ${VIRUS}
at the beginning of your procmailrc file Something like
sorry but I didn't got you, please expalin more
thanks in advance
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Can't connect to UNIX socket /var/run/clamav/clamd.socket ganick Linux - Server 8 08-01-2008 01:22 PM
LXer: Book review: Setup and Run a Small Office Email Server Using Postfix, Courier, Procmail, Squirrelmail, Clamav and Spamassassin LXer Syndicated Linux News 0 08-24-2006 09:21 AM
Can't connect to UNIX socket /var/run/clamav/clamd shitoryu Linux - Software 1 07-25-2005 12:52 AM
Perl Script Program (need) : SpamAssassin-ClamAV-Procmail-Howto cyberjames Slackware 8 01-27-2005 11:53 AM
Procmail and ClamAV henno Linux - Security 2 08-13-2004 02:45 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 03:26 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration