From 8bd1e834177d0fff0f50ab2a8ef846a0dc10cb55 Mon Sep 17 00:00:00 2001
From: al_xipe <al_xipe@localhost>
Date: Fri, 16 Mar 2007 15:25:26 +0000
Subject: [PATCH] 1. work around a limitation in the implementation of ant's mail task. The mere fact of specifying the user and password parameters will have the task try to use SMTP authentication even though the parameter value is empty. So I had to split the target in three. One global target that check the user variable length, one that sends the email with SMTP auth and one that sends the email without SMTP auth.

---
 opendj-sdk/opends/tests/functional-tests/staf-installer.xml |   24 ++++++++++++++++++++----
 1 files changed, 20 insertions(+), 4 deletions(-)

diff --git a/opendj-sdk/opends/tests/functional-tests/staf-installer.xml b/opendj-sdk/opends/tests/functional-tests/staf-installer.xml
index 2a0a716..ef19558 100644
--- a/opendj-sdk/opends/tests/functional-tests/staf-installer.xml
+++ b/opendj-sdk/opends/tests/functional-tests/staf-installer.xml
@@ -620,10 +620,27 @@
       <equals arg1="${email.enabled}" arg2="y" 
               casesensitive="false" trim="true"/>
     </condition>
-    <antcall target="send-report-email"/>
+    <antcall target="send-mail"/>
   </target>
 
-  <target name="send-report-email" if="email.send">
+  <target name="send-email" if="email.send">
+    <condition property="email.send.auth">
+      <length string="${email.server.user}" when="greater" length="0"/>
+    </condition>
+    <antcall target="send-mail-noauth"/>
+    <antcall target="send-mail-withauth"/>
+  </target>
+  <target name="send-mail-noauth" if="email.send.noauth">
+    <mail from="${email.from}" 
+          tolist="${email.to}" 
+          subject="FT - ${daily.date} - ${os.name} - ${os.arch}"
+          files="${staf.tmp.dir}/results.html"
+          mailhost="${email.server.host}"
+          mailport="${email.server.port}"
+          messagefile="${staf.tmp.dir}/results.html"
+          messagemimetype="text/html" />
+  </target>
+  <target name="send-mail-withauth" unless="email.send.noauth">
     <mail from="${email.from}" 
           tolist="${email.to}" 
           subject="FT - ${daily.date} - ${os.name} - ${os.arch}"
@@ -633,8 +650,7 @@
           user="${email.server.user}"
           password="${email.server.pwd}"
           messagefile="${staf.tmp.dir}/results.html"
-          messagemimetype="text/html">
-    </mail>
+          messagemimetype="text/html" />
   </target>
   
   <target name="daily">

--
Gitblit v1.10.0