mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-07 17:49:17 +00:00
Outbound email - protected against testMessageTo being null
git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@47456 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -25,3 +25,7 @@ email.server.err.failed_to_read_content_stream=Failed to read the message part c
|
||||
email.server.err.incorrect_message_part=Incorrect message part: {0}
|
||||
|
||||
email.outbound.err.send.failed=Failed to send email to: {0} cause {1}
|
||||
|
||||
email.outbound.err.test.no.to=Unable to send test message 'testMessageTo' is empty
|
||||
email.outbound.err.test.no.subject=Unable to send test message 'subject' is empty
|
||||
email.outbound.err.test.no.text=Unable to send test message 'text' is empty
|
||||
|
@@ -271,6 +271,18 @@ public class MailActionExecuter extends ActionExecuterAbstractBase
|
||||
*/
|
||||
public boolean sendTestMessage()
|
||||
{
|
||||
if(testMessageTo == null || testMessageTo.length() == 0)
|
||||
{
|
||||
throw new AlfrescoRuntimeException("email.outbound.err.test.no.to");
|
||||
}
|
||||
if(testMessageSubject == null || testMessageSubject.length() == 0)
|
||||
{
|
||||
throw new AlfrescoRuntimeException("email.outbound.err.test.no.subject");
|
||||
}
|
||||
if(testMessageText == null || testMessageText.length() == 0)
|
||||
{
|
||||
throw new AlfrescoRuntimeException("email.outbound.err.test.no.text");
|
||||
}
|
||||
Map<String, Serializable> params = new HashMap<String, Serializable>();
|
||||
params.put(PARAM_TO, testMessageTo);
|
||||
params.put(PARAM_SUBJECT, testMessageSubject);
|
||||
@@ -314,7 +326,7 @@ public class MailActionExecuter extends ActionExecuterAbstractBase
|
||||
numberFailedSends.set(0);
|
||||
|
||||
super.init();
|
||||
if (sendTestMessage)
|
||||
if (sendTestMessage && testMessageTo != null)
|
||||
{
|
||||
Map<String, Serializable> params = new HashMap<String, Serializable>();
|
||||
params.put(PARAM_TO, testMessageTo);
|
||||
|
Reference in New Issue
Block a user