Re: Connecting Clamd via inet socket?
John Nemeth <[email protected]>
| Newsgroups | gmane.mail.mimedefang |
|---|---|
| Message-ID | <[email protected]> |
On Dec 2, 1:22pm, "Bill Cole" wrote: } On 2 Dec 2016, at 12:01, Dianne Skoll wrote: } > On Fri, 2 Dec 2016 16:57:32 +0100 } > Benoit Panizzon <[email protected]> wrote: } > } >> Does anyone know, if it's possible to use } >> ClamdSock = "host:port"; } >> in MIMEDefang? } > } > No; the built-in code uses IO::Socket::UNIX and can only scan local } > files. You need to write your own wrapper code if you want to } > stream files to another host. } } Note that this is pretty easy if you have the 'socat' software } installed. You could run something like this out of init (or whatever } replacement for init your system uses): } } socat UNIX-LISTEN:/var/run/fakeclamd.sock,mode=777,fork } TCP:<clamdhost>:<clamdport> } } Note that this provides no on-the-wire security but in its favor, only } needs a persistent socat process on the client side. By using an OPENSSL } socket type instead of TCP and a mirror image socat process on the } server side (i.e. have socat instead of clamd listening on the network } interface, talking to the clamd socket) you could secure the conversion. } See the socat man page for more information. Just curious, has anybody in this thread read the clamd manpage recently? The clamd socket is primarily a control channel, i.e. you send it a command like, "SCAN <path>", which won't work very well if <path> is inaccessible to clamd. There is "STREAM" (deprecated) which returns "PORT <portno>" and "INSTREAM" which takes chunked data. None of this is particularly amenable to use by socat (you could use NFS to make <path> available to a remote clamd, but that isn't recommended). Likewise, you can't just replace a connection to a UNIX domain socket with a connection to an INET socket. }-- End of excerpt from "Bill Cole" _______________________________________________ NOTE: If there is a disclaimer or other legal boilerplate in the above message, it is NULL AND VOID. You may ignore it. Visit http://www.mimedefang.org and http://www.roaringpenguin.com MIMEDefang mailing list [email protected] http://lists.roaringpenguin.com/mailman/listinfo/mimedefang