(2) A line that starts with "*sleep" specifies a number of seconds to wait
before proceeding.
-(3) A line containing "*eof" specifies that the client is expected to close
+(3) A line containing "*data" and a number specifies that the client is
+ expected to send that many byte; the server discards them
+
+(4) A line containing "*eof" specifies that the client is expected to close
the connection at this point.
-(4) A line containing just '.' specifies that the client is expected to send
+(5) A line containing just '.' specifies that the client is expected to send
many lines, terminated by one that contains just a dot.
-(5) Otherwise, the line defines the start of an input line that the client
+(6) Otherwise, the line defines the start of an input line that the client
is expected to send. To allow for lines that start with digits, the line
may start with '<', which is not taken as part of the input data. If the
lines starts with '<<' then only the characters are expected; no return-
# Content-scan: clamav interface
OPT=
+SRV=unset
CONTROL=
.include DIR/aux-var/std_conf_prefix
log_selector = +subject
primary_hostname = myhost.test.ex
-#XXX we need an additional test for tcp-connected clamd
-av_scanner = clamd : DIR/eximdir/clam_sock CONTROL
+av_scanner = clamd : SRV CONTROL
# ----- Main settings -----
1999-03-02 09:44:33 10HmbC-0005vi-00 <= CALLER@myhost.test.ex U=CALLER P=local-esmtp S=sss T="message should be accepted after a retry"
1999-03-02 09:44:33 10HmbC-0005vi-00 => :blackhole: <userx@test.ex> R=r
1999-03-02 09:44:33 10HmbC-0005vi-00 Completed
+1999-03-02 09:44:33 10HmbD-0005vi-00 <= CALLER@myhost.test.ex U=CALLER P=local-esmtp S=sss T="message should be accepted"
+1999-03-02 09:44:33 10HmbD-0005vi-00 => :blackhole: <userx@test.ex> R=r
+1999-03-02 09:44:33 10HmbD-0005vi-00 Completed
#
# SCAN command interface, on a unix socket, only. No ExtendedDetectionInfo.
#
+# Pass
server DIR/eximdir/clam_sock
<SCAN
>LF>scanned_file_name: OK
-<*eof
+*eof
****
#
#
#
-exim -odi -bs -DOPT=
+exim -odi -bs -DSRV=DIR/eximdir/clam_sock -DOPT=
ehlo test.ex
mail from:<>
rcpt to:<userx@test.ex>
#
#
#
+# fail/error
server DIR/eximdir/clam_sock
<SCAN
>LF>scanned_file_name: 666 ERROR
-<*eof
+*eof
****
#
#
#
-exim -odi -bs -DOPT=
+exim -odi -bs -DSRV=DIR/eximdir/clam_sock -DOPT=
ehlo test.ex
mail from:<>
rcpt to:<userx@test.ex>
#
#
#
+# fail/virus-found
server DIR/eximdir/clam_sock
<SCAN
>LF>scanned_file_name: VNAME FOUND
-<*eof
+*eof
****
#
#
#
-exim -odi -bs -DOPT=/defer_ok
+exim -odi -bs -DSRV=DIR/eximdir/clam_sock -DOPT=/defer_ok
ehlo test.ex
mail from:<>
rcpt to:<userx@test.ex>
#
#
#
+# times out
server DIR/eximdir/clam_sock
*sleep 3
****
#
#
#
-exim -odi -bs -DOPT="/ tmo=2s"
+exim -odi -bs -DSRV=DIR/eximdir/clam_sock -DOPT="/ tmo=2s"
ehlo test.ex
mail from:<>
rcpt to:<userx@test.ex>
#
#
#
+# times out
server DIR/eximdir/clam_sock
*sleep 3
****
#
#
#
-exim -odi -bs -DOPT="/ tmo=2s / defer_ok"
+exim -odi -bs -DSRV=DIR/eximdir/clam_sock -DOPT="/ tmo=2s / defer_ok"
ehlo test.ex
mail from:<>
rcpt to:<userx@test.ex>
#
#
#
+# connect-fail (server not initially listenting), retry
server -i 2 DIR/eximdir/clam_sock
<SCAN
>LF>scanned_file_name: OK
-<*eof
+*eof
****
#
-exim -odi -bs -DCONTROL="retry=4s"
+exim -odi -bs -DSRV=DIR/eximdir/clam_sock -DCONTROL="retry=4s"
ehlo test.ex
mail from:<>
rcpt to:<userx@test.ex>
quit
****
#
+################################################################################
+#
+# TCP clamd server connection, default protocol
+# only checks the protocol header, filesize element and start of eml file lines;
+# not the post-file protocol mark
+# Pass
+server PORT_D
+<zINSTREAM\x00\x00\x00\x01\xe5From MAILER-DAEMON
+<X-Envelope-From: <
+<X-Envelope-To: userx@test.ex
+<Received: from
+<\x09by myhost.test.ex with local-esmtp
+<\x09(envelope-from <
+<\x09id
+<\x09for userx@test.ex;
+<Date:
+<Subject: message should be accepted
+<Message-Id: <
+<From:
+<
+<
+>LF>scanned_file_name: OK
+*eof
+****
+#
+exim -odi -bs -DSRV="127.0.0.1 PORT_D" -DOPT=
+ehlo test.ex
+mail from:<>
+rcpt to:<userx@test.ex>
+data
+Date: Fri, 17 Dec 2004 14:35:01 +0100
+Subject: message should be accepted
+
+.
+quit
+****
354 Enter message, ending with "." on a line by itself\r
250 OK id=10HmbC-0005vi-00\r
221 myhost.test.ex closing connection\r
+220 myhost.test.ex ESMTP Exim x.yz Tue, 2 Mar 1999 09:44:33 +0000\r
+250-myhost.test.ex Hello CALLER at test.ex\r
+250-SIZE 52428800\r
+250-8BITMIME\r
+250-PIPELINING\r
+250 HELP\r
+250 OK\r
+250 Accepted\r
+354 Enter message, ending with "." on a line by itself\r
+250 OK id=10HmbD-0005vi-00\r
+221 myhost.test.ex closing connection\r
******** SERVER ********
Listening on TESTSUITE/eximdir/clam_sock ...
Connection request
<SCAN TESTSUITE/spool/scan/10HmbB-0005vi-00/10HmbB-0005vi-00.eml
>LF>scanned_file_name: OK
-Unexpected EOF read from client
+Expected EOF read from client
End of script
Listening on TESTSUITE/eximdir/clam_sock ...
Connection request
<SCAN TESTSUITE/spool/scan/10HmaX-0005vi-00/10HmaX-0005vi-00.eml
>LF>scanned_file_name: 666 ERROR
-Unexpected EOF read from client
+Expected EOF read from client
End of script
Listening on TESTSUITE/eximdir/clam_sock ...
Connection request
<SCAN TESTSUITE/spool/scan/10HmbA-0005vi-00/10HmbA-0005vi-00.eml
>LF>scanned_file_name: VNAME FOUND
-Unexpected EOF read from client
+Expected EOF read from client
End of script
Listening on TESTSUITE/eximdir/clam_sock ...
Connection request
Connection request
<SCAN TESTSUITE/spool/scan/10HmbC-0005vi-00/10HmbC-0005vi-00.eml
>LF>scanned_file_name: OK
-Unexpected EOF read from client
+Expected EOF read from client
+End of script
+Listening on port 1225 ...
+Connection request from [127.0.0.1]
+<zINSTREAM
+<X-Envelope-From: <CALLER@myhost.test.ex>
+<X-Envelope-To: userx@test.ex
+<Received: from CALLER (helo=test.ex)
+< by myhost.test.ex with local-esmtp (Exim x.yz)
+< (envelope-from <CALLER@myhost.test.ex>)
+< id 10HmbD-0005vi-00
+< for userx@test.ex; Tue, 2 Mar 1999 09:44:33 +0000
+<Date: Tue, 2 Mar 1999 09:44:33 +0000
+<Subject: message should be accepted
+<Message-Id: <E10HmbD-0005vi-00@myhost.test.ex>
+<From: CALLER_NAME <CALLER@myhost.test.ex>
+<
+<
+>LF>scanned_file_name: OK
+Expected EOF read from client
End of script