-# CHUNKING transmission, short messages
-#
-# Start with non-pipelined cases
-#
-# Basic short message
-server PORT_S
-220 Greetings
-EHLO
-250-Hello there
-250 CHUNKING
-MAIL FROM
-250 OK
-RCPT TO
-250 OK
-BDAT 343 LAST
-*data 343
-250 OK
-QUIT
-225 OK
-*eof
-****
-exim -odf a@test.ex
-Subject: foo
-
-data
-****
-#
-# Error case: server wrongly expected more data, client gets timeout for data-ack
-server PORT_S
-220 Greetings
-EHLO
-250-Hello there
-250 CHUNKING
-MAIL FROM
-250 good mail cmd
-RCPT TO
-250 acceptable rcpt cmd
-BDAT 343 LAST
-*data 344
-250 OK got that data
-QUIT
-225 OK quitting
-****
-exim -odf b@test.ex
-Subject: foo
-
-data
-****
-#
-# Error case: server wrongly expected less data
-# client get the data-ack, sends quit - but server
-# sees a munged quit due to the outstanding data tail
-server PORT_S
-220 Greetings
-EHLO
-250-Hello there
-250 CHUNKING
-MAIL FROM
-250 OK
-RCPT TO
-250 OK
-BDAT 343 LAST
-*data 342
-250 OK
-QUIT
-225 OK
-****
-exim -odf c@test.ex
-Subject: foo
-
-data
-****
-#
-# server rejects BDAT cmd
-server PORT_S
-220 Greetings
-EHLO
-250-Hello there
-250 CHUNKING
-MAIL FROM
-250 OK
-RCPT TO
-250 OK
-BDAT 343 LAST
-*data 343
-500 oops
-QUIT
-225 OK
-****
-exim -odf d@test.ex
-Subject: foo
+# CHUNKING reception, no pipelining
+exim -DSERVER=server -bd -oX PORT_D
+****
+#
+# plain, small message (no body)
+client 127.0.0.1 PORT_D
+??? 220
+ehlo tester
+??? 250-
+??? 250-SIZE
+??? 250-8BITMIME
+??? 250-CHUNKING
+??? 250 HELP
+mail from:someone1@some.domain
+??? 250
+rcpt to:CALLER@test.ex
+??? 250
+bdat 88 last
+To: Susan@random.com
+From: Sam@random.com
+Subject: This is a bodyless test message
-data
-****
-#
-# server tmp-rejects BDAT cmd
-server PORT_S
-220 Greetings
-EHLO
-250-Hello there
-250 CHUNKING
-MAIL FROM
-250 OK
-RCPT TO
-250 OK
-BDAT 343 LAST
-*data 343
-400 not right now
-QUIT
-225 OK
-****
-exim -odf e@test.ex
-Subject: foo
+??? 250-
+??? 250
+quit
+??? 221
+****
+#
+# plain, small message (with body)
+# nonlast 1st bdat, noop, last-bdat(0)
+# immediate followon 2nd message
+client 127.0.0.1 PORT_D
+??? 220
+ehlo tester
+??? 250-
+??? 250-
+??? 250-
+??? 250-
+??? 250
+mail from:someone2@some.domain
+??? 250
+rcpt to:CALLER@test.ex
+??? 250
+bdat 100
+To: Susan@random.com
+From: Sam@random.com
+Subject: This is a bodyfull test message
-data
-****
-#
-#
-###################################################
-#
-# Pipelined cases
-#
-# Basic short message
-server PORT_S
-220 Greetings
-EHLO
-250-Hello there
-250-PIPELINING
-250 CHUNKING
-MAIL FROM
-RCPT TO
-BDAT 343 LAST
-*data 343
-250 OK mail
-250 OK rcpt
-250 OK bdat
-QUIT
-225 OK
-*eof
-****
-exim -odf p@test.ex
-Subject: foo
+1234567890
+??? 250
+noop
+??? 250
+bdat 0 last
+??? 250-
+??? 250
+mail from:someone3@some.domain
+??? 250
+rcpt to:CALLER@test.ex
+??? 250
+bdat 10
+To: Susan@bdat 78 last
+??? 250
+random.com
+From: Sam@random.com
+Subject: This is a bodyless test message
-data
-****
-#
-# Error case: server wrongly expected more data, client gets timeout for data-ack
-server PORT_S
-220 Greetings
-EHLO
-250-Hello there
-250-PIPELINING
-250 CHUNKING
-MAIL FROM
-RCPT TO
-BDAT 343 LAST
-*data 344
-250 good mail cmd
-****
-exim -odf q@test.ex
-Subject: foo
+??? 250-
+??? 250
+quit
+??? 221
+****
+#
+# not enough data in chunk
+#
+client 127.0.0.1 PORT_D
+??? 220
+ehlo tester
+??? 250-
+??? 250-
+??? 250-
+??? 250-
+??? 250
+mail from:someone4@some.domain
+??? 250
+rcpt to:CALLER@test.ex
+??? 250
+bdat 89 last
+To: Susan@random.com
+From: Sam@random.com
+Subject: This is a bodyless test message
-data
-****
-#
-# Error case: server wrongly expected less data
-# client get the data-ack, sends quit - but server
-# sees a munged quit due to the outstanding data tail
-server PORT_S
-220 Greetings
-EHLO
-250-Hello there
-250-PIPELINING
-250 CHUNKING
-MAIL FROM
-RCPT TO
-BDAT 343 LAST
-*data 342
-250 OK mail
-250 OK rcpt
-250 OK bdat
-QUIT
-225 OK
-****
-exim -odf r@test.ex
-Subject: foo
+??? 421
+****
+#
+# protocol failure cases
+#
+client 127.0.0.1 PORT_D
+??? 220
+ehlo tester
+??? 250-
+??? 250-
+??? 250-
+??? 250-
+??? 250
+mail from:someone5@some.domain
+??? 250
+rcpt to:CALLER@test.ex
+??? 250
+bdat 88
+To: Susan@random.com
+From: Sam@random.com
+Subject: This is a bodyless test message
-data
-****
-#
-# server rejects MAIL cmd
-# transport coding does not handle the possible RSET-and-another transaction,
-# but always QUITs
-server PORT_S
-220 Greetings
-EHLO
-250-Hello there
-250-PIPELINING
-250 CHUNKING
-MAIL FROM
-RCPT TO
-BDAT 343 LAST
-*data 343
-550 unacceptable mail-from
-550 rcpt ungood lacking mail-from
-500 bdat ungood lacking mail-from
-QUIT
-225 OK
-****
-exim -odf s@test.ex
-Subject: foo
+??? 250
+bdat 0
+??? 504
+quit
+??? 221
+****
+#
+# followon EHLO and another message
+client 127.0.0.1 PORT_D
+??? 220
+ehlo tester
+??? 250-
+??? 250-
+??? 250-
+??? 250-
+??? 250
+mail from:someone6@some.domain
+??? 250
+rcpt to:CALLER@test.ex
+??? 250
+bdat 88
+To: Susan@random.com
+From: Sam@random.com
+Subject: This is a bodyless test message
+??? 250
data
-****
-#
-# server tmp-rejects MAIL cmd
-server PORT_S
-220 Greetings
-EHLO
-250-Hello there
-250-PIPELINING
-250 CHUNKING
-MAIL FROM
-RCPT TO
-BDAT 344 LAST
-*data 344
-450 greylisted mail-from
-550 rcpt ungood lacking mail-from
-500 bdat ungood lacking mail-from
-QUIT
-225 OK
-****
-exim -odf s1@test.ex
-Subject: foo
+??? 503
+RSET
+??? 250
+EHLO tester
+??? 250-
+??? 250-
+??? 250-
+??? 250-
+??? 250
+mail from:someone7@some.domain
+??? 250
+rcpt to:CALLER@test.ex
+??? 250
+bdat 88
+To: Susan@random.com
+From: Sam@random.com
+Subject: This is a bodyless test message
+??? 250
data
-****
-#
-# server rejects RCPT cmd
-server PORT_S
-220 Greetings
-EHLO
-250-Hello there
-250-PIPELINING
-250 CHUNKING
-MAIL FROM
-RCPT TO
-BDAT 343 LAST
-*data 343
-250 OK mail
-550 no such recipient
-500 oops bdat
-QUIT
-225 OK
-****
-exim -odf t@test.ex
-Subject: foo
-
+??? 503
data
-****
-#
-# server rejects BDAT cmd
-server PORT_S
-220 Greetings
-EHLO
-250-Hello there
-250-PIPELINING
-250 CHUNKING
-MAIL FROM
-RCPT TO
-BDAT 343 LAST
-*data 343
-250 OK mail
-250 OK rcpt
-500 oops bdat
-QUIT
-225 OK
-****
-exim -odf u@test.ex
-Subject: foo
+??? 503
+quit
+??? 221
+****
+#
+# plain, small message (no body), chunk data with bdat line
+client 127.0.0.1 PORT_D
+??? 220
+ehlo tester
+??? 250-
+??? 250-SIZE
+??? 250-8BITMIME
+??? 250-CHUNKING
+??? 250 HELP
+mail from:someone8@some.domain
+??? 250
+rcpt to:CALLER@test.ex
+??? 250
+bdat 88 last\r\nTo: Susan@random.com
+From: Sam@random.com
+Subject: This is a bodyless test message
-data
-****
-#
-# server tmp-rejects BDAT cmd
-server PORT_S
-220 Greetings
-EHLO
-250-Hello there
-250-PIPELINING
-250 CHUNKING
-MAIL FROM
-RCPT TO
-BDAT 343 LAST
-*data 343
-250 OK mail
-250 OK rcpt
-400 not right now bdat
-QUIT
-225 OK
-****
-exim -odf v@test.ex
-Subject: foo
+??? 250-
+??? 250
+quit
+??? 221
+****
+#
+# plain, small message (no body), 2 chunks, pipeline sync error for 2nd
+client 127.0.0.1 PORT_D
+??? 220
+ehlo tester
+??? 250-
+??? 250-SIZE
+??? 250-8BITMIME
+??? 250-CHUNKING
+??? 250 HELP
+mail from:someone9@some.domain
+??? 250
+rcpt to:CALLER@test.ex
+??? 250
+bdat 1\r\nTbdat 87 last
+To: Susan@random.com
+From: Sam@random.com
+Subject: This is a bodyless test message
-data
+??? 554 SMTP synchronization error
****
#
#
+killdaemon
no_msglog_check