diff --git a/tests/data/Makefile.inc b/tests/data/Makefile.inc
index 6467ca0bbe..3101da69fe 100644
--- a/tests/data/Makefile.inc
+++ b/tests/data/Makefile.inc
@@ -97,7 +97,8 @@ test900 test901 test902 test903 test904 test905 test906 test907 test908 \
test909 test910 test911 test912 test913 test914 test915 test916 test917 \
test918 test919 test920 test921 test922 test923 test924 test925 test926 \
test927 test928 test929 test930 test931 test932 test933 test934 test935 \
-test936 test937 test938 test939 test940 test941 \
+test936 test937 test938 test939 test940 test941 test942 test943 test944 \
+test945 test946 test947 test948 test949 test950 test951 test952 test953 \
\
test1000 test1001 test1002 test1003 test1004 test1005 test1006 test1007 \
test1008 test1009 test1010 test1011 test1012 test1013 test1014 test1015 \
diff --git a/tests/data/test942 b/tests/data/test942
new file mode 100644
index 0000000000..fb4cfbfb3a
--- /dev/null
+++ b/tests/data/test942
@@ -0,0 +1,56 @@
+
+
+
+IMAP
+SASL
+SASL AUTH EXTERNAL
+RFC4422
+
+
+
+#
+# Server-side
+
+
+AUTH EXTERNAL
+REPLY AUTHENTICATE +
+REPLY dXNlcg== A002 OK AUTHENTICATE completed
+
+
+From: me@somewhere
+To: fake@nowhere
+
+body
+
+--
+ yours sincerely
+
+
+
+#
+# Client-side
+
+
+imap
+
+
+IMAP external authentication
+
+
+'imap://user;AUTH=EXTERNAL@%HOSTIP:%IMAPPORT/942/;UID=1'
+
+
+
+#
+# Verify data after the test has been "shot"
+
+
+A001 CAPABILITY
+A002 AUTHENTICATE EXTERNAL
+dXNlcg==
+A003 SELECT 942
+A004 FETCH 1 BODY[]
+A005 LOGOUT
+
+
+
diff --git a/tests/data/test943 b/tests/data/test943
new file mode 100644
index 0000000000..833a92b83f
--- /dev/null
+++ b/tests/data/test943
@@ -0,0 +1,56 @@
+
+
+
+IMAP
+SASL
+SASL AUTH EXTERNAL
+RFC4422
+
+
+
+#
+# Server-side
+
+
+AUTH EXTERNAL
+REPLY AUTHENTICATE +
+REPLY = A002 OK AUTHENTICATE completed
+
+
+From: me@somewhere
+To: fake@nowhere
+
+body
+
+--
+ yours sincerely
+
+
+
+#
+# Client-side
+
+
+imap
+
+
+IMAP external authentication without credentials
+
+
+'imap://;AUTH=EXTERNAL@%HOSTIP:%IMAPPORT/943/;UID=1'
+
+
+
+#
+# Verify data after the test has been "shot"
+
+
+A001 CAPABILITY
+A002 AUTHENTICATE EXTERNAL
+=
+A003 SELECT 943
+A004 FETCH 1 BODY[]
+A005 LOGOUT
+
+
+
diff --git a/tests/data/test944 b/tests/data/test944
new file mode 100644
index 0000000000..3328953c23
--- /dev/null
+++ b/tests/data/test944
@@ -0,0 +1,56 @@
+
+
+
+IMAP
+SASL
+SASL AUTH EXTERNAL
+SASL-IR
+RFC4422
+
+
+
+#
+# Server-side
+
+
+AUTH EXTERNAL
+CAPA SASL-IR
+REPLY AUTHENTICATE A002 OK AUTHENTICATE completed
+
+
+From: me@somewhere
+To: fake@nowhere
+
+body
+
+--
+ yours sincerely
+
+
+
+#
+# Client-side
+
+
+imap
+
+
+IMAP external authentication with initial response
+
+
+'imap://user;AUTH=EXTERNAL@%HOSTIP:%IMAPPORT/944/;UID=1'
+
+
+
+#
+# Verify data after the test has been "shot"
+
+
+A001 CAPABILITY
+A002 AUTHENTICATE EXTERNAL dXNlcg==
+A003 SELECT 944
+A004 FETCH 1 BODY[]
+A005 LOGOUT
+
+
+
diff --git a/tests/data/test945 b/tests/data/test945
new file mode 100644
index 0000000000..158b3579a0
--- /dev/null
+++ b/tests/data/test945
@@ -0,0 +1,56 @@
+
+
+
+IMAP
+SASL
+SASL AUTH EXTERNAL
+SASL-IR
+RFC4422
+
+
+
+#
+# Server-side
+
+
+AUTH EXTERNAL
+CAPA SASL-IR
+REPLY AUTHENTICATE A002 OK AUTHENTICATE completed
+
+
+From: me@somewhere
+To: fake@nowhere
+
+body
+
+--
+ yours sincerely
+
+
+
+#
+# Client-side
+
+
+imap
+
+
+IMAP external authentication with initial response without credentials
+
+
+'imap://;AUTH=EXTERNAL@%HOSTIP:%IMAPPORT/945/;UID=1'
+
+
+
+#
+# Verify data after the test has been "shot"
+
+
+A001 CAPABILITY
+A002 AUTHENTICATE EXTERNAL =
+A003 SELECT 945
+A004 FETCH 1 BODY[]
+A005 LOGOUT
+
+
+
diff --git a/tests/data/test946 b/tests/data/test946
new file mode 100644
index 0000000000..46f7b10b36
--- /dev/null
+++ b/tests/data/test946
@@ -0,0 +1,57 @@
+
+
+
+POP3
+SASL
+SASL AUTH EXTERNAL
+RFC1734
+RFC4422
+RFC5034
+
+
+
+#
+# Server-side
+
+
+AUTH EXTERNAL
+REPLY AUTH +
+REPLY dXNlcg== +OK Login successful
+
+
+From: me@somewhere
+To: fake@nowhere
+
+body
+
+--
+ yours sincerely
+
+
+
+#
+# Client-side
+
+
+pop3
+
+
+POP3 external authentication
+
+
+'pop3://user;AUTH=EXTERNAL@%HOSTIP:%POP3PORT/946'
+
+
+
+#
+# Verify data after the test has been "shot"
+
+
+CAPA
+AUTH EXTERNAL
+dXNlcg==
+RETR 946
+QUIT
+
+
+
diff --git a/tests/data/test947 b/tests/data/test947
new file mode 100644
index 0000000000..df1474ea20
--- /dev/null
+++ b/tests/data/test947
@@ -0,0 +1,57 @@
+
+
+
+POP3
+SASL
+SASL AUTH EXTERNAL
+RFC1734
+RFC4422
+RFC5034
+
+
+
+#
+# Server-side
+
+
+AUTH EXTERNAL
+REPLY AUTH +
+REPLY = +OK Login successful
+
+
+From: me@somewhere
+To: fake@nowhere
+
+body
+
+--
+ yours sincerely
+
+
+
+#
+# Client-side
+
+
+pop3
+
+
+POP3 external authentication without credentials
+
+
+'pop3://;AUTH=EXTERNAL@%HOSTIP:%POP3PORT/947'
+
+
+
+#
+# Verify data after the test has been "shot"
+
+
+CAPA
+AUTH EXTERNAL
+=
+RETR 947
+QUIT
+
+
+
diff --git a/tests/data/test948 b/tests/data/test948
new file mode 100644
index 0000000000..4ed21cb1fd
--- /dev/null
+++ b/tests/data/test948
@@ -0,0 +1,56 @@
+
+
+
+POP3
+SASL
+SASL AUTH EXTERNAL
+SASL-IR
+RFC1734
+RFC4422
+RFC5034
+
+
+
+#
+# Server-side
+
+
+AUTH EXTERNAL
+REPLY AUTH +OK Login successful
+
+
+From: me@somewhere
+To: fake@nowhere
+
+body
+
+--
+ yours sincerely
+
+
+
+#
+# Client-side
+
+
+pop3
+
+
+POP3 external authentication with initial response
+
+
+'pop3://user;AUTH=EXTERNAL@%HOSTIP:%POP3PORT/948' --sasl-ir
+
+
+
+#
+# Verify data after the test has been "shot"
+
+
+CAPA
+AUTH EXTERNAL dXNlcg==
+RETR 948
+QUIT
+
+
+
diff --git a/tests/data/test949 b/tests/data/test949
new file mode 100644
index 0000000000..93f7f97f4b
--- /dev/null
+++ b/tests/data/test949
@@ -0,0 +1,56 @@
+
+
+
+POP3
+SASL
+SASL AUTH EXTERNAL
+SASL-IR
+RFC1734
+RFC4422
+RFC5034
+
+
+
+#
+# Server-side
+
+
+AUTH EXTERNAL
+REPLY AUTH +OK Login successful
+
+
+From: me@somewhere
+To: fake@nowhere
+
+body
+
+--
+ yours sincerely
+
+
+
+#
+# Client-side
+
+
+pop3
+
+
+POP3 external authentication with initial response without credentials
+
+
+'pop3://;AUTH=EXTERNAL@%HOSTIP:%POP3PORT/949' --sasl-ir
+
+
+
+#
+# Verify data after the test has been "shot"
+
+
+CAPA
+AUTH EXTERNAL =
+RETR 949
+QUIT
+
+
+
diff --git a/tests/data/test950 b/tests/data/test950
new file mode 100644
index 0000000000..b4dab8ae8b
--- /dev/null
+++ b/tests/data/test950
@@ -0,0 +1,56 @@
+
+
+
+SMTP
+SASL
+SASL AUTH EXTERNAL
+RFC4422
+RFC4954
+
+
+
+#
+# Server-side
+
+
+AUTH EXTERNAL
+REPLY AUTH 334 EXTERNAL supported
+REPLY dXNlcg== 235 Authenticated
+
+
+
+#
+# Client-side
+
+
+smtp
+
+
+SMTP external authentication
+
+
+mail body
+
+
+'smtp://user;AUTH=EXTERNAL@%HOSTIP:%SMTPPORT/950' --mail-rcpt recipient@example.com --mail-from sender@example.com -T -
+
+
+
+#
+# Verify data after the test has been "shot"
+
+
+EHLO 950
+AUTH EXTERNAL
+dXNlcg==
+MAIL FROM:
+RCPT TO:
+DATA
+QUIT
+
+
+mail body
+.
+
+
+
diff --git a/tests/data/test951 b/tests/data/test951
new file mode 100644
index 0000000000..1dd21a6795
--- /dev/null
+++ b/tests/data/test951
@@ -0,0 +1,56 @@
+
+
+
+SMTP
+SASL
+SASL AUTH EXTERNAL
+RFC4422
+RFC4954
+
+
+
+#
+# Server-side
+
+
+AUTH EXTERNAL
+REPLY AUTH 334 EXTERNAL supported
+REPLY = 235 Authenticated
+
+
+
+#
+# Client-side
+
+
+smtp
+
+
+SMTP external authentication without credentials
+
+
+mail body
+
+
+'smtp://;AUTH=EXTERNAL@%HOSTIP:%SMTPPORT/951' --mail-rcpt recipient@example.com --mail-from sender@example.com -T -
+
+
+
+#
+# Verify data after the test has been "shot"
+
+
+EHLO 951
+AUTH EXTERNAL
+=
+MAIL FROM:
+RCPT TO:
+DATA
+QUIT
+
+
+mail body
+.
+
+
+
diff --git a/tests/data/test952 b/tests/data/test952
new file mode 100644
index 0000000000..8537afd121
--- /dev/null
+++ b/tests/data/test952
@@ -0,0 +1,55 @@
+
+
+
+SMTP
+SASL
+SASL AUTH EXTERNAL
+SASL-IR
+RFC4422
+RFC4954
+
+
+
+#
+# Server-side
+
+
+AUTH EXTERNAL
+REPLY AUTH 235 Authenticated
+
+
+
+#
+# Client-side
+
+
+smtp
+
+
+SMTP external authentication with initial response
+
+
+mail body
+
+
+'smtp://user;AUTH=EXTERNAL@%HOSTIP:%SMTPPORT/952' --mail-rcpt recipient@example.com --mail-from sender@example.com --sasl-ir -T -
+
+
+
+#
+# Verify data after the test has been "shot"
+
+
+EHLO 952
+AUTH EXTERNAL dXNlcg==
+MAIL FROM:
+RCPT TO:
+DATA
+QUIT
+
+
+mail body
+.
+
+
+
diff --git a/tests/data/test953 b/tests/data/test953
new file mode 100644
index 0000000000..94db3aaae5
--- /dev/null
+++ b/tests/data/test953
@@ -0,0 +1,55 @@
+
+
+
+SMTP
+SASL
+SASL AUTH EXTERNAL
+SASL-IR
+RFC4422
+RFC4954
+
+
+
+#
+# Server-side
+
+
+AUTH EXTERNAL
+REPLY AUTH 235 Authenticated
+
+
+
+#
+# Client-side
+
+
+smtp
+
+
+SMTP external authentication with initial response without credentials
+
+
+mail body
+
+
+'smtp://;AUTH=EXTERNAL@%HOSTIP:%SMTPPORT/953' --mail-rcpt recipient@example.com --mail-from sender@example.com --sasl-ir -T -
+
+
+
+#
+# Verify data after the test has been "shot"
+
+
+EHLO 953
+AUTH EXTERNAL =
+MAIL FROM:
+RCPT TO:
+DATA
+QUIT
+
+
+mail body
+.
+
+
+