[PATCH] Tests: added XCLIENT escaping test
Maxim Dounin
mdounin at mdounin.ru
Mon Mar 30 02:17:20 UTC 2026
# HG changeset patch
# User Maxim Dounin <mdounin at mdounin.ru>
# Date 1774836314 -10800
# Mon Mar 30 05:05:14 2026 +0300
# Node ID 950057e70ea4ce340cc1537c84d9da617cca7504
# Parent d7cbb4aa6548e5bcf520ada9053327600829f8dd
Tests: added XCLIENT escaping test.
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:<test at example.com>');
$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");
+
+}
+
###############################################################################
More information about the nginx-devel
mailing list