Uploaded image for project: 'Service Packs and Hot Fixes'
  1. Service Packs and Hot Fixes
  2. MNT-20586

Mail task is not using the default value of email.from.default if from field is left empty

    Details

    • Bug Priority:
      Category 2
    • ACT Numbers:

      00988929

      Description

      Summary
      If the "From" field is left blank for a mail task configuration in a process, during execution of this mail task it is always sent from "activiti@localhost" instead of using the default value from the property email.from.default configured in activiti-app.properties.

      The mail task documentation states otherwise:
      https://docs.alfresco.com/process-services1.9/topics/mail_task.html

      "The sender’s email address. If you do not specify this, the default configured system-wide setting from address is used."

      Steps to reproduce
      1. Configure APS to use a mail server. For dev purpose you could use a fake SMTP server (http://www.aboutmyip.com/AboutMyXApp/DevNullSmtp.jsp) with similar settings:

      email.enabled=true
      email.host=localhost
      email.port=1025
      email.from.default=admin@app.activiti.com
      email.from.default.name=APS Admin
      

      2. Via App Designer model a process using a mail task and configure To, Subject and Text but keep the From field configuration blank.
      3. Create an app with this process and publish it
      4. Run the process from the published app and inspect the sent email

      Expected behaviour
      The email sent through the mail task should be sent from the value as configured via the email.from.default property

      Current behaviour
      The email sent through the mail task is sent from activiti@localhost, which seems to be the engine default from value for mail tasks.

      Supporting evidence

      • Reproduced with current latest APS release
      • Issue is in com.activiti.conf.ActivitiEngineConfiguration.java, where we set all other configured email values, e.g. the host:
      String emailHost = environment.getProperty("email.host");
              if (StringUtils.isNotEmpty(emailHost)) {
      processEngineConfiguration.setMailServerHost(emailHost);
      ...
      

      We should indeed do the same and set the default for mailServerDefaultFrom, i.e.

      String emailFromDefault = environment.getProperty("email.from.default");
      if (StringUtils.isNotEmpty(emailFromDefault)) {
      processEngineConfiguration.setMailServerDefaultFrom(emailFromDefault);
      

        Attachments

          Structure

            Activity

              People

              • Assignee:
                cdenton Claire Denton
                Reporter:
                dkoch Dennis Koch
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:

                  Structure Helper Panel