4 Aug 2011 17:21
Help with filter-flags
Arthur Dent <misc.lists <at> blueyonder.co.uk>
2011-08-04 15:21:49 GMT
2011-08-04 15:21:49 GMT
OK - You'll have to read on a bit to see the meaning of the subject. I have used Procmail for several years, but only rarely write recipes. I always have to get back up the learning curve when I do. Clamassassin is a program which will invoke clamd scanning of email to detect virus and (with the additional SaneSecurity signatures) other malware. I use it in my current mail chain, calling it from Procmail. The program is no longer in development and has a bug. I have tried to contact the author without success, and then it occurred to me that I could recreate the functionality either with a shell script, or directly from within Procmail. The functionality provided by Clamassassin, and which I wish to recreate, is as follows: 1) It should call clamd. 2) It should add a header X-Clamd-Version (eg. "clamassassin 1.2.4 with clamdscan / ClamAV 0.97.1/13398/Thu Aug 4 03:15:14 2011") to every mail to show the version of clamd and sigs being used. 3) It should add a header X-Clamd-Status to every mail which will either be "No" for clean mail, or "Yes" if malware is detected. This will be used for subsequent filtering. 4) If malware is detected a third header would be added "X-Clamd-Report:" which will detail the signature found (eg "X-Clamd-Report: Sanesecurity.Phishing.Bank.15855.UNOFFICIAL FOUND") 5) If there is a problem with clamd (clamd is not running or there is a SELinux permission problem etc) It will report the error concisely in the headers. Item 5 is the bug in the current version of Clamassassin. It will try to(Continue reading)
>
> "Re-order", and simplify the logic as:
> IF (clamd error)
> {
> mark up headers to show clamd error
> }
> ELSE
> {
> mark up headers
> IF (malware detected)
> deliver message to MALWARE folder
> }
> ## reach here if clamd failed *or* it worked _and_ there was no malware
OK that makes sense. I did try that earlier in my experiments, but
couldn't get it to work. I'll try again.
> > In this recipe (in production) there will be only one case where the
> > mail is actually delivered.
> >
> > I don't know how to exit a procmail recipe and allow it to return to the
> > calling recipe. I have seen the SWITCHRC command - but I don't think
> > that is what I want here.
RSS Feed