From 0de9945258c2e7910c35f715caf07c5e9270aa1b Mon Sep 17 00:00:00 2001 From: Jeremy Harris Date: Tue, 12 May 2020 23:10:08 +0100 Subject: smtp transport: message_linelength_limit option. Bug 1684 --- test/confs/0588 | 42 +++++++++++++++++++++++++++++++++++++++++ test/log/0588 | 15 +++++++++++++++ test/scripts/0000-Basic/0588 | 45 ++++++++++++++++++++++++++++++++++++++++++++ test/stdout/0572 | 1 + test/stdout/0588 | 40 +++++++++++++++++++++++++++++++++++++++ 5 files changed, 143 insertions(+) create mode 100644 test/confs/0588 create mode 100644 test/log/0588 create mode 100644 test/scripts/0000-Basic/0588 create mode 100644 test/stdout/0588 (limited to 'test') diff --git a/test/confs/0588 b/test/confs/0588 new file mode 100644 index 000000000..9a88c9c52 --- /dev/null +++ b/test/confs/0588 @@ -0,0 +1,42 @@ +# Exim test configuration 0588 + +.include DIR/aux-var/std_conf_prefix + +log_selector = +received_recipients +sender_on_delivery +millisec + +# ----- Main settings ----- + +acl_smtp_rcpt = accept + +# ----- Routers ----- + +begin routers + +rx_dump: + driver = redirect + condition = ${if !eq {$received_ip_address}{127.0.0.1}} + data = :blackhole: + +smtp_try: + driver = accept + transport = send_to_server + +# ----- Transports ----- + +begin transports + +send_to_server: + driver = smtp + hosts = HOSTIPV4 + allow_localhost + port = PORT_D + hosts_try_fastopen = : + +# ----- Retry ----- + +begin retry + +* * F,5d,10s + +# End + diff --git a/test/log/0588 b/test/log/0588 new file mode 100644 index 000000000..944645114 --- /dev/null +++ b/test/log/0588 @@ -0,0 +1,15 @@ + +******** SERVER ******** +2017-07-30 18:51:05.712 exim x.yz daemon started: pid=pppp, no queue runs, listening for SMTP on port PORT_D +2017-07-30 18:51:05.712 10HmaX-0005vi-00 <= CALLER@test.ex H=(test) [127.0.0.1] P=smtp S=sss for good@test.ex +2017-07-30 18:51:05.712 10HmaY-0005vi-00 <= CALLER@test.ex H=(test) [127.0.0.1] P=smtp S=sss for bad@test.ex +2017-07-30 18:51:05.712 10HmaZ-0005vi-00 <= CALLER@test.ex H=the.local.host.name [ip4.ip4.ip4.ip4] P=esmtp S=sss for good@test.ex +2017-07-30 18:51:05.712 10HmaZ-0005vi-00 => :blackhole: R=rx_dump +2017-07-30 18:51:05.712 10HmaZ-0005vi-00 Completed +2017-07-30 18:51:05.712 10HmaX-0005vi-00 => good@test.ex F= R=smtp_try T=send_to_server H=ip4.ip4.ip4.ip4 [ip4.ip4.ip4.ip4] C="250 OK id=10HmaZ-0005vi-00" +2017-07-30 18:51:05.712 10HmaX-0005vi-00 Completed +2017-07-30 18:51:05.712 10HmaY-0005vi-00 ** bad@test.ex F= R=smtp_try T=send_to_server: message has lines too long for transport +2017-07-30 18:51:05.712 10HmbA-0005vi-00 <= <> R=10HmaY-0005vi-00 U=EXIMUSER P=local S=sss for CALLER@test.ex +2017-07-30 18:51:05.712 10HmbA-0005vi-00 => :blackhole: R=rx_dump +2017-07-30 18:51:05.712 10HmbA-0005vi-00 Completed +2017-07-30 18:51:05.712 10HmaY-0005vi-00 Completed diff --git a/test/scripts/0000-Basic/0588 b/test/scripts/0000-Basic/0588 new file mode 100644 index 000000000..44328a70c --- /dev/null +++ b/test/scripts/0000-Basic/0588 @@ -0,0 +1,45 @@ +# message_linelength_limit +# +# The "write" script cmd subtracts 1 for the newline, +# and the linecount in exim doesn't count the line-ending. +write test-data-good 1x999 +++++ +**** +write test-data-bad 1x1000 +++++ +**** +# +exim -bd -DSERVER=server -oX PORT_D +**** +client 127.0.0.1 PORT_D +??? 220 +HELO test +??? 250 +MAIL FROM: +??? 250 +RCPT TO: +??? 250 +DATA +??? 354 +Subject: should be good + +<<< test-data-good +. +??? 250 +MAIL FROM: +??? 250 +RCPT TO: +??? 250 +DATA +??? 354 +Subject: should be bad + +<<< test-data-bad +. +??? 250 +QUIT +??? 221 +**** +# +sleep 1 +killdaemon diff --git a/test/stdout/0572 b/test/stdout/0572 index d66f928d4..fd77c72b7 100644 --- a/test/stdout/0572 +++ b/test/stdout/0572 @@ -64,6 +64,7 @@ interface = ip4.ip4.ip4.ip4 keepalive no_lmtp_ignore_quota max_rcpt = 100 +message_linelength_limit = 998 multi_domain port = 1224 protocol = smtp diff --git a/test/stdout/0588 b/test/stdout/0588 new file mode 100644 index 000000000..994f04e2e --- /dev/null +++ b/test/stdout/0588 @@ -0,0 +1,40 @@ +Connecting to 127.0.0.1 port 1225 ... connected +??? 220 +<<< 220 the.local.host.name ESMTP Exim x.yz Tue, 2 Mar 1999 09:44:33 +0000 +>>> HELO test +??? 250 +<<< 250 the.local.host.name Hello test [127.0.0.1] +>>> MAIL FROM: +??? 250 +<<< 250 OK +>>> RCPT TO: +??? 250 +<<< 250 Accepted +>>> DATA +??? 354 +<<< 354 Enter message, ending with "." on a line by itself +>>> Subject: should be good +>>> +>>> aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa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