From 095b2e1234ea892c9b115d395053ad6ddeb48d27 Mon Sep 17 00:00:00 2001
From: Stephan Bosch <stephan.bosch@dovecot.fi>
Date: Sat, 3 Mar 2018 10:28:07 +0100
Subject: [PATCH] testsuite: Make SMTP actions also work inside executed sieve
 scripts.

---
 src/testsuite/testsuite-script.c | 19 +++++++++++--------
 1 file changed, 11 insertions(+), 8 deletions(-)

diff --git a/src/testsuite/testsuite-script.c b/src/testsuite/testsuite-script.c
index 5e10caf1f..a8804b1c8 100644
--- a/src/testsuite/testsuite-script.c
+++ b/src/testsuite/testsuite-script.c
@@ -14,6 +14,7 @@
 #include "testsuite-common.h"
 #include "testsuite-settings.h"
 #include "testsuite-log.h"
+#include "testsuite-smtp.h"
 #include "testsuite-result.h"
 
 #include "testsuite-script.h"
@@ -115,10 +116,11 @@ bool testsuite_script_run(const struct sieve_runtime_env *renv)
 		return FALSE;
 	}
 	scriptenv.default_mailbox = "INBOX";
-	scriptenv.smtp_start = NULL;
-	scriptenv.smtp_add_rcpt = NULL;
-	scriptenv.smtp_send = NULL;
-	scriptenv.smtp_finish = NULL;
+	scriptenv.smtp_start = testsuite_smtp_start;
+	scriptenv.smtp_add_rcpt = testsuite_smtp_add_rcpt;
+	scriptenv.smtp_send = testsuite_smtp_send;
+	scriptenv.smtp_abort = testsuite_smtp_abort;
+	scriptenv.smtp_finish = testsuite_smtp_finish;
 	scriptenv.duplicate_mark = NULL;
 	scriptenv.duplicate_check = NULL;
 	scriptenv.trace_log = renv->scriptenv->trace_log;
@@ -193,10 +195,11 @@ bool testsuite_script_multiscript
 		return FALSE;
 	}
 	scriptenv.default_mailbox = "INBOX";
-	scriptenv.smtp_start = NULL;
-	scriptenv.smtp_add_rcpt = NULL;
-	scriptenv.smtp_send = NULL;
-	scriptenv.smtp_finish = NULL;
+	scriptenv.smtp_start = testsuite_smtp_start;
+	scriptenv.smtp_add_rcpt = testsuite_smtp_add_rcpt;
+	scriptenv.smtp_send = testsuite_smtp_send;
+	scriptenv.smtp_abort = testsuite_smtp_abort;
+	scriptenv.smtp_finish = testsuite_smtp_finish;
 	scriptenv.duplicate_mark = NULL;
 	scriptenv.duplicate_check = NULL;
 	scriptenv.trace_log = renv->scriptenv->trace_log;
-- 
GitLab