LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Security
User Name
Password
Linux - Security This forum is for all security related questions.
Questions, tips, system compromises, firewalls, etc. are all included here.

Notices


Reply
  Search this Thread
Old 07-28-2004, 06:48 PM   #1
henno
Member
 
Registered: Aug 2003
Location: Brisbane, Australia
Distribution: slackware-current
Posts: 30

Rep: Reputation: 15
Procmail and ClamAV


I am using a simple perl script, clamfilter, to filter my incoming mail via procmail and sort it into a seperate mbox. This is all working fine, but I would love to be able to also have more than just the headers modified.

The source code for the clam filter is available here:
http://www.everysoft.com/clamfilter.pl.txt

At the moment this only alters the email headers like so:
Code:
X-Virus-Found: yes
X-Virus-Status:
     ------------------------------------------------------------
     Virus Scan Status:
     ------------------------------------------------------------
     /tmp/clamav-4a06825e36e18d49/all_document.pifd6vAvl: Worm.SomeFool.Gen-1 FOUND
    
     ----------- SCAN SUMMARY -----------
     Known viruses: 22932
     Scanned directories: 1
     Scanned files: 1
     Infected files: 1
     Data scanned: 0.02 MB
     I/O buffer size: 131072 bytes
     Time: 1.074 sec (0 m 1 s)
    
     ------------------------------------------------------------
Unfortunately the email itself and infected attachments remain unaltered. I am trying to at the very least have either the clamfilter script or a procmail recipe change the subject to ******VIRUS***** as a warning, or ideally, delete the attachment altogether. It would also be nice if the above header information could be printed in the body as well as the headers so users can know what virus the email was infected with.

My procmail recipe for the clamfilter is as follows, and merely moves the emails to a seperate folder:
Code:
#ClamAV filter
:0fw
| clamfilter.pl

:0:
* ^X-Virus-Found: yes
viruses
Any help here from the Procmail or Perl gurus would be greatly appreciated.

Cheers.
TK.

Last edited by henno; 07-28-2004 at 06:50 PM.
 
Old 08-03-2004, 09:38 PM   #2
henno
Member
 
Registered: Aug 2003
Location: Brisbane, Australia
Distribution: slackware-current
Posts: 30

Original Poster
Rep: Reputation: 15
Seeing as no-one seems to know the answer to this, does anyone know of any good perl/procmail forums or mailing lists I can ask this question on?

I am sure it would be a fairly easy task for anyone with a little experience. I just happen to be useless at both perl and complex procmail filters.

Any pointers in the right direction would be appreciated.

TK.
 
Old 08-13-2004, 02:45 AM   #3
opticus
LQ Newbie
 
Registered: Mar 2004
Location: norway, oslo
Distribution: Debian
Posts: 11

Rep: Reputation: 0
hey,

did you find out of this, im having the same "problem"
want to change the subject and the body and maybe to remove the attached file..
 
  


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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
clamav merize147 Ubuntu 2 10-13-2005 07:29 AM
ClamAV dudeman41465 Linux - Software 3 10-11-2005 08:40 AM
Problem with mail delivery procmail>cyrus imap (using sendmail,procmail,cyrus,imap) bwana Linux - Software 2 03-24-2005 07:01 PM
help with clamAV Lleb_KCir Linux - Software 6 01-29-2005 03:45 PM
Perl Script Program (need) : SpamAssassin-ClamAV-Procmail-Howto cyberjames Slackware 8 01-27-2005 11:53 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Security

All times are GMT -5. The time now is 05:59 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