details: http://freenginx.org/hg/nginx-tests/rev/091163f6b148
branches:
changeset: 2045:091163f6b148
user: Maxim Dounin <[email protected]>
date: Tue Mar 31 06:57:43 2026 +0300
description:
Tests: added XCLIENT escaping test.
diffstat:
mail_smtp_xclient.t | 16 +++++++++++++++-
1 files changed, 15 insertions(+), 1 deletions(-)
diffs (31 lines):
diff --git a/mail_smtp_xclient.t b/mail_smtp_xclient.t
--- a/mail_smtp_xclient.t
+++ b/mail_smtp_xclient.t
@@ -24,7 +24,7 @@ select STDOUT; $| = 1;
local $SIG{PIPE} = 'IGNORE';
-my $t = Test::Nginx->new()->has(qw/mail smtp http rewrite/)->plan(6)
+my $t = Test::Nginx->new()->has(qw/mail smtp http rewrite/)->plan(7)
->write_file_expand('nginx.conf', <<'EOF');
%%TEST_GLOBALS%%
@@ -139,4 +139,18 @@ my $s = Test::Nginx::SMTP->new();
$s->send('RCPT TO:<[email protected]>');
$s->ok('xclient, ehlo, from');
+# xclient argument escaping
+
+TODO: {
+local $TODO = 'not yet' unless $t->has_version('1.29.7');
+
+$s = Test::Nginx::SMTP->new();
+$s->read();
+$s->send('AUTH PLAIN ' . encode_base64("\0test\nfoo\@example.com\0secret",
''));
+$s->read();
+$s->send('QUIT');
+$s->ok("xclient xtext");
+
+}
+
###############################################################################