0

I'm trying to determine where the error may be with my current attempt at sending emails from an Alfresco Java workflow task (TaskCreateListener). It all seems to work fine, however when adding a CC recipient the email never arrives*. Also when the PARAM_TO recipient receives the email there is no CC recipient listed, so it's almost as if the CC recipient is never actually added. Mail server being used is from a locally installed instance of Alfresco and has been working well for sending the TO emails. This is the first time I've seen a problem.

*never arrives for the CC'd recipient (normal TO recipient receives the email), different email addresses used on different servers (my employer and hotmail and vice versa).

Action mailAction = actionService.createAction(MailActionExecuter.NAME);
        mailAction.setParameterValue(MailActionExecuter.PARAM_SUBJECT, "Proposal Submitted");        
        mailAction.setParameterValue(MailActionExecuter.PARAM_TO, recipient);
        mailAction.setParameterValue(MailActionExecuter.PARAM_FROM, senderAddr);
        mailAction.setParameterValue(MailActionExecuter.PARAM_TEXT, email);
        mailAction.setParameterValue(MailActionExecuter.PARAM_HTML, true);
        mailAction.setParameterValue(MailActionExecuter.PARAM_CC, "me@example.com");

        try {
            actionService.executeAction(mailAction, null, true, true);
        }catch(Exception e) {
            Logger logger = Logger.getLogger(this.getClass().getPackage().getName());
            logger.error("Unable to send email upon workflow task", e);
        }

Is there anything else that needs to be added to get the CC parameter to work?

Alfresco SDK version: 3.1.0 Running locally from Eclipse.

Edit

Alfresco logs settings:

log4j.logger.org.alfresco.repo.jscript.ScriptLogger=TRACE
org.alfresco.repo.action.executer.MailActionExecuter=TRACE
log4j.logger.org.alfresco.repo.action.ActionServiceImpl=TRACE
org.alfresco.repo.action.executer.ActionExecuterAbstractBase=TRACE

Output:

2021-07-07 16:06:07,779 DEBUG 

    [org.alfresco.repo.action.ActionServiceImpl] [http-bio-8080-exec-25] addPostTransactionPendingAction action chain = null
    2021-07-07 16:06:07,779 DEBUG [org.alfresco.repo.action.ActionServiceImpl] [http-bio-8080-exec-25] Current action = 9e499b23-23ad-47f7-94e3-7a21408f4dc2
    2021-07-07 16:06:07,779 DEBUG [org.alfresco.repo.action.ActionServiceImpl] [http-bio-8080-exec-25] Doing addPostTransactionPendingAction
    2021-07-07 16:06:07,779 DEBUG [org.alfresco.repo.action.ActionServiceImpl] [http-bio-8080-exec-25] The current user is: admin
    2021-07-07 16:06:07,779 DEBUG [org.alfresco.repo.action.ActionServiceImpl] [http-bio-8080-exec-25] The current tenant is: 
    2021-07-07 16:06:07,882 DEBUG [org.alfresco.repo.action.ActionServiceImpl] [mailAsyncAction3] Execute action impl action chain = null
    2021-07-07 16:06:07,883 DEBUG [org.alfresco.repo.action.ActionServiceImpl] [mailAsyncAction3] Current action = 9e499b23-23ad-47f7-94e3-7a21408f4dc2
    2021-07-07 16:06:07,884 DEBUG [org.alfresco.repo.action.ActionServiceImpl] [mailAsyncAction3] Doing executeActionImpl
    2021-07-07 16:06:07,886 DEBUG [org.alfresco.repo.action.ActionServiceImpl] [mailAsyncAction3] Adding mail, 9e499b23-23ad-47f7-94e3-7a21408f4dc2 to action chain.
    2021-07-07 16:06:07,887 DEBUG [org.alfresco.repo.action.ActionServiceImpl] [mailAsyncAction3]   All Condition Evaluation Result - true
    2021-07-07 16:06:07,888 DEBUG [org.alfresco.repo.action.ActionServiceImpl] [mailAsyncAction3] The action is being executed as the user: admin
    2021-07-07 16:06:12,597 DEBUG [org.alfresco.repo.action.ActionServiceImpl] [mailAsyncAction3] Resetting the action chain.
Zoe
  • 27,060
  • 21
  • 118
  • 148
StephenL
  • 122
  • 1
  • 11
  • Bump up the log level on the actions and action executor to see what Alfresco is really doing? – Gagravarr Jul 07 '21 at 12:29
  • Thanks, I've added the output but I'm not sure it tells me that much so far. I'll continue to investigate other logs that may be enabled. – StephenL Jul 07 '21 at 15:17
  • Is the CC recipient in the same domain as the TO recipient? For example, what happens if you swap the CC and TO recipients? The goal here is just to verify that your CC recipient can actually receive any email at all sent from the action. Also try not setting the FROM and see if it makes a difference. – Jeff Potts Jul 14 '21 at 17:55
  • After some time away from this task, it appears that the test mail server "may" be at fault. There's no response from it at all now and I work at a large institution where most people are working from home still so it'll be while. Although my smaller team will be organising an alternative eventually. – StephenL Aug 16 '21 at 10:04

0 Answers0