MailTask keeps failing

I’ve set up the config file this way:

<?xml version="1.0" encoding="UTF-8"?>

<beans xmlns="http://www.springframework.org/schema/beans"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:schemaLocation="http://www.springframework.org/schema/beans   http://www.springframework.org/schema/beans/spring-beans.xsd">

  <bean id="processEngineConfiguration" class="org.flowable.engine.impl.cfg.StandaloneProcessEngineConfiguration">

    <property name="jdbcUrl" value="jdbc:h2:mem:flowable;DB_CLOSE_DELAY=1000;MVCC=TRUE" />
    <property name="jdbcDriver" value="org.h2.Driver" />
    <property name="jdbcUsername" value="sa" />
    <property name="jdbcPassword" value="" />

    <!-- Database configurations -->
    <property name="databaseSchemaUpdate" value="drop-create" />

	<!-- Test logger -->
	<!-- <property name="configurators">
		<list>
			<bean class="org.flowable.engine.test.impl.logger.ProcessExecutionLoggerConfigurator" />
		</list>
	</property> -->

    <!-- job executor configurations -->
    <property name="asyncExecutor" ref="asyncExecutor" />
    <property name="asyncExecutorActivate" value="false" />

    <property name="asyncFailedJobWaitTime" value="1" />

    <!-- mail server configurations -->
    <property name="mailServerPort" value="587" />

    <property name="mailServers">
      <map>
        <entry key="myEmailTenant">
          <bean class="org.flowable.engine.cfg.MailServerInfo">
            <property name="mailServerHost" value="smtp.google.com" />
            <property name="mailServerPort" value="587" />
            <property name="mailServerUseSSL" value="false" />
            <property name="mailServerUseTLS" value="false" />     
            <property name="mailServerDefaultFrom" value="mymail@gmail.com" />
            <property name="mailServerUsername" value="mymail@gmail.com"/>
            <property name="mailServerPassword" value="mypassword" />
          </bean>
        </entry>
      </map>
    </property>

    <property name="history" value="full" />
    <property name="asyncHistoryEnabled" value="false" />
    <property name="enableEntityLinks" value="true" />
    <property name="enableProcessDefinitionHistoryLevel" value="true" />
    
    <property name="enableProcessDefinitionInfoCache" value="true" />

    <property name="clock">
        <bean class="org.flowable.common.engine.impl.util.TestClockImpl" />
    </property>

    <property name="enableHistoricTaskLogging" value="true"/>

  </bean>
  
  <bean id="asyncExecutor" class="org.flowable.job.service.impl.asyncexecutor.DefaultAsyncJobExecutor">
    <property name="defaultAsyncJobAcquireWaitTimeInMillis" value="1000" />
    <property name="defaultTimerJobAcquireWaitTimeInMillis" value="1000" />
  </bean>
    
  <bean id="throwCustomExceptionBean" class="org.flowable.engine.test.bpmn.event.error.mapError.ThrowCustomExceptionBean" />
  <bean id="throwCustomExceptionDelegate" class="org.flowable.engine.test.bpmn.event.error.mapError.ThrowCustomExceptionDelegate" />

</beans>

but whenever I run my instance, the following exception is thrown:

EmailException: Sending the email to the following server failed : localhost:1025

I don’t get why it’s sending the email to localhost, aren’t the settings correct? What am I missing?

Are you using Spring Boot?

Searching the doc and looking in the source those values are used as defaults for Spring Boot apps:

Property name Default value Description
flowable.mail.server.host localhost The host of the mail server.
flowable.mail.server.password - The password for the mail server authentication.
flowable.mail.server.port 1025 The port of the mail server.
2 Likes