diff --git a/server/libs/modules/components/email/build.gradle.kts b/server/libs/modules/components/email/build.gradle.kts index 11d95f8168..74353fac69 100644 --- a/server/libs/modules/components/email/build.gradle.kts +++ b/server/libs/modules/components/email/build.gradle.kts @@ -1,5 +1,6 @@ dependencies { implementation("org.eclipse.angus:angus-mail") + api(project(":server:libs:core:commons:commons-util")) testImplementation("com.icegreen:greenmail:2.1.0") testImplementation("com.icegreen:greenmail-junit5:2.1.0") @@ -7,5 +8,6 @@ dependencies { testImplementation("org.junit.jupiter:junit-jupiter-api") testImplementation("org.junit.jupiter:junit-jupiter-engine") testImplementation("org.springframework.boot:spring-boot-starter-test") + testImplementation(project(":server:libs:config:jackson-config")) } diff --git a/server/libs/modules/components/email/src/main/java/com/bytechef/component/email/action/ReadEmailAction.java b/server/libs/modules/components/email/src/main/java/com/bytechef/component/email/action/ReadEmailAction.java index 7240eeb097..2295374734 100644 --- a/server/libs/modules/components/email/src/main/java/com/bytechef/component/email/action/ReadEmailAction.java +++ b/server/libs/modules/components/email/src/main/java/com/bytechef/component/email/action/ReadEmailAction.java @@ -19,17 +19,20 @@ import static com.bytechef.component.definition.Authorization.PASSWORD; import static com.bytechef.component.definition.Authorization.USERNAME; import static com.bytechef.component.definition.ComponentDsl.action; +import static com.bytechef.component.definition.ComponentDsl.integer; +import static com.bytechef.component.definition.ComponentDsl.option; import static com.bytechef.component.definition.ComponentDsl.string; import static com.bytechef.component.email.constant.EmailConstants.HOST; import static com.bytechef.component.email.constant.EmailConstants.PORT; import static com.bytechef.component.email.constant.EmailConstants.PROTOCOL; -import static com.bytechef.component.email.constant.EmailConstants.SSL; -import static com.bytechef.component.email.constant.EmailConstants.TLS; +import com.bytechef.commons.util.JsonUtils; import com.bytechef.component.definition.ActionContext; import com.bytechef.component.definition.ComponentDsl.ModifiableActionDefinition; import com.bytechef.component.definition.Parameters; +import com.bytechef.component.definition.Property; import com.bytechef.component.email.EmailProtocol; +import com.bytechef.component.email.commons.EmailUtils; import jakarta.mail.Authenticator; import jakarta.mail.Folder; import jakarta.mail.Message; @@ -39,11 +42,8 @@ import jakarta.mail.Session; import jakarta.mail.Store; import java.io.IOException; -import java.util.Arrays; import java.util.HashMap; import java.util.Map; -import java.util.Objects; -import java.util.Properties; /** * @author Igor Beslic @@ -63,6 +63,21 @@ public class ReadEmailAction { .title("Get Mail") .description("Get emails from inbox.") .properties( + integer(PORT) + .label("Port") + .description("Defines the port to connect to the email server.") + .required(true) + .defaultValue(25), + string(PROTOCOL) + .controlType(Property.ControlType.SELECT) + .defaultValue(EmailProtocol.imap.name()) + .label("Protocol") + .description( + "Protocol defines communication procedure. IMAP allows receiving emails. POP3 is older protocol for receiving emails.") + .options( + option(EmailProtocol.imap.name(), EmailProtocol.imap.name(), "IMAP is used to receive email"), + option(EmailProtocol.pop3.name(), EmailProtocol.pop3.name(), "POP3 is used to receive email")) + .required(true), string(FROM) .label("From Email") .description("From who the email was sent.") @@ -79,20 +94,23 @@ protected static Object perform( throws MessagingException, IOException { Session session; - EmailProtocol emailProtocol = EmailProtocol.valueOf(connectionParameters.getRequiredString(PROTOCOL)); + EmailProtocol emailProtocol = EmailProtocol.valueOf(inputParameters.getRequiredString(PROTOCOL)); + int port = inputParameters.getRequiredInteger(PORT); if (connectionParameters.containsKey(USERNAME)) { - session = Session.getInstance(getProperties(emailProtocol, connectionParameters), new Authenticator() { - @Override - protected PasswordAuthentication getPasswordAuthentication() { - return new PasswordAuthentication( - connectionParameters.getRequiredString(USERNAME), - connectionParameters.getRequiredString(PASSWORD)); - } - }); - + session = + Session.getInstance(EmailUtils.getMailSessionProperties(port, emailProtocol, connectionParameters), + new Authenticator() { + @Override + protected PasswordAuthentication getPasswordAuthentication() { + return new PasswordAuthentication( + connectionParameters.getRequiredString(USERNAME), + connectionParameters.getRequiredString(PASSWORD)); + } + }); } else { - session = Session.getInstance(getProperties(emailProtocol, connectionParameters)); + session = Session.getInstance( + EmailUtils.getMailSessionProperties(port, emailProtocol, connectionParameters)); } Store protocolStore = session.getStore(emailProtocol.name()); @@ -112,10 +130,10 @@ protected PasswordAuthentication getPasswordAuthentication() { filtered[i] = new HashMap<>(); - filtered[i].put(FROM, Arrays.toString(message.getFrom())); - filtered[i].put(TO, Arrays.toString(message.getRecipients(RecipientType.TO))); - filtered[i].put(CC, Arrays.toString(message.getRecipients(RecipientType.CC))); - filtered[i].put(BCC, Arrays.toString(message.getRecipients(RecipientType.BCC))); + filtered[i].put(FROM, JsonUtils.write(message.getFrom())); + filtered[i].put(TO, JsonUtils.write(message.getRecipients(RecipientType.TO))); + filtered[i].put(CC, JsonUtils.write(message.getRecipients(RecipientType.CC))); + filtered[i].put(BCC, JsonUtils.write(message.getRecipients(RecipientType.BCC))); filtered[i].put(SUBJECT, message.getSubject()); filtered[i].put(CONTENT, message.getContent() .toString()); @@ -128,29 +146,4 @@ protected PasswordAuthentication getPasswordAuthentication() { return filtered; } - - private static Properties getProperties(EmailProtocol protocol, Parameters connectionParameters) { - Properties props = new Properties(); - - props.setProperty("mail.store.protocol", protocol.name()); - props.setProperty("mail.debug", "true"); - - if (Objects.equals(connectionParameters.getBoolean(TLS), false)) { - props.put(String.format("mail.%s.starttls.enable", protocol), "true"); - } - - if (Objects.equals(connectionParameters.getBoolean(SSL), false)) { - props.put(String.format("mail.%s.ssl.enable", protocol), "true"); - } - - if (connectionParameters.containsKey(USERNAME)) { - props.put(String.format("mail.%s.user", protocol), connectionParameters.getRequiredString(USERNAME)); - props.put(String.format("mail.%s.auth", protocol), true); - } - - props.put(String.format("mail.%s.host", protocol), connectionParameters.getRequiredString(HOST)); - props.put(String.format("mail.%s.port", protocol), connectionParameters.getRequiredInteger(PORT)); - - return props; - } } diff --git a/server/libs/modules/components/email/src/main/java/com/bytechef/component/email/action/SendEmailAction.java b/server/libs/modules/components/email/src/main/java/com/bytechef/component/email/action/SendEmailAction.java index 9bf8643d7a..226b1adbf2 100644 --- a/server/libs/modules/components/email/src/main/java/com/bytechef/component/email/action/SendEmailAction.java +++ b/server/libs/modules/components/email/src/main/java/com/bytechef/component/email/action/SendEmailAction.java @@ -21,16 +21,17 @@ import static com.bytechef.component.definition.ComponentDsl.action; import static com.bytechef.component.definition.ComponentDsl.array; import static com.bytechef.component.definition.ComponentDsl.fileEntry; +import static com.bytechef.component.definition.ComponentDsl.integer; import static com.bytechef.component.definition.ComponentDsl.string; -import static com.bytechef.component.email.constant.EmailConstants.HOST; import static com.bytechef.component.email.constant.EmailConstants.PORT; -import static com.bytechef.component.email.constant.EmailConstants.TLS; import com.bytechef.component.definition.ActionContext; import com.bytechef.component.definition.ComponentDsl.ModifiableActionDefinition; import com.bytechef.component.definition.FileEntry; import com.bytechef.component.definition.Parameters; import com.bytechef.component.definition.Property; +import com.bytechef.component.email.EmailProtocol; +import com.bytechef.component.email.commons.EmailUtils; import jakarta.activation.DataHandler; import jakarta.mail.Authenticator; import jakarta.mail.Message; @@ -48,11 +49,10 @@ import java.io.IOException; import java.io.InputStream; import java.util.List; -import java.util.Objects; -import java.util.Properties; /** * @author Ivica Cardic + * @author Igor Beslic */ public class SendEmailAction { @@ -69,6 +69,11 @@ public class SendEmailAction { .title("Send") .description("Send an email to any address.") .properties( + integer(PORT) + .label("Port") + .description("Defines the port to connect to the email server.") + .required(true) + .defaultValue(25), string(FROM) .label("From Email") .description("From who to send the email.") @@ -108,31 +113,23 @@ protected static Object perform( Parameters inputParameters, Parameters connectionParameters, ActionContext context) throws MessagingException, IOException { - Properties properties = new Properties(); - - properties.put("mail.smtp.host", connectionParameters.getRequiredString(HOST)); - properties.put("mail.smtp.port", connectionParameters.getRequiredInteger(PORT)); - - if (Objects.equals(connectionParameters.getBoolean(TLS), true)) { - properties.put("mail.smtp.starttls.enable", "true"); -// prop.put("mail.smtp.ssl.trust", MapUtils.getRequiredString(context.getConnectionParameters(), HOST)); - } - + int port = inputParameters.getRequiredInteger(PORT); Session session; if (connectionParameters.containsKey(USERNAME)) { - properties.put("mail.smtp.auth", true); - - session = Session.getInstance(properties, new Authenticator() { - @Override - protected PasswordAuthentication getPasswordAuthentication() { - return new PasswordAuthentication( - connectionParameters.getRequiredString(USERNAME), - connectionParameters.getRequiredString(PASSWORD)); - } - }); + session = + Session.getInstance(EmailUtils.getMailSessionProperties(port, EmailProtocol.smtp, connectionParameters), + new Authenticator() { + @Override + protected PasswordAuthentication getPasswordAuthentication() { + return new PasswordAuthentication( + connectionParameters.getRequiredString(USERNAME), + connectionParameters.getRequiredString(PASSWORD)); + } + }); } else { - session = Session.getInstance(properties); + session = Session + .getInstance(EmailUtils.getMailSessionProperties(port, EmailProtocol.smtp, connectionParameters)); } Message message = new MimeMessage(session); diff --git a/server/libs/modules/components/email/src/main/java/com/bytechef/component/email/commons/EmailUtils.java b/server/libs/modules/components/email/src/main/java/com/bytechef/component/email/commons/EmailUtils.java new file mode 100644 index 0000000000..49bf6ab135 --- /dev/null +++ b/server/libs/modules/components/email/src/main/java/com/bytechef/component/email/commons/EmailUtils.java @@ -0,0 +1,60 @@ +/* + * Copyright 2025 ByteChef + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.bytechef.component.email.commons; + +import static com.bytechef.component.definition.Authorization.USERNAME; +import static com.bytechef.component.email.constant.EmailConstants.CRYPTOGRAPHIC_PROTOCOL; +import static com.bytechef.component.email.constant.EmailConstants.HOST; +import static com.bytechef.component.email.constant.EmailConstants.TLS; + +import com.bytechef.component.definition.Parameters; +import com.bytechef.component.email.EmailProtocol; +import java.util.Properties; + +/** + * @author Igor Beslic + */ +public class EmailUtils { + + public static Properties + getMailSessionProperties(int port, EmailProtocol protocol, Parameters connectionParameters) { + Properties props = new Properties(); + + props.setProperty("mail.store.protocol", protocol.name()); + props.setProperty("mail.debug", "true"); + + if (connectionParameters.containsKey(CRYPTOGRAPHIC_PROTOCOL)) { + if (TLS.contentEquals(connectionParameters.getRequiredString(CRYPTOGRAPHIC_PROTOCOL))) { + props.put(String.format("mail.%s.starttls.enable", protocol), "true"); + } else { + props.put(String.format("mail.%s.ssl.enable", protocol), "true"); + props.put(String.format("mail.%s.ssl.trust", protocol), connectionParameters.getRequiredString(HOST)); + } + } + + if (connectionParameters.containsKey(USERNAME)) { + props.put(String.format("mail.%s.user", protocol), connectionParameters.getRequiredString(USERNAME)); + props.put(String.format("mail.%s.auth", protocol), true); + } + + props.put(String.format("mail.%s.host", protocol), connectionParameters.getRequiredString(HOST)); + props.put(String.format("mail.%s.port", protocol), port); + + return props; + } + +} diff --git a/server/libs/modules/components/email/src/main/java/com/bytechef/component/email/connection/EmailConnection.java b/server/libs/modules/components/email/src/main/java/com/bytechef/component/email/connection/EmailConnection.java index d5a9249ed2..d97c7c6edf 100644 --- a/server/libs/modules/components/email/src/main/java/com/bytechef/component/email/connection/EmailConnection.java +++ b/server/libs/modules/components/email/src/main/java/com/bytechef/component/email/connection/EmailConnection.java @@ -21,17 +21,14 @@ import static com.bytechef.component.definition.ComponentDsl.authorization; import static com.bytechef.component.definition.ComponentDsl.bool; import static com.bytechef.component.definition.ComponentDsl.connection; -import static com.bytechef.component.definition.ComponentDsl.integer; import static com.bytechef.component.definition.ComponentDsl.option; import static com.bytechef.component.definition.ComponentDsl.string; +import static com.bytechef.component.email.constant.EmailConstants.CRYPTOGRAPHIC_PROTOCOL; import static com.bytechef.component.email.constant.EmailConstants.HOST; -import static com.bytechef.component.email.constant.EmailConstants.PORT; -import static com.bytechef.component.email.constant.EmailConstants.PROTOCOL; import com.bytechef.component.definition.Authorization.AuthorizationType; import com.bytechef.component.definition.ComponentDsl.ModifiableConnectionDefinition; import com.bytechef.component.definition.Property; -import com.bytechef.component.email.EmailProtocol; import com.bytechef.component.email.constant.EmailConstants; /** @@ -45,25 +42,20 @@ public class EmailConnection { string(HOST) .label("Host") .required(true), - integer(PORT) - .label("Port") - .description("") - .required(true) - .defaultValue(25), - string(PROTOCOL) + bool(EmailConstants.TLS) + .label("Use TLS") + .description("If selected the connection will use TLS when connecting to server."), + string(CRYPTOGRAPHIC_PROTOCOL) .controlType(Property.ControlType.SELECT) - .defaultValue(EmailProtocol.smtp.name()) - .label("Protocol") + .label("Connection Security") .description( - "Protocol defines communication procedure. SMTP allows sending emails, IMAP allows receiving emails. POP3 is older protocol for receiving emails.") + "Connection security activates cryptographic protocol to secure communication over a network.") .options( - option(EmailProtocol.smtp.name(), EmailProtocol.smtp.name(), "sending email"), - option(EmailProtocol.imap.name(), EmailProtocol.imap.name(), "receive email"), - option(EmailProtocol.pop3.name(), EmailProtocol.pop3.name(), "receive email")) - .required(true), - bool(EmailConstants.TLS) - .label("Use TLS") - .description("If selected the connection will use TLS when connecting to server.")) + option(EmailConstants.TLS, EmailConstants.TLS, + "Transport Layer Security is the modern, more secure replacement for SSL"), + option(EmailConstants.SSL, EmailConstants.SSL, + "Secure Sockets Layer is an older protocol that has been deprecated due to security vulnerabilities.")) + .required(false)) .authorizationRequired(false) .authorizations( authorization(AuthorizationType.BASIC_AUTH) diff --git a/server/libs/modules/components/email/src/main/java/com/bytechef/component/email/constant/EmailConstants.java b/server/libs/modules/components/email/src/main/java/com/bytechef/component/email/constant/EmailConstants.java index d6e0d1dbfd..edb322ca45 100644 --- a/server/libs/modules/components/email/src/main/java/com/bytechef/component/email/constant/EmailConstants.java +++ b/server/libs/modules/components/email/src/main/java/com/bytechef/component/email/constant/EmailConstants.java @@ -26,6 +26,7 @@ public class EmailConstants { public static final String HOST = "host"; public static final String PORT = "port"; public static final String PROTOCOL = "protocol"; + public static final String CRYPTOGRAPHIC_PROTOCOL = "cryptoProtocol"; public static final String TLS = "tls"; public static final String SSL = "ssl"; } diff --git a/server/libs/modules/components/email/src/test/java/com/bytechef/component/email/action/EmailActionIntTest.java b/server/libs/modules/components/email/src/test/java/com/bytechef/component/email/action/EmailActionIntTest.java index 2f375b3e5b..2d5a767386 100644 --- a/server/libs/modules/components/email/src/test/java/com/bytechef/component/email/action/EmailActionIntTest.java +++ b/server/libs/modules/components/email/src/test/java/com/bytechef/component/email/action/EmailActionIntTest.java @@ -18,72 +18,99 @@ import static org.mockito.Mockito.mock; +import com.bytechef.commons.util.JsonUtils; import com.bytechef.component.definition.ActionContext; import com.bytechef.component.definition.Authorization; import com.bytechef.component.definition.Parameters; import com.bytechef.component.email.EmailProtocol; import com.bytechef.component.email.constant.EmailConstants; import com.bytechef.component.test.definition.MockParametersFactory; -import com.bytechef.component.test.definition.MockParametersImpl; +import com.bytechef.jackson.config.JacksonConfiguration; import com.icegreen.greenmail.configuration.GreenMailConfiguration; import com.icegreen.greenmail.junit5.GreenMailExtension; import com.icegreen.greenmail.server.AbstractServer; import com.icegreen.greenmail.util.ServerSetupTest; import java.util.Arrays; -import java.util.Collections; import java.util.HashMap; +import java.util.Map; +import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.RegisterExtension; +import org.springframework.boot.jackson.JsonComponentModule; /** * @author Igor Beslic */ public class EmailActionIntTest { + static { + JsonUtils.setObjectMapper(new JacksonConfiguration(new JsonComponentModule()).objectMapper()); + } + @RegisterExtension static GreenMailExtension greenMail = new GreenMailExtension(ServerSetupTest.SMTP_IMAP) .withConfiguration(GreenMailConfiguration .aConfig() - .withUser("bytecheftest@localhost", "bytecheftest", "bytecheftest")); + .withUser("bytecheftest@bytechef.io", "bytecheftest", "bytecheftest")); @Test public void testEmailActions() throws Exception { ActionContext actionContext = mock(ActionContext.class); - SendEmailAction.perform(getSendEmailActionParameters(), getConnectionParameters(EmailProtocol.smtp), - actionContext); + AbstractServer server = greenMail.getSmtp(); + + SendEmailAction.perform( + getSendEmailActionParameters(server.getPort()), getConnectionParameters(), actionContext); greenMail.waitForIncomingEmail(1); - Object result = ReadEmailAction.perform(new MockParametersImpl(Collections.emptyMap()), - getConnectionParameters(EmailProtocol.imap), actionContext); + server = greenMail.getImap(); + + Object result = ReadEmailAction.perform( + getReceieveEmailActionParameters(server.getPort()), getConnectionParameters(), actionContext); + + Class clazz = result.getClass(); + + Assertions.assertTrue(clazz.isArray()); + + Map[] resultMap = (Map[]) result; + + Assertions.assertEquals(1, resultMap.length); + + Object fromObject = resultMap[0].get("from"); + + String from = (String) fromObject; + + Assertions.assertTrue(from.contains("\"test.from@test.com\"")); System.out.println(result); } - private Parameters getConnectionParameters(EmailProtocol protocol) { + private Parameters getConnectionParameters() { HashMap parameterMap = new HashMap<>(); - AbstractServer server = greenMail.getSmtp(); - - if (protocol == EmailProtocol.imap) { - server = greenMail.getImap(); - } - - parameterMap.put(EmailConstants.PORT, String.valueOf(server.getPort())); parameterMap.put(EmailConstants.HOST, "localhost"); parameterMap.put(Authorization.USERNAME, "bytecheftest"); parameterMap.put(Authorization.PASSWORD, "bytecheftest"); - parameterMap.put(EmailConstants.PROTOCOL, protocol.name()); return MockParametersFactory.create(parameterMap); } - private Parameters getSendEmailActionParameters() { + private Parameters getReceieveEmailActionParameters(int port) { HashMap parameterMap = new HashMap<>(); + parameterMap.put(EmailConstants.PORT, String.valueOf(port)); + parameterMap.put(EmailConstants.PROTOCOL, EmailProtocol.imap.name()); + + return MockParametersFactory.create(parameterMap); + } + + private Parameters getSendEmailActionParameters(int port) { + HashMap parameterMap = new HashMap<>(); + + parameterMap.put(EmailConstants.PORT, String.valueOf(port)); parameterMap.put("from", "test.from@test.com"); - parameterMap.put("to", Arrays.asList("test.to@test.com")); + parameterMap.put("to", Arrays.asList("bytecheftest@bytechef.io")); parameterMap.put("cc", Arrays.asList("test.cc@test.com")); parameterMap.put("bcc", Arrays.asList("test.bcc@test.com")); parameterMap.put("replyTo", Arrays.asList("test.replyto@test.com")); @@ -92,4 +119,5 @@ private Parameters getSendEmailActionParameters() { return MockParametersFactory.create(parameterMap); } + } diff --git a/server/libs/modules/components/email/src/test/resources/definition/email_v1.json b/server/libs/modules/components/email/src/test/resources/definition/email_v1.json index c2d689b703..1c9b7367e4 100644 --- a/server/libs/modules/components/email/src/test/resources/definition/email_v1.json +++ b/server/libs/modules/components/email/src/test/resources/definition/email_v1.json @@ -66,9 +66,6 @@ "title" : "Basic Auth", "type" : "BASIC_AUTH", "acquire" : null, - "authorizationUrl" : null, - "clientSecret" : null, - "refreshToken" : null, "apply" : null, "clientId" : null, "pkce" : null, @@ -76,8 +73,11 @@ "refreshUrl" : null, "scopes" : null, "tokenUrl" : null, - "oauth2AuthorizationExtraQueryParameters" : null, - "authorizationCallback" : null + "authorizationUrl" : null, + "clientSecret" : null, + "refreshToken" : null, + "authorizationCallback" : null, + "oauth2AuthorizationExtraQueryParameters" : null } ], "properties" : [ { "advancedOption" : null, @@ -101,79 +101,56 @@ "optionsDataSource" : null }, { "advancedOption" : null, - "description" : "", + "description" : "If selected the connection will use TLS when connecting to server.", "displayCondition" : null, "expressionEnabled" : null, "hidden" : null, "metadata" : { }, - "required" : true, - "name" : "port", - "type" : "INTEGER", - "defaultValue" : 25, + "required" : null, + "name" : "tls", + "type" : "BOOLEAN", + "defaultValue" : null, "exampleValue" : null, - "label" : "Port", + "label" : "Use TLS", "placeholder" : null, - "maxValue" : null, - "minValue" : null, - "options" : null, - "optionsDataSource" : null, - "controlType" : "INTEGER" + "options" : [ { + "description" : null, + "label" : "True", + "value" : true + }, { + "description" : null, + "label" : "False", + "value" : false + } ], + "controlType" : "SELECT" }, { "advancedOption" : null, - "description" : "Protocol defines communication procedure. SMTP allows sending emails, IMAP allows receiving emails. POP3 is older protocol for receiving emails.", + "description" : "Connection security activates cryptographic protocol to secure communication over a network.", "displayCondition" : null, "expressionEnabled" : null, "hidden" : null, "metadata" : { }, - "required" : true, - "name" : "protocol", + "required" : false, + "name" : "cryptoProtocol", "type" : "STRING", - "defaultValue" : "smtp", + "defaultValue" : null, "exampleValue" : null, - "label" : "Protocol", + "label" : "Connection Security", "placeholder" : null, "controlType" : "SELECT", "languageId" : null, "maxLength" : null, "minLength" : null, "options" : [ { - "description" : "sending email", - "label" : "smtp", - "value" : "smtp" - }, { - "description" : "receive email", - "label" : "imap", - "value" : "imap" + "description" : "Transport Layer Security is the modern, more secure replacement for SSL", + "label" : "tls", + "value" : "tls" }, { - "description" : "receive email", - "label" : "pop3", - "value" : "pop3" + "description" : "Secure Sockets Layer is an older protocol that has been deprecated due to security vulnerabilities.", + "label" : "ssl", + "value" : "ssl" } ], "optionsDataSource" : null - }, { - "advancedOption" : null, - "description" : "If selected the connection will use TLS when connecting to server.", - "displayCondition" : null, - "expressionEnabled" : null, - "hidden" : null, - "metadata" : { }, - "required" : null, - "name" : "tls", - "type" : "BOOLEAN", - "defaultValue" : null, - "exampleValue" : null, - "label" : "Use TLS", - "placeholder" : null, - "options" : [ { - "description" : null, - "label" : "True", - "value" : true - }, { - "description" : null, - "label" : "False", - "value" : false - } ], - "controlType" : "SELECT" } ], "version" : 1, "authorizationRequired" : false, @@ -189,6 +166,25 @@ "name" : "send", "outputDefinition" : null, "properties" : [ { + "advancedOption" : null, + "description" : "Defines the port to connect to the email server.", + "displayCondition" : null, + "expressionEnabled" : null, + "hidden" : null, + "metadata" : { }, + "required" : true, + "name" : "port", + "type" : "INTEGER", + "defaultValue" : 25, + "exampleValue" : null, + "label" : "Port", + "placeholder" : null, + "maxValue" : null, + "minValue" : null, + "options" : null, + "controlType" : "INTEGER", + "optionsDataSource" : null + }, { "advancedOption" : null, "description" : "From who to send the email.", "displayCondition" : null, @@ -247,8 +243,8 @@ "minItems" : null, "multipleValues" : null, "options" : null, - "optionsDataSource" : null, - "controlType" : "ARRAY_BUILDER" + "controlType" : "ARRAY_BUILDER", + "optionsDataSource" : null }, { "advancedOption" : null, "description" : "Who to CC on the email.", @@ -288,8 +284,8 @@ "minItems" : null, "multipleValues" : null, "options" : null, - "optionsDataSource" : null, - "controlType" : "ARRAY_BUILDER" + "controlType" : "ARRAY_BUILDER", + "optionsDataSource" : null }, { "advancedOption" : null, "description" : "Who to BCC on the email.", @@ -329,8 +325,8 @@ "minItems" : null, "multipleValues" : null, "options" : null, - "optionsDataSource" : null, - "controlType" : "ARRAY_BUILDER" + "controlType" : "ARRAY_BUILDER", + "optionsDataSource" : null }, { "advancedOption" : null, "description" : "When someone replies to this email, where should it go to?", @@ -370,8 +366,8 @@ "minItems" : null, "multipleValues" : null, "options" : null, - "optionsDataSource" : null, - "controlType" : "ARRAY_BUILDER" + "controlType" : "ARRAY_BUILDER", + "optionsDataSource" : null }, { "advancedOption" : null, "description" : "Your email subject.", @@ -527,8 +523,8 @@ "minItems" : null, "multipleValues" : null, "options" : null, - "optionsDataSource" : null, - "controlType" : "ARRAY_BUILDER" + "controlType" : "ARRAY_BUILDER", + "optionsDataSource" : null } ], "title" : "Send", "perform" : { }, @@ -543,6 +539,53 @@ "name" : "get", "outputDefinition" : null, "properties" : [ { + "advancedOption" : null, + "description" : "Defines the port to connect to the email server.", + "displayCondition" : null, + "expressionEnabled" : null, + "hidden" : null, + "metadata" : { }, + "required" : true, + "name" : "port", + "type" : "INTEGER", + "defaultValue" : 25, + "exampleValue" : null, + "label" : "Port", + "placeholder" : null, + "maxValue" : null, + "minValue" : null, + "options" : null, + "controlType" : "INTEGER", + "optionsDataSource" : null + }, { + "advancedOption" : null, + "description" : "Protocol defines communication procedure. IMAP allows receiving emails. POP3 is older protocol for receiving emails.", + "displayCondition" : null, + "expressionEnabled" : null, + "hidden" : null, + "metadata" : { }, + "required" : true, + "name" : "protocol", + "type" : "STRING", + "defaultValue" : "imap", + "exampleValue" : null, + "label" : "Protocol", + "placeholder" : null, + "controlType" : "SELECT", + "languageId" : null, + "maxLength" : null, + "minLength" : null, + "options" : [ { + "description" : "IMAP is used to receive email", + "label" : "imap", + "value" : "imap" + }, { + "description" : "POP3 is used to receive email", + "label" : "pop3", + "value" : "pop3" + } ], + "optionsDataSource" : null + }, { "advancedOption" : null, "description" : "From who the email was sent.", "displayCondition" : null, @@ -588,7 +631,7 @@ "processErrorResponse" : null, "workflowNodeDescription" : null } ], - "clusterElements" : null, "unifiedApi" : null, - "triggers" : null + "triggers" : null, + "clusterElements" : null } \ No newline at end of file