LinuxQuestions.org
Did you know LQ has a Linux Hardware Compatibility List?
Go Back   LinuxQuestions.org > Forums > Linux > Linux - General
User Name
Password
Linux - General This 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
 
Thread Tools Search this Thread
Old 07-01-2009, 06:56 AM   #1
a7mlinux
Member
 
Registered: Apr 2009
Distribution: RHEL 5, Fedora 10
Posts: 106
Thanked: 4
Question how to connect between procmail and clamAV


[Log in to get rid of this advertisement]
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 07:02 AM..
a7mlinux is offline     Reply With Quote
Old 07-01-2009, 09:18 AM   #2
unSpawn
Moderator
 
Registered: May 2001
Posts: 16,985
Blog Entries: 33
Thanked: 323
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).
unSpawn is online now     Reply With Quote
Old 07-01-2009, 10:12 AM   #3
a7mlinux
Member
 
Registered: Apr 2009
Distribution: RHEL 5, Fedora 10
Posts: 106
Thanked: 4

Original Poster
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 10:14 AM..
a7mlinux is offline     Reply With Quote
Old 07-01-2009, 10:47 AM   #4
unSpawn
Moderator
 
Registered: May 2001
Posts: 16,985
Blog Entries: 33
Thanked: 323
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.
unSpawn is online now     Reply With Quote
Old 07-01-2009, 10:54 AM   #5
a7mlinux
Member
 
Registered: Apr 2009
Distribution: RHEL 5, Fedora 10
Posts: 106
Thanked: 4

Original Poster
Question

is there a way to use procmail recipes to scan email-s without using clamAV?
a7mlinux is offline     Reply With Quote
Old 07-01-2009, 11:02 AM   #6
unSpawn
Moderator
 
Registered: May 2001
Posts: 16,985
Blog Entries: 33
Thanked: 323
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.
unSpawn is online now     Reply With Quote
Old 07-01-2009, 11:11 AM   #7
a7mlinux
Member
 
Registered: Apr 2009
Distribution: RHEL 5, Fedora 10
Posts: 106
Thanked: 4

Original Poster
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
a7mlinux is offline     Reply With Quote
Old 07-01-2009, 12:08 PM   #8
repo
Guru
 
Registered: May 2001
Location: Belgium
Distribution: Slackware
Posts: 5,017
Thanked: 518
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}
}
repo is online now     Reply With Quote
Old 07-01-2009, 12:29 PM   #9
a7mlinux
Member
 
Registered: Apr 2009
Distribution: RHEL 5, Fedora 10
Posts: 106
Thanked: 4

Original Poster
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
a7mlinux is offline     Reply With Quote
Old 07-01-2009, 12:40 PM   #10
repo
Guru
 
Registered: May 2001
Location: Belgium
Distribution: Slackware
Posts: 5,017
Thanked: 518
You need to install clamassassin.

clamassassin is a simple virus filter wrapper for ClamAV for use in procmail filters
repo is online now     Reply With Quote
Old 07-02-2009, 04:21 AM   #11
a7mlinux
Member
 
Registered: Apr 2009
Distribution: RHEL 5, Fedora 10
Posts: 106
Thanked: 4

Original Poster
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
a7mlinux is offline     Reply With Quote
Old 07-02-2009, 08:13 AM   #12
a7mlinux
Member
 
Registered: Apr 2009
Distribution: RHEL 5, Fedora 10
Posts: 106
Thanked: 4

Original Poster
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?
a7mlinux is offline     Reply With Quote
Old 07-02-2009, 08:26 AM   #13
unSpawn
Moderator
 
Registered: May 2001
Posts: 16,985
Blog Entries: 33
Thanked: 323
Search for the word "EICAR". That should yield a "test virus" any AV should recognise.
unSpawn is online now     Reply With Quote
Old 07-02-2009, 10:20 AM   #14
repo
Guru
 
Registered: May 2001
Location: Belgium
Distribution: Slackware
Posts: 5,017
Thanked: 518
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
repo is online now     Reply With Quote
Old 07-02-2009, 10:57 AM   #15
a7mlinux
Member
 
Registered: Apr 2009
Distribution: RHEL 5, Fedora 10
Posts: 106
Thanked: 4

Original Poster
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
a7mlinux is offline     Reply With Quote

Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 Off
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 02: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 10:21 AM
Can't connect to UNIX socket /var/run/clamav/clamd shitoryu Linux - Software 1 07-25-2005 01:52 AM
Perl Script Program (need) : SpamAssassin-ClamAV-Procmail-Howto cyberjames Slackware 8 01-27-2005 12:53 PM
Procmail and ClamAV henno Linux - Security 2 08-13-2004 03:45 AM


All times are GMT -5. The time now is 05:31 PM.

Main Menu
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.
Advertisement
Oracle Magazine contains technology strategy articles, sample code, tips, Oracle and partner news, how to articles for developers and DBAs, and more. Click Here to receive a complimentary subscription courtesy of LQ.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
RSS2  LQ Podcast
RSS2  LQ Radio
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: @linuxquestions
Open Source Consulting | Domain Registration