Hi all,

Further to my message that I sent earlier regarding how to have clamd on
a separate machine to the mail server I have discovered/done the
following. Before I put this 'tested/works for me' code into production,
I would like to ask others if it sounds reasonable to do it this way...

Firstly, I upgraded to the CVS version of clamav and looked in the
clamdscan directory. Inside client.c I found the new version would
retrieve the remote host/IP from the config file instead of hardcoded to
127.0.0.1.
The next problem is further down in client.c where it connect to the
PORT it had the old hardcoded 127.0.0.1 again. So a simple copy and
paste got past that one.

The next problem is how to avoid simply sending a filename to a remote
host which won't have any meaning. After plenty of 'hacking' I managed
to get clamdscan to use the STREAM method if we were not talking to
localhost.... This seemed to work until I tried to integrate it with
qmail-scanner and still didn't address the problem of trying to scan a
directory recursively, so I hacked on qmail-scanner instead.

In the clamuko section, I created an allfiles array, and then call
clamdscan for each file like this:
Clamdscan <settings> - 2>&1 < $filename
Ie, clamdscan gets the file on STDIN and works properly by STREAM'ing
the file to the remote host.

So far, this seems to work for me, but I would like to know if there
might be a 'better' way to do this.

Options I can think of include:
A) Have client.c realise this is a directory instead of a file and
iterate over each file in the directory (if recursive) up to max
recursion/etc...

Need to either open multiple ports to remote or else send multiple
STREAM commands and receive multiple PORT commands on the same
connection (like FTP when we upload/download multiple files with a
single port 21 connection).

Better if we could just stream a single file, and then keep sending file
data one after the next with a signal in between files...

B) Use tar to combine the files into a single tar file before sending
across to the remote (might actually be a neat solution)...

Ie, tar -cf - $allfiles | $clamuko_binary $clamuko_options - 2>&1

I might even try this tomorrow if I get the chance. I really think this
is better than my above method...

Anyway, I would be greatful for any suggestions/ideas etc. I am fairly
capable with perl, and mildly capable with C. I will of course share the
modifications once I have something working, at the moment it is a bit
of a mess...

Regards,
Adam

 -- 
Adam Goryachev
Website Managers
Ph:  +61 2 9345 4395                        [EMAIL PROTECTED]
Fax: +61 2 9345 4396                        www.websitemanagers.com.au



-------------------------------------------------------
The SF.Net email is sponsored by EclipseCon 2004
Premiere Conference on Open Tools Development and Integration
See the breadth of Eclipse activity. February 3-5 in Anaheim, CA.
http://www.eclipsecon.org/osdn
_______________________________________________
Qmail-scanner-general mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/qmail-scanner-general

Reply via email to