Process using <email:email> tag fails with error  Unknown SMTP host
search cancel

Process using <email:email> tag fails with error  Unknown SMTP host

book

Article ID: 255475

calendar_today

Updated On:

Products

Clarity PPM SaaS Clarity PPM On Premise

Issue/Introduction

Process using <email:email> tag fails with error  Unknown SMTP host

Steps to Reproduce: 

  • Getting error while executing the process which sends email as attachment using Jelly <email:email> tag, sample process code below 

    <gel:script
    xmlns:core="jelly:core"
    xmlns:util="jelly:util"
    xmlns:gel="jelly:com.niku.union.gel.GELTagLibrary"
    xmlns:files="jelly:com.niku.union.gel.FileTagLibrary"
    xmlns:email="jelly:email"
    xmlns:sql="jelly:sql">
    <core:invokeStatic className="java.lang.System" method="getenv" var="NIKU_HOME">
    <core:arg value="NIKU_HOME"/>
    </core:invokeStatic>
    <gel:parse file="${NIKU_HOME}/config/properties.xml" var="properties"/>
    <gel:set asString="true" select="$properties//mailServer/@host" var="mailServer"/>
    <gel:log>${mailServer}</gel:log>
    <gel:set asString="true" select = "$properties//mailServer/@port" var = "port"/>
    <gel:log>${port}</gel:log>
    <gel:set asString="true" select = "$properties//mailServer" var = "strMailServer"/>
    <gel:log> ${strMailServer} </gel:log>
    <email:email to="[email protected]" from="[email protected]" subject="Properties File" server="${mailServer}" attach="${NIKU_HOME}/config/properties.xml">
    Properties File
    </email:email>
    </gel:script>

Expected Results: The process should completed successfully

Actual Results: The process fails with below error 

BPM-0704: An error occurred while executing custom script: org.apache.commons.jelly.JellyTagException: null:14:64: <email:email> Unknown SMTP host: smtp.example.net:587 at org.apache.commons.jelly.tags.email.EmailTag.doTag(EmailTag.java:305) at org.apache.commons.jelly.impl.TagScript.run(TagScript.java:248) at org.apache.commons.jelly.impl.ScriptBlock.run(ScriptBlock.java:96) at org.apache.commons.jelly.TagSupport.invokeBody(TagSupport.java:187) at com.niku.union.gel.tags.ScriptTag.doTag(ScriptTag.java:20) at org.apache.commons.jelly.impl.TagScript.run(TagScript.java:248) at com.niku.union.gel.GELScript.run(GELScript.java:58) at com.niku.union.gel.GELController.invoke(GELController.java:79) at com.niku.bpm.services.ExecuteCustomAction.run(ExecuteCustomAction.java:217) at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) at 

 

Environment

Release : 16.x

Cause

DE65329

Resolution

  • DE65329 is fixed in 16.1.2 by introducing TTL  Setting in CSA 
  • Do not hard code port in the script rather read if from properties.xml