diff --git a/.liquibase/Data_alias/basic/2021.1.2/MailBounce/alter_communicationSettings.xml b/.liquibase/Data_alias/basic/2021.1.2/MailBounce/alter_communicationSettings.xml new file mode 100644 index 0000000000000000000000000000000000000000..bfe4500b7bbd870a9af51a8a183328383f37e881 --- /dev/null +++ b/.liquibase/Data_alias/basic/2021.1.2/MailBounce/alter_communicationSettings.xml @@ -0,0 +1,12 @@ +<?xml version="1.1" encoding="UTF-8" standalone="no"?> +<databaseChangeLog xmlns="http://www.liquibase.org/xml/ns/dbchangelog" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-3.6.xsd"> + <changeSet author="m.groppe" id="e070e7e5-e4e3-4b6c-857a-009e1ee6513c"> + <addColumn tableName="COMMUNICATIONSETTINGS"> + <column name="ISACTIVE" type="TINYINT" value="1"> + <constraints nullable="false"/> + </column> + </addColumn> + </changeSet> +</databaseChangeLog> \ No newline at end of file diff --git a/.liquibase/Data_alias/basic/2021.1.2/MailBounce/alter_emailFilterHandling.xml b/.liquibase/Data_alias/basic/2021.1.2/MailBounce/alter_emailFilterHandling.xml new file mode 100644 index 0000000000000000000000000000000000000000..fd09f368dbf81ff7329617904f45d9e1f58c6b22 --- /dev/null +++ b/.liquibase/Data_alias/basic/2021.1.2/MailBounce/alter_emailFilterHandling.xml @@ -0,0 +1,11 @@ +<?xml version="1.1" encoding="UTF-8" standalone="no"?> +<databaseChangeLog xmlns="http://www.liquibase.org/xml/ns/dbchangelog" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-3.6.xsd"> + <changeSet author="s.listl" id="5ba15adf-e9c9-46ee-989e-7ee02a3a61b7"> + <dropColumn tableName="EMAIL_FILTER_HANDLING"> + <column name="ACTION_TYPE"/> + <column name="ISFALLTHROUGH"/> + </dropColumn> + </changeSet> +</databaseChangeLog> \ No newline at end of file diff --git a/.liquibase/Data_alias/basic/2021.1.2/MailBounce/changelog.xml b/.liquibase/Data_alias/basic/2021.1.2/MailBounce/changelog.xml new file mode 100644 index 0000000000000000000000000000000000000000..74551cf776b246a2cc59e602134aae007122eea5 --- /dev/null +++ b/.liquibase/Data_alias/basic/2021.1.2/MailBounce/changelog.xml @@ -0,0 +1,10 @@ +<?xml version="1.1" encoding="UTF-8" standalone="no"?> +<databaseChangeLog xmlns="http://www.liquibase.org/xml/ns/dbchangelog" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-3.6.xsd"> + <include relativeToChangelogFile="true" file="create_Mail_bounce.xml"/> + <include relativeToChangelogFile="true" file="insert_emailFilterTypeKeyword.xml"/> + <include relativeToChangelogFile="true" file="alter_emailFilterHandling.xml"/> + <include relativeToChangelogFile="true" file="alter_communicationSettings.xml"/> + <include relativeToChangelogFile="true" file="insert_bounce_criteria.xml"/> +</databaseChangeLog> \ No newline at end of file diff --git a/.liquibase/Data_alias/basic/2021.1.2/MailBounce/create_Mail_Bounce.xml b/.liquibase/Data_alias/basic/2021.1.2/MailBounce/create_Mail_Bounce.xml new file mode 100644 index 0000000000000000000000000000000000000000..207ca7055d3d369d748f91a4b3de9d3e0e4433b6 --- /dev/null +++ b/.liquibase/Data_alias/basic/2021.1.2/MailBounce/create_Mail_Bounce.xml @@ -0,0 +1,27 @@ +<?xml version="1.1" encoding="UTF-8" standalone="no"?> +<databaseChangeLog xmlns="http://www.liquibase.org/xml/ns/dbchangelog" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-3.6.xsd"> + <changeSet author="m.groppe" id="cb2e933a-2d2d-49d3-892d-e3f64d5d789c"> + <createTable tableName="MAIL_BOUNCE"> + <column name="MAIL_BOUNCEID" type="CHAR(36)"> + <constraints nullable="false" primaryKey="true" primaryKeyName="PK_MAIL_BOUNCEID"/> + </column> + <column name="MAIL_LOG_ID" type="CHAR(36)"> + </column> + <column name="CONTACT_ID" type="CHAR(36)"> + </column> + <column name="CATEGORY" type="VARCHAR(36)"> + </column> + <column name="RECIPIENT_EMAIL" type="VARCHAR(255)"/> + <column name="DATE_BOUNCE" type="DATETIME" /> + <column name="EMAIL_FILTER_HANDLING_ID" type="char(36)"/> + </createTable> + <createIndex tableName="MAIL_BOUNCE" indexName="IDX_MAILBOUNCE_MAILLOGID"> + <column name="MAIL_LOG_ID"/> + </createIndex> + <createIndex tableName="MAIL_BOUNCE" indexName="IDX_MAILBOUNCE_CONTACTID"> + <column name="CONTACT_ID"/> + </createIndex> + </changeSet> +</databaseChangeLog> \ No newline at end of file diff --git a/.liquibase/Data_alias/basic/2021.1.2/MailBounce/insert_bounce_criteria.xml b/.liquibase/Data_alias/basic/2021.1.2/MailBounce/insert_bounce_criteria.xml new file mode 100644 index 0000000000000000000000000000000000000000..564aef9038c0413f6079ca78b3b4e4eb05d5594d --- /dev/null +++ b/.liquibase/Data_alias/basic/2021.1.2/MailBounce/insert_bounce_criteria.xml @@ -0,0 +1,412 @@ +<?xml version="1.1" encoding="UTF-8" standalone="no"?> +<databaseChangeLog xmlns="http://www.liquibase.org/xml/ns/dbchangelog" xmlns:ext="http://www.liquibase.org/xml/ns/dbchangelog-ext" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog-ext http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-ext.xsd http://www.liquibase.org/xml/ns/dbchangelog http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-4.1.xsd"> + <changeSet author="m.groppe" id="8aa8b153-9d96-461a-bcaf-86adcfc1a845"> + <insert tableName="email_filter_handling"> + <column name="EMAIL_FILTER_HANDLINGID" value="08798e5d-c694-4c22-bea3-993f0b5e144b"/> + <column name="TITLE" value="451 4.4.4"/> + <column name="FILTER_TYPE" value="EMAIL_FILTER_BOUNCESOFT"/> + <column name="FILTER" value="{"entity":"EmailData_entity","filter":{"type":"group","operator":"AND","childs":[{"type":"row","name":"BODY_PLAIN","operator":"CONTAINS","value":"451 4.4.4","key":"451 4.4.4","contenttype":"TEXT"}]}}"/> + <column name="WORKFLOWDEFINITION_KEY"/> + <column name="PRIORITY" valueNumeric="6"/> + <column name="ISACTIVE" valueNumeric="1"/> + <column name="DESCRIPTION" value="Temporary server error"/> + <column name="WORKFLOWSIGNAL_NAME"/> + </insert> + <insert tableName="email_filter_handling"> + <column name="EMAIL_FILTER_HANDLINGID" value="09c2126e-a5b5-40db-b772-1fc2c703a479"/> + <column name="TITLE" value="smtp;512"/> + <column name="FILTER_TYPE" value="EMAIL_FILTER_BOUNCEHARD"/> + <column name="FILTER" value="{"entity":"EmailData_entity","filter":{"type":"group","operator":"AND","childs":[{"type":"row","name":"BODY_PLAIN","operator":"CONTAINS","value":"smtp;512","key":"smtp;512","contenttype":"TEXT"}]}}"/> + <column name="WORKFLOWDEFINITION_KEY" value="rejectEmailCommunication"/> + <column name="PRIORITY" valueNumeric="34"/> + <column name="ISACTIVE" valueNumeric="1"/> + <column name="DESCRIPTION" value="Host server for the recipient’s domain name cannot be found in DNS."/> + <column name="WORKFLOWSIGNAL_NAME"/> + </insert> + <insert tableName="email_filter_handling"> + <column name="EMAIL_FILTER_HANDLINGID" value="0b488765-3568-4419-acd6-e342b4b79387"/> + <column name="TITLE" value="smtp;511"/> + <column name="FILTER_TYPE" value="EMAIL_FILTER_BOUNCEHARD"/> + <column name="FILTER" value="{"entity":"EmailData_entity","filter":{"type":"group","operator":"AND","childs":[{"type":"row","name":"BODY_PLAIN","operator":"CONTAINS","value":"smtp;511","key":"smtp;511","contenttype":"TEXT"}]}}"/> + <column name="WORKFLOWDEFINITION_KEY" value="rejectEmailCommunication"/> + <column name="PRIORITY" valueNumeric="31"/> + <column name="ISACTIVE" valueNumeric="1"/> + <column name="DESCRIPTION" value="Bad email address. "/> + <column name="WORKFLOWSIGNAL_NAME"/> + </insert> + <insert tableName="email_filter_handling"> + <column name="EMAIL_FILTER_HANDLINGID" value="0bc1af8c-caa2-48a6-a023-34c83fa21635"/> + <column name="TITLE" value="554 5.0.0"/> + <column name="FILTER_TYPE" value="EMAIL_FILTER_BOUNCEHARD"/> + <column name="FILTER" value="{"entity":"EmailData_entity","filter":{"type":"group","operator":"AND","childs":[{"type":"row","name":"BODY_PLAIN","operator":"CONTAINS","value":"554 5.0.0","key":"554 5.0.0","contenttype":"TEXT"}]}}"/> + <column name="WORKFLOWDEFINITION_KEY" value="rejectEmailCommunication"/> + <column name="PRIORITY" valueNumeric="2"/> + <column name="ISACTIVE" valueNumeric="1"/> + <column name="DESCRIPTION" value="The transaction failed for some unstated reason"/> + <column name="WORKFLOWSIGNAL_NAME"/> + </insert> + <insert tableName="email_filter_handling"> + <column name="EMAIL_FILTER_HANDLINGID" value="176f1f25-3dee-4029-92b1-f42a3e5ea66b"/> + <column name="TITLE" value="550 5.1.17 "/> + <column name="FILTER_TYPE" value="EMAIL_FILTER_BOUNCEHARD"/> + <column name="FILTER" value="{"entity":"EmailData_entity","filter":{"type":"group","operator":"AND","childs":[{"type":"row","name":"BODY_PLAIN","operator":"CONTAINS","value":"550 5.1.17","key":"550 5.1.17","contenttype":"TEXT"}]}}"/> + <column name="WORKFLOWDEFINITION_KEY" value="rejectEmailCommunication"/> + <column name="PRIORITY" valueNumeric="15"/> + <column name="ISACTIVE" valueNumeric="1"/> + <column name="DESCRIPTION" value="UTF-8 recipient address not supported"/> + <column name="WORKFLOWSIGNAL_NAME"/> + </insert> + <insert tableName="email_filter_handling"> + <column name="EMAIL_FILTER_HANDLINGID" value="1b5cf2bf-772a-4a0c-8128-d6b5f7201539"/> + <column name="TITLE" value="smtp;541"/> + <column name="FILTER_TYPE" value="EMAIL_FILTER_BOUNCEHARD"/> + <column name="FILTER" value="{"entity":"EmailData_entity","filter":{"type":"group","operator":"AND","childs":[{"type":"row","name":"BODY_PLAIN","operator":"CONTAINS","value":"smtp;541","key":"smtp;541","contenttype":"TEXT"}]}}"/> + <column name="WORKFLOWDEFINITION_KEY" value="rejectEmailCommunication"/> + <column name="PRIORITY" valueNumeric="33"/> + <column name="ISACTIVE" valueNumeric="1"/> + <column name="DESCRIPTION" value="The recipient address rejected your message."/> + <column name="WORKFLOWSIGNAL_NAME"/> + </insert> + <insert tableName="email_filter_handling"> + <column name="EMAIL_FILTER_HANDLINGID" value="1c86cb54-95b5-4fa5-9a2a-8fcc03c48253"/> + <column name="TITLE" value="421 4.7.0"/> + <column name="FILTER_TYPE" value="EMAIL_FILTER_BOUNCESOFT"/> + <column name="FILTER" value="{"entity":"EmailData_entity","filter":{"type":"group","operator":"AND","childs":[{"type":"row","name":"BODY_PLAIN","operator":"CONTAINS","value":"421 4.7.0","key":"421 4.7.0","contenttype":"TEXT"}]}}"/> + <column name="WORKFLOWDEFINITION_KEY"/> + <column name="PRIORITY" valueNumeric="9"/> + <column name="ISACTIVE" valueNumeric="1"/> + <column name="DESCRIPTION" value="Messages from x.x.x.x temporarily deferred due to user complaints"/> + <column name="WORKFLOWSIGNAL_NAME"/> + </insert> + <insert tableName="email_filter_handling"> + <column name="EMAIL_FILTER_HANDLINGID" value="238e5c77-c455-4e48-9b42-1f7745d529fd"/> + <column name="TITLE" value="452 4.0.0"/> + <column name="FILTER_TYPE" value="EMAIL_FILTER_BOUNCESOFT"/> + <column name="FILTER" value="{"entity":"EmailData_entity","filter":{"type":"group","operator":"AND","childs":[{"type":"row","name":"BODY_PLAIN","operator":"CONTAINS","value":"452 4.0.0","key":"452 4.0.0","contenttype":"TEXT"}]}}"/> + <column name="WORKFLOWDEFINITION_KEY"/> + <column name="PRIORITY" valueNumeric="5"/> + <column name="ISACTIVE" valueNumeric="1"/> + <column name="DESCRIPTION" value="Insufficient system storage"/> + <column name="WORKFLOWSIGNAL_NAME"/> + </insert> + <insert tableName="email_filter_handling"> + <column name="EMAIL_FILTER_HANDLINGID" value="28b46cef-e737-4aad-9633-3a6850ec5374"/> + <column name="TITLE" value="421 4.4.2"/> + <column name="FILTER_TYPE" value="EMAIL_FILTER_BOUNCESOFT"/> + <column name="FILTER" value="{"entity":"EmailData_entity","filter":{"type":"group","operator":"AND","childs":[{"type":"row","name":"BODY_PLAIN","operator":"CONTAINS","value":"421 4.4.2","key":"421 4.4.2","contenttype":"TEXT"}]}}"/> + <column name="WORKFLOWDEFINITION_KEY"/> + <column name="PRIORITY" valueNumeric="7"/> + <column name="ISACTIVE" valueNumeric="1"/> + <column name="DESCRIPTION" value="Network Connection Timed Out"/> + <column name="WORKFLOWSIGNAL_NAME"/> + </insert> + <insert tableName="email_filter_handling"> + <column name="EMAIL_FILTER_HANDLINGID" value="335910f8-5ca1-423f-9970-b20f1fc9f962"/> + <column name="TITLE" value="550 5.4.1"/> + <column name="FILTER_TYPE" value="EMAIL_FILTER_BOUNCEHARD"/> + <column name="FILTER" value="{"entity":"EmailData_entity","filter":{"type":"group","operator":"AND","childs":[{"type":"row","name":"BODY_PLAIN","operator":"CONTAINS","value":"550 5.4.1","key":"550 5.4.1","contenttype":"TEXT"}]}}"/> + <column name="WORKFLOWDEFINITION_KEY" value="rejectEmailCommunication"/> + <column name="PRIORITY" valueNumeric="19"/> + <column name="ISACTIVE" valueNumeric="1"/> + <column name="DESCRIPTION" value="Relay Access denied"/> + <column name="WORKFLOWSIGNAL_NAME"/> + </insert> + <insert tableName="email_filter_handling"> + <column name="EMAIL_FILTER_HANDLINGID" value="35dd50ca-4dd6-4313-a394-90542a00e083"/> + <column name="TITLE" value="#5.0.0 smtp"/> + <column name="FILTER_TYPE" value="EMAIL_FILTER_BOUNCEHARD"/> + <column name="FILTER" value="{"entity":"EmailData_entity","filter":{"type":"group","operator":"AND","childs":[{"type":"row","name":"BODY_PLAIN","operator":"CONTAINS","value":"#5.0.0 smtp","key":"#5.0.0 smtp","contenttype":"TEXT"}]}}"/> + <column name="WORKFLOWDEFINITION_KEY" value="rejectEmailCommunication"/> + <column name="PRIORITY" valueNumeric="35"/> + <column name="ISACTIVE" valueNumeric="1"/> + <column name="DESCRIPTION" value="Address does not exist"/> + <column name="WORKFLOWSIGNAL_NAME"/> + </insert> + <insert tableName="email_filter_handling"> + <column name="EMAIL_FILTER_HANDLINGID" value="3d03831c-f44e-43fc-9eac-4ab1c1e5f258"/> + <column name="TITLE" value="Out of Office"/> + <column name="FILTER_TYPE" value="EMAIL_FILTER_AUTORESPONDER"/> + <column name="FILTER" value="{"entity":"EmailData_entity","filter":{"type":"group","operator":"OR","childs":[{"type":"row","name":"SUBJECT","operator":"CONTAINS","value":"Abwesenheit","key":"Abwesenheit","contenttype":"TEXT"},{"type":"row","name":"SUBJECT","operator":"CONTAINS","value":"Abwesenheitsnotiz","key":"Abwesenheitsnotiz","contenttype":"TEXT"},{"type":"row","name":"SUBJECT","operator":"CONTAINS","value":"out of office","key":"out of office","contenttype":"TEXT"}]}}"/> + <column name="WORKFLOWDEFINITION_KEY"/> + <column name="PRIORITY" valueNumeric="1"/> + <column name="ISACTIVE" valueNumeric="1"/> + <column name="DESCRIPTION" value="Out of Office"/> + <column name="WORKFLOWSIGNAL_NAME"/> + </insert> + <insert tableName="email_filter_handling"> + <column name="EMAIL_FILTER_HANDLINGID" value="48435a57-9229-43cd-9c16-71bdf6ba6691"/> + <column name="TITLE" value="452 4.2.2"/> + <column name="FILTER_TYPE" value="EMAIL_FILTER_BOUNCESOFT"/> + <column name="FILTER" value="{"entity":"EmailData_entity","filter":{"type":"group","operator":"OR","childs":[{"type":"row","name":"BODY_PLAIN","operator":"CONTAINS","value":"452 4.2.2","key":"452 4.2.2","contenttype":"TEXT"},{"type":"row","name":"BODY_PLAIN","operator":"CONTAINS","value":"Quota exceeded (mailbox for user is full)","key":"Quota exceeded (mailbox for user is full)","contenttype":"TEXT"}]}}"/> + <column name="WORKFLOWDEFINITION_KEY"/> + <column name="PRIORITY" valueNumeric="3"/> + <column name="ISACTIVE" valueNumeric="1"/> + <column name="DESCRIPTION" value="Mailbox Full "/> + <column name="WORKFLOWSIGNAL_NAME"/> + </insert> + <insert tableName="email_filter_handling"> + <column name="EMAIL_FILTER_HANDLINGID" value="4a458af1-1190-4a39-b0ac-838921e8a8f1"/> + <column name="TITLE" value="550 5.5.0"/> + <column name="FILTER_TYPE" value="EMAIL_FILTER_BOUNCEHARD"/> + <column name="FILTER" value="{"entity":"EmailData_entity","filter":{"type":"group","operator":"AND","childs":[{"type":"row","name":"BODY_PLAIN","operator":"CONTAINS","value":"550 5.5.0","key":"550 5.5.0","contenttype":"TEXT"}]}}"/> + <column name="WORKFLOWDEFINITION_KEY" value="rejectEmailCommunication"/> + <column name="PRIORITY" valueNumeric="10"/> + <column name="ISACTIVE" valueNumeric="1"/> + <column name="DESCRIPTION" value="Other or undefined protocol status "/> + <column name="WORKFLOWSIGNAL_NAME"/> + </insert> + <insert tableName="email_filter_handling"> + <column name="EMAIL_FILTER_HANDLINGID" value="58499fe5-9fe3-47db-ba92-77c06e16aaa7"/> + <column name="TITLE" value="554 5.7.1"/> + <column name="FILTER_TYPE" value="EMAIL_FILTER_BOUNCEHARD"/> + <column name="FILTER" value="{"entity":"EmailData_entity","filter":{"type":"group","operator":"AND","childs":[{"type":"row","name":"BODY_PLAIN","operator":"CONTAINS","value":"554 5.7.1","key":"554 5.7.1","contenttype":"TEXT"}]}}"/> + <column name="WORKFLOWDEFINITION_KEY" value="rejectEmailCommunication"/> + <column name="PRIORITY" valueNumeric="25"/> + <column name="ISACTIVE" valueNumeric="1"/> + <column name="DESCRIPTION" value="Spam message rejected"/> + <column name="WORKFLOWSIGNAL_NAME"/> + </insert> + <insert tableName="email_filter_handling"> + <column name="EMAIL_FILTER_HANDLINGID" value="585e88fe-2955-4b1a-b1c6-261b6f34f635"/> + <column name="TITLE" value="smtp;420"/> + <column name="FILTER_TYPE" value="EMAIL_FILTER_BOUNCESOFT"/> + <column name="FILTER" value="{"entity":"EmailData_entity","filter":{"type":"group","operator":"AND","childs":[{"type":"row","name":"BODY_PLAIN","operator":"CONTAINS","value":"smtp;420","key":"smtp;420","contenttype":"TEXT"}]}}"/> + <column name="WORKFLOWDEFINITION_KEY"/> + <column name="PRIORITY" valueNumeric="27"/> + <column name="ISACTIVE" valueNumeric="1"/> + <column name="DESCRIPTION" value="Timeout connection problem"/> + <column name="WORKFLOWSIGNAL_NAME"/> + </insert> + <insert tableName="email_filter_handling"> + <column name="EMAIL_FILTER_HANDLINGID" value="59d22eed-282e-4491-90d8-54f06b7c3d7c"/> + <column name="TITLE" value="#5.1.0 smtp"/> + <column name="FILTER_TYPE" value="EMAIL_FILTER_BOUNCEHARD"/> + <column name="FILTER" value="{"entity":"EmailData_entity","filter":{"type":"group","operator":"AND","childs":[{"type":"row","name":"BODY_PLAIN","operator":"CONTAINS","value":"#5.1.0 smtp","key":"#5.1.0 smtp","contenttype":"TEXT"}]}}"/> + <column name="WORKFLOWDEFINITION_KEY" value="rejectEmailCommunication"/> + <column name="PRIORITY" valueNumeric="36"/> + <column name="ISACTIVE" valueNumeric="1"/> + <column name="DESCRIPTION" value="Other address status"/> + <column name="WORKFLOWSIGNAL_NAME"/> + </insert> + <insert tableName="email_filter_handling"> + <column name="EMAIL_FILTER_HANDLINGID" value="5cd83791-41d6-4d25-829b-b5fe71f220eb"/> + <column name="TITLE" value="smtp;553"/> + <column name="FILTER_TYPE" value="EMAIL_FILTER_BOUNCEHARD"/> + <column name="FILTER" value="{"entity":"EmailData_entity","filter":{"type":"group","operator":"AND","childs":[{"type":"row","name":"BODY_PLAIN","operator":"CONTAINS","value":"smtp;553","key":"smtp;553","contenttype":"TEXT"}]}}"/> + <column name="WORKFLOWDEFINITION_KEY" value="rejectEmailCommunication"/> + <column name="PRIORITY" valueNumeric="32"/> + <column name="ISACTIVE" valueNumeric="1"/> + <column name="DESCRIPTION" value="Mailbox name invalid "/> + <column name="WORKFLOWSIGNAL_NAME"/> + </insert> + <insert tableName="email_filter_handling"> + <column name="EMAIL_FILTER_HANDLINGID" value="66e9c42e-0545-4906-95f4-ae58e0eba900"/> + <column name="TITLE" value="550 5.2.1"/> + <column name="FILTER_TYPE" value="EMAIL_FILTER_BOUNCEHARD"/> + <column name="FILTER" value="{"entity":"EmailData_entity","filter":{"type":"group","operator":"AND","childs":[{"type":"row","name":"BODY_PLAIN","operator":"CONTAINS","value":"550 5.2.1","key":"550 5.2.1","contenttype":"TEXT"}]}}"/> + <column name="WORKFLOWDEFINITION_KEY" value="rejectEmailCommunication"/> + <column name="PRIORITY" valueNumeric="18"/> + <column name="ISACTIVE" valueNumeric="1"/> + <column name="DESCRIPTION" value="The email account is unreachable."/> + <column name="WORKFLOWSIGNAL_NAME"/> + </insert> + <insert tableName="email_filter_handling"> + <column name="EMAIL_FILTER_HANDLINGID" value="7c1e7823-3b16-4ad9-9631-c5c1435d5cd8"/> + <column name="TITLE" value="550 5.1.10 "/> + <column name="FILTER_TYPE" value="EMAIL_FILTER_BOUNCEHARD"/> + <column name="FILTER" value="{"entity":"EmailData_entity","filter":{"type":"group","operator":"AND","childs":[{"type":"row","name":"BODY_PLAIN","operator":"CONTAINS","value":"550 5.1.10","key":"550 5.1.10","contenttype":"TEXT"}]}}"/> + <column name="WORKFLOWDEFINITION_KEY" value="rejectEmailCommunication"/> + <column name="PRIORITY" valueNumeric="16"/> + <column name="ISACTIVE" valueNumeric="1"/> + <column name="DESCRIPTION" value="Recipient not found"/> + <column name="WORKFLOWSIGNAL_NAME"/> + </insert> + <insert tableName="email_filter_handling"> + <column name="EMAIL_FILTER_HANDLINGID" value="85107040-57fa-4366-ac4b-68ad55514b4e"/> + <column name="TITLE" value="#5.1.2 smtp"/> + <column name="FILTER_TYPE" value="EMAIL_FILTER_BOUNCEHARD"/> + <column name="FILTER" value="{"entity":"EmailData_entity","filter":{"type":"group","operator":"AND","childs":[{"type":"row","name":"BODY_PLAIN","operator":"CONTAINS","value":"#5.1.2 smtp","key":"#5.1.2 smtp","contenttype":"TEXT"}]}}"/> + <column name="WORKFLOWDEFINITION_KEY" value="rejectEmailCommunication"/> + <column name="PRIORITY" valueNumeric="39"/> + <column name="ISACTIVE" valueNumeric="1"/> + <column name="DESCRIPTION" value="Host unknown"/> + <column name="WORKFLOWSIGNAL_NAME"/> + </insert> + <insert tableName="email_filter_handling"> + <column name="EMAIL_FILTER_HANDLINGID" value="864e7769-c3f9-4f34-a4cb-ba3983eccc1d"/> + <column name="TITLE" value="550 5.5.0"/> + <column name="FILTER_TYPE" value="EMAIL_FILTER_BOUNCEHARD"/> + <column name="FILTER" value="{"entity":"EmailData_entity","filter":{"type":"group","operator":"AND","childs":[{"type":"row","name":"BODY_PLAIN","operator":"CONTAINS","value":"550 5.5.0","key":"550 5.5.0","contenttype":"TEXT"}]}}"/> + <column name="WORKFLOWDEFINITION_KEY" value="rejectEmailCommunication"/> + <column name="PRIORITY" valueNumeric="21"/> + <column name="ISACTIVE" valueNumeric="1"/> + <column name="DESCRIPTION" value="Other or undefined protocol status"/> + <column name="WORKFLOWSIGNAL_NAME"/> + </insert> + <insert tableName="email_filter_handling"> + <column name="EMAIL_FILTER_HANDLINGID" value="891659eb-c9b8-4363-96d0-c691bd30c0a7"/> + <column name="TITLE" value="smtp;510"/> + <column name="FILTER_TYPE" value="EMAIL_FILTER_BOUNCEHARD"/> + <column name="FILTER" value="{"entity":"EmailData_entity","filter":{"type":"group","operator":"AND","childs":[{"type":"row","name":"BODY_PLAIN","operator":"CONTAINS","value":"smtp;510","key":"smtp;510","contenttype":"TEXT"}]}}"/> + <column name="WORKFLOWDEFINITION_KEY" value="rejectEmailCommunication"/> + <column name="PRIORITY" valueNumeric="30"/> + <column name="ISACTIVE" valueNumeric="1"/> + <column name="DESCRIPTION" value="Bad email address."/> + <column name="WORKFLOWSIGNAL_NAME"/> + </insert> + <insert tableName="email_filter_handling"> + <column name="EMAIL_FILTER_HANDLINGID" value="8d43c26f-78db-4972-a850-52f997780640"/> + <column name="TITLE" value="441 4.4.1"/> + <column name="FILTER_TYPE" value="EMAIL_FILTER_BOUNCESOFT"/> + <column name="FILTER" value="{"entity":"EmailData_entity","filter":{"type":"group","operator":"AND","childs":[{"type":"row","name":"BODY_PLAIN","operator":"CONTAINS","value":"441 4.4.1","key":"441 4.4.1","contenttype":"TEXT"}]}}"/> + <column name="WORKFLOWDEFINITION_KEY"/> + <column name="PRIORITY" valueNumeric="12"/> + <column name="ISACTIVE" valueNumeric="1"/> + <column name="DESCRIPTION" value="Error when sending an email"/> + <column name="WORKFLOWSIGNAL_NAME"/> + </insert> + <insert tableName="email_filter_handling"> + <column name="EMAIL_FILTER_HANDLINGID" value="9939cdd4-de2a-44bd-8fc0-ab541b1d733f"/> + <column name="TITLE" value="550 5.0.0"/> + <column name="FILTER_TYPE" value="EMAIL_FILTER_BOUNCEHARD"/> + <column name="FILTER" value="{"entity":"EmailData_entity","filter":{"type":"group","operator":"AND","childs":[{"type":"row","name":"BODY_PLAIN","operator":"CONTAINS","value":"550 5.0.0","key":"550 5.0.0","contenttype":"TEXT"}]}}"/> + <column name="WORKFLOWDEFINITION_KEY" value="rejectEmailCommunication"/> + <column name="PRIORITY" valueNumeric="4"/> + <column name="ISACTIVE" valueNumeric="1"/> + <column name="DESCRIPTION" value="Sender has no A, AAAA, or MX DNS records"/> + <column name="WORKFLOWSIGNAL_NAME"/> + </insert> + <insert tableName="email_filter_handling"> + <column name="EMAIL_FILTER_HANDLINGID" value="a30571d3-9b3c-40b4-9077-8c04b257bd66"/> + <column name="TITLE" value="550 5.1.351"/> + <column name="FILTER_TYPE" value="EMAIL_FILTER_BOUNCEHARD"/> + <column name="FILTER" value="{"entity":"EmailData_entity","filter":{"type":"group","operator":"AND","childs":[{"type":"row","name":"BODY_PLAIN","operator":"CONTAINS","value":"550 5.1.351","key":"550 5.1.351","contenttype":"TEXT"}]}}"/> + <column name="WORKFLOWDEFINITION_KEY" value="rejectEmailCommunication"/> + <column name="PRIORITY" valueNumeric="17"/> + <column name="ISACTIVE" valueNumeric="1"/> + <column name="DESCRIPTION" value="Remote server returned unknown recipient or mailbox unavailable"/> + <column name="WORKFLOWSIGNAL_NAME"/> + </insert> + <insert tableName="email_filter_handling"> + <column name="EMAIL_FILTER_HANDLINGID" value="a678e83c-2c7b-4004-b150-b697272acd7e"/> + <column name="TITLE" value="550 5.4.310"/> + <column name="FILTER_TYPE" value="EMAIL_FILTER_BOUNCEHARD"/> + <column name="FILTER" value="{"entity":"EmailData_entity","filter":{"type":"group","operator":"AND","childs":[{"type":"row","name":"BODY_PLAIN","operator":"CONTAINS","value":"550 5.4.310","key":"550 5.4.310","contenttype":"TEXT"}]}}"/> + <column name="WORKFLOWDEFINITION_KEY" value="rejectEmailCommunication"/> + <column name="PRIORITY" valueNumeric="20"/> + <column name="ISACTIVE" valueNumeric="1"/> + <column name="DESCRIPTION" value="DNS domain does not exist"/> + <column name="WORKFLOWSIGNAL_NAME"/> + </insert> + <insert tableName="email_filter_handling"> + <column name="EMAIL_FILTER_HANDLINGID" value="a97bb01a-aede-4541-b20c-3c33909674a4"/> + <column name="TITLE" value="552 5.3.4"/> + <column name="FILTER_TYPE" value="EMAIL_FILTER_BOUNCEHARD"/> + <column name="FILTER" value="{"entity":"EmailData_entity","filter":{"type":"group","operator":"AND","childs":[]}}"/> + <column name="WORKFLOWDEFINITION_KEY" value="rejectEmailCommunication"/> + <column name="PRIORITY" valueNumeric="24"/> + <column name="ISACTIVE" valueNumeric="0"/> + <column name="DESCRIPTION" value="Message size exceeds fixed limit"/> + <column name="WORKFLOWSIGNAL_NAME"/> + </insert> + <insert tableName="email_filter_handling"> + <column name="EMAIL_FILTER_HANDLINGID" value="afd60eea-35a6-47e5-8620-ae7996055980"/> + <column name="TITLE" value="smtp;441"/> + <column name="FILTER_TYPE" value="EMAIL_FILTER_BOUNCESOFT"/> + <column name="FILTER" value="{"entity":"EmailData_entity","filter":{"type":"group","operator":"AND","childs":[{"type":"row","name":"BODY_PLAIN","operator":"CONTAINS","value":"smtp;441","key":"smtp;441","contenttype":"TEXT"}]}}"/> + <column name="WORKFLOWDEFINITION_KEY"/> + <column name="PRIORITY" valueNumeric="28"/> + <column name="ISACTIVE" valueNumeric="1"/> + <column name="DESCRIPTION" value="The recipient’s server is not responding"/> + <column name="WORKFLOWSIGNAL_NAME"/> + </insert> + <insert tableName="email_filter_handling"> + <column name="EMAIL_FILTER_HANDLINGID" value="b13efeca-543e-4aa9-b184-b8dbd2b4fa53"/> + <column name="TITLE" value="552 5.2.3"/> + <column name="FILTER_TYPE" value="EMAIL_FILTER_BOUNCEHARD"/> + <column name="FILTER" value="{"entity":"EmailData_entity","filter":{"type":"group","operator":"AND","childs":[{"type":"row","name":"BODY_PLAIN","operator":"CONTAINS","value":"552 5.2.3","key":"552 5.2.3","contenttype":"TEXT"}]}}"/> + <column name="WORKFLOWDEFINITION_KEY" value="rejectEmailCommunication"/> + <column name="PRIORITY" valueNumeric="23"/> + <column name="ISACTIVE" valueNumeric="0"/> + <column name="DESCRIPTION" value="Message is too long."/> + <column name="WORKFLOWSIGNAL_NAME"/> + </insert> + <insert tableName="email_filter_handling"> + <column name="EMAIL_FILTER_HANDLINGID" value="b2e4162f-ebe3-458c-b38b-87f8d8a4d597"/> + <column name="TITLE" value="552 5.0.0"/> + <column name="FILTER_TYPE" value="EMAIL_FILTER_BOUNCEHARD"/> + <column name="FILTER" value="{"entity":"EmailData_entity","filter":{"type":"group","operator":"AND","childs":[{"type":"row","name":"BODY_PLAIN","operator":"CONTAINS","value":"552 5.0.0","key":"552 5.0.0","contenttype":"TEXT"}]}}"/> + <column name="WORKFLOWDEFINITION_KEY" value="rejectEmailCommunication"/> + <column name="PRIORITY" valueNumeric="13"/> + <column name="ISACTIVE" valueNumeric="0"/> + <column name="DESCRIPTION" value="The action was aborted due to exceeded storage allocation "/> + <column name="WORKFLOWSIGNAL_NAME"/> + </insert> + <insert tableName="email_filter_handling"> + <column name="EMAIL_FILTER_HANDLINGID" value="b49155c2-44a4-419e-a909-fabbaa560ef5"/> + <column name="TITLE" value="smtp;450"/> + <column name="FILTER_TYPE" value="EMAIL_FILTER_BOUNCESOFT"/> + <column name="FILTER" value="{"entity":"EmailData_entity","filter":{"type":"group","operator":"AND","childs":[{"type":"row","name":"BODY_PLAIN","operator":"CONTAINS","value":"smtp;450","key":"smtp;450","contenttype":"TEXT"}]}}"/> + <column name="WORKFLOWDEFINITION_KEY"/> + <column name="PRIORITY" valueNumeric="29"/> + <column name="ISACTIVE" valueNumeric="1"/> + <column name="DESCRIPTION" value="The requested command failed because the user's mailbox was unavailable. "/> + <column name="WORKFLOWSIGNAL_NAME"/> + </insert> + <insert tableName="email_filter_handling"> + <column name="EMAIL_FILTER_HANDLINGID" value="b980357b-1a22-402c-9873-e8901192a650"/> + <column name="TITLE" value="451 4.3.0"/> + <column name="FILTER_TYPE" value="EMAIL_FILTER_BOUNCESOFT"/> + <column name="FILTER" value="{"entity":"EmailData_entity","filter":{"type":"group","operator":"AND","childs":[{"type":"row","name":"BODY_PLAIN","operator":"CONTAINS","value":"451 4.3.0","key":"451 4.3.0","contenttype":"TEXT"}]}}"/> + <column name="WORKFLOWDEFINITION_KEY"/> + <column name="PRIORITY" valueNumeric="14"/> + <column name="ISACTIVE" valueNumeric="1"/> + <column name="DESCRIPTION" value="Mail server temporarily rejected message"/> + <column name="WORKFLOWSIGNAL_NAME"/> + </insert> + <insert tableName="email_filter_handling"> + <column name="EMAIL_FILTER_HANDLINGID" value="be3e7ce7-f3b9-463b-a903-c11fbf04de20"/> + <column name="TITLE" value="554 5.4.4"/> + <column name="FILTER_TYPE" value="EMAIL_FILTER_BOUNCEHARD"/> + <column name="FILTER" value="{"entity":"EmailData_entity","filter":{"type":"group","operator":"OR","childs":[{"type":"row","name":"BODY_PLAIN","operator":"CONTAINS","value":"#5.4.4 X-Postfix; unable to look up","key":"#5.4.4 X-Postfix; unable to look up","contenttype":"TEXT"},{"type":"row","name":"BODY_PLAIN","operator":"CONTAINS","value":"554 5.4.4","key":"554 5.4.4","contenttype":"TEXT"}]}}"/> + <column name="WORKFLOWDEFINITION_KEY" value="rejectEmailCommunication"/> + <column name="PRIORITY" valueNumeric="11"/> + <column name="ISACTIVE" valueNumeric="1"/> + <column name="DESCRIPTION" value="Domain Lookup Failed "/> + <column name="WORKFLOWSIGNAL_NAME"/> + </insert> + <insert tableName="email_filter_handling"> + <column name="EMAIL_FILTER_HANDLINGID" value="dda90be4-ef9b-4f9b-8a4a-c234ef66219a"/> + <column name="TITLE" value="550 5.7.1"/> + <column name="FILTER_TYPE" value="EMAIL_FILTER_BOUNCEHARD"/> + <column name="FILTER" value="{"entity":"EmailData_entity","filter":{"type":"group","operator":"AND","childs":[{"type":"row","name":"BODY_PLAIN","operator":"CONTAINS","value":"550 5.7.1","key":"550 5.7.1","contenttype":"TEXT"}]}}"/> + <column name="WORKFLOWDEFINITION_KEY" value="rejectEmailCommunication"/> + <column name="PRIORITY" valueNumeric="22"/> + <column name="ISACTIVE" valueNumeric="1"/> + <column name="DESCRIPTION" value="Unable to Relay "/> + <column name="WORKFLOWSIGNAL_NAME"/> + </insert> + <insert tableName="email_filter_handling"> + <column name="EMAIL_FILTER_HANDLINGID" value="ddeabcba-cb37-4789-9308-0eebee275367"/> + <column name="TITLE" value="smtp;421"/> + <column name="FILTER_TYPE" value="EMAIL_FILTER_BOUNCESOFT"/> + <column name="FILTER" value="{"entity":"EmailData_entity","filter":{"type":"group","operator":"AND","childs":[{"type":"row","name":"BODY_PLAIN","operator":"CONTAINS","value":"smtp;421","key":"smtp;421","contenttype":"TEXT"}]}}"/> + <column name="WORKFLOWDEFINITION_KEY"/> + <column name="PRIORITY" valueNumeric="26"/> + <column name="ISACTIVE" valueNumeric="1"/> + <column name="DESCRIPTION" value="Service is unavailable due to a connection problem"/> + <column name="WORKFLOWSIGNAL_NAME"/> + </insert> + <insert tableName="email_filter_handling"> + <column name="EMAIL_FILTER_HANDLINGID" value="e43c726f-6a10-4afd-af14-54ea1a76cf64"/> + <column name="TITLE" value="550 5.1.1"/> + <column name="FILTER_TYPE" value="EMAIL_FILTER_BOUNCEHARD"/> + <column name="FILTER" value="{"entity":"EmailData_entity","filter":{"type":"group","operator":"AND","childs":[{"type":"row","name":"BODY_PLAIN","operator":"CONTAINS","value":"550 5.1.1","key":"550 5.1.1","contenttype":"TEXT"}]}}"/> + <column name="WORKFLOWDEFINITION_KEY" value="rejectEmailCommunication"/> + <column name="PRIORITY" valueNumeric="8"/> + <column name="ISACTIVE" valueNumeric="1"/> + <column name="DESCRIPTION" value="Recipient address rejected "/> + <column name="WORKFLOWSIGNAL_NAME"/> + </insert> + </changeSet> +</databaseChangeLog> \ No newline at end of file diff --git a/.liquibase/Data_alias/basic/2021.1.2/MailBounce/insert_emailFilterTypeKeyword.xml b/.liquibase/Data_alias/basic/2021.1.2/MailBounce/insert_emailFilterTypeKeyword.xml new file mode 100644 index 0000000000000000000000000000000000000000..cdc09371ef56ac41f51d341f788bfb7276967267 --- /dev/null +++ b/.liquibase/Data_alias/basic/2021.1.2/MailBounce/insert_emailFilterTypeKeyword.xml @@ -0,0 +1,17 @@ +<?xml version="1.1" encoding="UTF-8" standalone="no"?> +<databaseChangeLog xmlns="http://www.liquibase.org/xml/ns/dbchangelog" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-3.6.xsd"> + <changeSet author="m.groppe" id="986ad84f-051d-4629-b8b1-46e74663f887"> + <insert tableName="AB_KEYWORD_ENTRY"> + <column name="AB_KEYWORD_ENTRYID" value="bbfdce4f-ab1d-4bef-9150-710003b35248"/> + <column name="AB_KEYWORD_CATEGORY_ID" value="893a5e99-1592-4e58-b5a3-4b04820b7a16"/> + <column name="KEYID" value="EMAIL_FILTER_AUTORESPONDER"/> + <column name="TITLE" value="Autoresponder"/> + <column name="CONTAINER" value="EmailFilterType"/> + <column name="SORTING" valueNumeric="4"/> + <column name="ISACTIVE" valueNumeric="1"/> + <column name="ISESSENTIAL" valueNumeric="1"/> + </insert> + </changeSet> +</databaseChangeLog> \ No newline at end of file diff --git a/.liquibase/Data_alias/basic/2021.1.2/changelog.xml b/.liquibase/Data_alias/basic/2021.1.2/changelog.xml index a1edbff54e9b7831c1d969fd0457397c92987634..e96b7c2d027d79d35b79f78e1035d92cef2eda4f 100644 --- a/.liquibase/Data_alias/basic/2021.1.2/changelog.xml +++ b/.liquibase/Data_alias/basic/2021.1.2/changelog.xml @@ -1,6 +1,8 @@ <?xml version="1.1" encoding="UTF-8" standalone="no"?> <databaseChangeLog xmlns="http://www.liquibase.org/xml/ns/dbchangelog" - xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-3.6.xsd"> - <include relativeToChangelogFile="true" file="Bulkmail/changelog.xml"/> + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-3.6.xsd"> + <include relativeToChangelogFile="true" file="MailBounce/changelog.xml"/> + <include relativeToChangelogFile="true" file="Bulkmail/changelog.xml"/> <include relativeToChangelogFile="true" file="Registration_Webservice/changelog.xml"/> </databaseChangeLog> diff --git a/.liquibase/Data_alias/changelog.xml b/.liquibase/Data_alias/changelog.xml index be798212abcfd58410c70a3410e1096ad0412416..f1bb7247fec3c2f006505dfff9fbd92dee8b462f 100644 --- a/.liquibase/Data_alias/changelog.xml +++ b/.liquibase/Data_alias/changelog.xml @@ -26,6 +26,7 @@ <include relativeToChangelogFile="true" file="basic/2021.1.0/changelog.xml"/> <include relativeToChangelogFile="true" file="basic/2021.1.1/changelog.xml"/> <include relativeToChangelogFile="true" file="basic/2021.1.2/changelog.xml"/> + <include relativeToChangelogFile="true" file="basic/workflows/changelog.xml" context="workflow"/> <include relativeToChangelogFile="true" file="basic/_demoData/changelog.xml" context="example"/> </databaseChangeLog> \ No newline at end of file diff --git a/aliasDefinition/Data_alias/Data_alias.aod b/aliasDefinition/Data_alias/Data_alias.aod index 7656b1339beab1b8b0c790e957db90cb1e11f5b0..41bd1ab3453820da881a7b900906b9ad4e61a9e5 100644 --- a/aliasDefinition/Data_alias/Data_alias.aod +++ b/aliasDefinition/Data_alias/Data_alias.aod @@ -21580,6 +21580,124 @@ </entityFieldDb> </entityFields> </entityDb> + <entityDb> + <name>MAIL_BOUNCE</name> + <dbName></dbName> + <idColumn>MAIL_BOUNCEID</idColumn> + <idGeneratorType v="0" /> + <idGeneratorInterval v="1" /> + <documentation></documentation> + <title></title> + <description></description> + <auditSyncConfig> + <name>auditSyncConfig</name> + <auditMode v="0" /> + <syncActive v="false" /> + <syncComplete v="true" /> + <syncDirection v="1" /> + <syncIds></syncIds> + </auditSyncConfig> + <entityFields> + <entityFieldDb> + <name>DATE_BOUNCE</name> + <dbName></dbName> + <primaryKey v="false" /> + <columnType v="93" /> + <size v="19" /> + <scale v="0" /> + <notNull v="false" /> + <isUnique v="false" /> + <index v="false" /> + <documentation></documentation> + <title></title> + <description></description> + </entityFieldDb> + <entityFieldDb> + <name>EMAIL_FILTER_HANDLING_ID</name> + <dbName></dbName> + <primaryKey v="false" /> + <columnType v="1" /> + <size v="36" /> + <scale v="0" /> + <notNull v="false" /> + <isUnique v="false" /> + <index v="false" /> + <documentation></documentation> + <title></title> + <description></description> + </entityFieldDb> + <entityFieldDb> + <name>MAIL_BOUNCEID</name> + <dbName></dbName> + <primaryKey v="true" /> + <columnType v="1" /> + <size v="36" /> + <scale v="0" /> + <notNull v="true" /> + <isUnique v="true" /> + <index v="true" /> + <documentation></documentation> + <title></title> + <description></description> + </entityFieldDb> + <entityFieldDb> + <name>CATEGORY</name> + <dbName></dbName> + <primaryKey v="false" /> + <columnType v="12" /> + <size v="36" /> + <scale v="0" /> + <notNull v="false" /> + <isUnique v="false" /> + <index v="false" /> + <documentation></documentation> + <title></title> + <description></description> + </entityFieldDb> + <entityFieldDb> + <name>RECIPIENT_EMAIL</name> + <dbName></dbName> + <primaryKey v="false" /> + <columnType v="12" /> + <size v="255" /> + <scale v="0" /> + <notNull v="false" /> + <isUnique v="false" /> + <index v="false" /> + <documentation></documentation> + <title></title> + <description></description> + </entityFieldDb> + <entityFieldDb> + <name>MAIL_LOG_ID</name> + <dbName></dbName> + <primaryKey v="false" /> + <columnType v="1" /> + <size v="36" /> + <scale v="0" /> + <notNull v="false" /> + <isUnique v="false" /> + <index v="true" /> + <documentation></documentation> + <title></title> + <description></description> + </entityFieldDb> + <entityFieldDb> + <name>CONTACT_ID</name> + <dbName></dbName> + <primaryKey v="false" /> + <columnType v="1" /> + <size v="36" /> + <scale v="0" /> + <notNull v="false" /> + <isUnique v="false" /> + <index v="true" /> + <documentation></documentation> + <title></title> + <description></description> + </entityFieldDb> + </entityFields> + </entityDb> </entities> </entityGroup> </aliasDefDb> diff --git a/entity/CommunicationSettings_entity/CommunicationSettings_entity.aod b/entity/CommunicationSettings_entity/CommunicationSettings_entity.aod index 42abe2d2685789827ba185dff396aeced522da14..bced411e37d874d27f75652d5978f5bc6634304f 100644 --- a/entity/CommunicationSettings_entity/CommunicationSettings_entity.aod +++ b/entity/CommunicationSettings_entity/CommunicationSettings_entity.aod @@ -5,6 +5,7 @@ <majorModelMode>DISTRIBUTED</majorModelMode> <contentTitleProcess>%aditoprj%/entity/CommunicationSettings_entity/contentTitleProcess.js</contentTitleProcess> <onValidation>%aditoprj%/entity/CommunicationSettings_entity/onValidation.js</onValidation> + <initFilterProcess>%aditoprj%/entity/CommunicationSettings_entity/initFilterProcess.js</initFilterProcess> <iconIdProcess>%aditoprj%/entity/CommunicationSettings_entity/iconIdProcess.js</iconIdProcess> <titlePlural>Communication Settings</titlePlural> <recordContainer>db</recordContainer> @@ -206,6 +207,12 @@ <name>overrideInfo</name> <valueProcess>%aditoprj%/entity/CommunicationSettings_entity/entityfields/overrideinfo/valueProcess.js</valueProcess> </entityField> + <entityField> + <name>ISACTIVE</name> + <title>Active</title> + <contentType>BOOLEAN</contentType> + <valueProcess>%aditoprj%/entity/CommunicationSettings_entity/entityfields/isactive/valueProcess.js</valueProcess> + </entityField> </entityFields> <recordContainers> <dbRecordContainer> @@ -307,6 +314,11 @@ <name>VERSION.value</name> <recordfield>COMMUNICATIONLEGALBASE.VERSION</recordfield> </dbRecordFieldMapping> + <dbRecordFieldMapping> + <name>ISACTIVE.value</name> + <recordfield>COMMUNICATIONSETTINGS.ISACTIVE</recordfield> + <isFilterable v="true" /> + </dbRecordFieldMapping> </recordFieldMappings> <linkInformation> <linkInformation> diff --git a/entity/EmailFilterHandling_entity/entityfields/isfallthrough/valueProcess.js b/entity/CommunicationSettings_entity/entityfields/isactive/valueProcess.js similarity index 87% rename from entity/EmailFilterHandling_entity/entityfields/isfallthrough/valueProcess.js rename to entity/CommunicationSettings_entity/entityfields/isactive/valueProcess.js index 3c10e6fa54fca826654bc01d400f8309522d6453..e056e70a86e09a933db2882efb0ef4a1ed7163fe 100644 --- a/entity/EmailFilterHandling_entity/entityfields/isfallthrough/valueProcess.js +++ b/entity/CommunicationSettings_entity/entityfields/isactive/valueProcess.js @@ -4,5 +4,5 @@ import("system.result"); if (vars.get("$sys.recordstate") == neon.OPERATINGSTATE_NEW && vars.get("$this.value") == null) { - result.string("0"); + result.string("1"); } \ No newline at end of file diff --git a/entity/CommunicationSettings_entity/initFilterProcess.js b/entity/CommunicationSettings_entity/initFilterProcess.js new file mode 100644 index 0000000000000000000000000000000000000000..373746ab79a62074311f7e01308ed8f05f7b0798 --- /dev/null +++ b/entity/CommunicationSettings_entity/initFilterProcess.js @@ -0,0 +1,26 @@ +import("system.translate"); +import("system.result"); +import("system.neon"); +import("system.vars"); + +var filter; +if (vars.get("$sys.presentationmode") === neon.CONTEXT_PRESENTATIONMODE_FILTER) +{ + filter = JSON.stringify({ + type: "group", + operator: "AND", + childs: [{ + type: "row", + name: "ISACTIVE", + operator: "EQUAL", + contenttype: "BOOLEAN", + key: "1", + value: "1" + }] + }); + +} +if(filter) +{ + result.string(filter); +} \ No newline at end of file diff --git a/entity/CommunicationSettings_entity/onValidation.js b/entity/CommunicationSettings_entity/onValidation.js index 9641a12f5a4edec9e96b0f93da73cef3a1411947..eff3b180a4b17ed8df679b278507d08b257a271f 100644 --- a/entity/CommunicationSettings_entity/onValidation.js +++ b/entity/CommunicationSettings_entity/onValidation.js @@ -11,6 +11,7 @@ var alreadyExistsQuery = new SqlBuilder() .selectCount() .from("COMMUNICATIONSETTINGS") .where("COMMUNICATIONSETTINGS.CONTACT_ID", vars.get("$field.CONTACT_ID")) + .and("COMMUNICATIONSETTINGS.ISACTIVE",1) .and("COMMUNICATIONSETTINGS.COMMUNICATIONSETTINGSID", vars.get("$field.COMMUNICATIONSETTINGSID"), SqlBuilder.NOT_EQUAL()) .and("COMMUNICATIONSETTINGS.CHANNEL_TYPE", channelType); diff --git a/entity/EmailFilterHandlingSetWorkflow_entity/EmailFilterHandlingSetWorkflow_entity.aod b/entity/EmailFilterHandlingSetWorkflow_entity/EmailFilterHandlingSetWorkflow_entity.aod new file mode 100644 index 0000000000000000000000000000000000000000..bbb2c1d0b72520c33b5ec90e97a027286709d593 --- /dev/null +++ b/entity/EmailFilterHandlingSetWorkflow_entity/EmailFilterHandlingSetWorkflow_entity.aod @@ -0,0 +1,54 @@ +<?xml version="1.0" encoding="UTF-8"?> +<entity xmlns="http://www.adito.de/2018/ao/Model" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" VERSION="1.3.21" xsi:schemaLocation="http://www.adito.de/2018/ao/Model adito://models/xsd/entity/1.3.21"> + <name>EmailFilterHandlingSetWorkflow_entity</name> + <majorModelMode>DISTRIBUTED</majorModelMode> + <documentation>%aditoprj%/entity/EmailFilterHandlingSetWorkflow_entity/documentation.adoc</documentation> + <recordContainer>recordContainer</recordContainer> + <entityFields> + <entityProvider> + <name>#PROVIDER</name> + </entityProvider> + <entityProvider> + <name>#PROVIDER_AGGREGATES</name> + <useAggregates v="true" /> + </entityProvider> + <entityField> + <name>EMAILFILTERHANDLING_IDS</name> + <valueProcess>%aditoprj%/entity/EmailFilterHandlingSetWorkflow_entity/entityfields/emailfilterhandling_ids/valueProcess.js</valueProcess> + </entityField> + <entityField> + <name>WORKFLOWDEFINITION_KEY</name> + <title>Workflow</title> + <consumer>Workflows</consumer> + <state>EDITABLE</state> + </entityField> + <entityConsumer> + <name>Workflows</name> + <dependency> + <name>dependency</name> + <entityName>WorkflowDefinition_entity</entityName> + <fieldName>#PROVIDER</fieldName> + </dependency> + </entityConsumer> + <entityParameter> + <name>Selection_param</name> + <expose v="true" /> + </entityParameter> + <entityParameter> + <name>Filter_param</name> + <expose v="true" /> + </entityParameter> + <entityActionField> + <name>SetWorkflow</name> + <title>Set workflow</title> + <onActionProcess>%aditoprj%/entity/EmailFilterHandlingSetWorkflow_entity/entityfields/setworkflow/onActionProcess.js</onActionProcess> + <tooltipProcess>%aditoprj%/entity/EmailFilterHandlingSetWorkflow_entity/entityfields/setworkflow/tooltipProcess.js</tooltipProcess> + </entityActionField> + </entityFields> + <recordContainers> + <datalessRecordContainer> + <name>recordContainer</name> + <alias>Data_alias</alias> + </datalessRecordContainer> + </recordContainers> +</entity> diff --git a/entity/EmailFilterHandlingSetWorkflow_entity/documentation.adoc b/entity/EmailFilterHandlingSetWorkflow_entity/documentation.adoc new file mode 100644 index 0000000000000000000000000000000000000000..3dba56434c05c7ea59dc048da00bcd64f8361e97 --- /dev/null +++ b/entity/EmailFilterHandlingSetWorkflow_entity/documentation.adoc @@ -0,0 +1,3 @@ += EmailFilterHandlingSetWorkflow_entity + +Entity for a serial action to set the workflow for multiple mail filters. \ No newline at end of file diff --git a/entity/EmailFilterHandlingSetWorkflow_entity/entityfields/emailfilterhandling_ids/valueProcess.js b/entity/EmailFilterHandlingSetWorkflow_entity/entityfields/emailfilterhandling_ids/valueProcess.js new file mode 100644 index 0000000000000000000000000000000000000000..3e11a5f4ad618b1476e572870a2eeb6b60380aee --- /dev/null +++ b/entity/EmailFilterHandlingSetWorkflow_entity/entityfields/emailfilterhandling_ids/valueProcess.js @@ -0,0 +1,15 @@ +import("Util_lib"); +import("FilterViewAction_lib"); +import("system.result"); +import("system.vars"); + +var emailFilterHandlingIds = []; + +var selection = Utils.parseJSON(vars.get("$param.Selection_param")); +var filter = vars.get("$param.Filter_param"); +var context = "EmailFilterHandling"; + +emailFilterHandlingIds = FilterViewActionUtils.getUidsBySelectionOrFilter(context, selection, filter); + + +result.string(JSON.stringify(emailFilterHandlingIds)); \ No newline at end of file diff --git a/entity/EmailFilterHandlingSetWorkflow_entity/entityfields/setworkflow/onActionProcess.js b/entity/EmailFilterHandlingSetWorkflow_entity/entityfields/setworkflow/onActionProcess.js new file mode 100644 index 0000000000000000000000000000000000000000..88eac51943a1a01d90f43ca2c154afc14b043a02 --- /dev/null +++ b/entity/EmailFilterHandlingSetWorkflow_entity/entityfields/setworkflow/onActionProcess.js @@ -0,0 +1,9 @@ +import("system.neon"); +import("system.vars"); +import("Sql_lib"); + +var emailFilterHandlingIds = JSON.parse(vars.get("$field.EMAILFILTERHANDLING_IDS")) +newWhere("EMAIL_FILTER_HANDLING.EMAIL_FILTER_HANDLINGID",emailFilterHandlingIds).updateFields({"WORKFLOWDEFINITION_KEY":vars.get("$field.WORKFLOWDEFINITION_KEY")}); + +neon.refreshAll(); +neon.closeImage(vars.get("$sys.currentimage"), true); \ No newline at end of file diff --git a/entity/EmailFilterHandlingSetWorkflow_entity/entityfields/setworkflow/tooltipProcess.js b/entity/EmailFilterHandlingSetWorkflow_entity/entityfields/setworkflow/tooltipProcess.js new file mode 100644 index 0000000000000000000000000000000000000000..09ee3d40a5ba9f22557389ff81994154695954d2 --- /dev/null +++ b/entity/EmailFilterHandlingSetWorkflow_entity/entityfields/setworkflow/tooltipProcess.js @@ -0,0 +1,3 @@ +import("system.translate"); +import("system.result"); +result.string(translate.text("Set workflow")); \ No newline at end of file diff --git a/entity/EmailFilterHandling_entity/EmailFilterHandling_entity.aod b/entity/EmailFilterHandling_entity/EmailFilterHandling_entity.aod index cf376f7fd5848f479ca275f75f8c12d0c71597fb..01e2455c2e2d63dcb74e16809d0e34f6a0a9b179 100644 --- a/entity/EmailFilterHandling_entity/EmailFilterHandling_entity.aod +++ b/entity/EmailFilterHandling_entity/EmailFilterHandling_entity.aod @@ -3,6 +3,7 @@ <name>EmailFilterHandling_entity</name> <title>Email Filter</title> <majorModelMode>DISTRIBUTED</majorModelMode> + <documentation>%aditoprj%/entity/EmailFilterHandling_entity/documentation.adoc</documentation> <iconId>VAADIN:INBOX</iconId> <titlePlural>Email Filter</titlePlural> <recordContainer>db</recordContainer> @@ -82,17 +83,6 @@ <entityField> <name>WORKFLOWSIGNAL_NAME</name> <title>Signal</title> - <stateProcess>%aditoprj%/entity/EmailFilterHandling_entity/entityfields/workflowsignal_name/stateProcess.js</stateProcess> - </entityField> - <entityField> - <name>ACTION_TYPE</name> - <title>Action</title> - </entityField> - <entityField> - <name>ISFALLTHROUGH</name> - <title>Continue</title> - <contentType>BOOLEAN</contentType> - <valueProcess>%aditoprj%/entity/EmailFilterHandling_entity/entityfields/isfallthrough/valueProcess.js</valueProcess> </entityField> <entityConsumer> <name>ActionTypeKeyword</name> @@ -108,6 +98,34 @@ </entityParameter> </children> </entityConsumer> + <entityActionGroup> + <name>filterViewActionGroup</name> + <children> + <entityActionField> + <name>increasePriority</name> + <onActionProcess>%aditoprj%/entity/EmailFilterHandling_entity/entityfields/filterviewactiongroup/children/increasepriority/onActionProcess.js</onActionProcess> + <isObjectAction v="false" /> + <iconId>VAADIN:ARROW_UP</iconId> + <stateProcess>%aditoprj%/entity/EmailFilterHandling_entity/entityfields/filterviewactiongroup/children/increasepriority/stateProcess.js</stateProcess> + <tooltipProcess>%aditoprj%/entity/EmailFilterHandling_entity/entityfields/filterviewactiongroup/children/increasepriority/tooltipProcess.js</tooltipProcess> + </entityActionField> + <entityActionField> + <name>decreasePriority</name> + <onActionProcess>%aditoprj%/entity/EmailFilterHandling_entity/entityfields/filterviewactiongroup/children/decreasepriority/onActionProcess.js</onActionProcess> + <isObjectAction v="false" /> + <selectionType>MULTI</selectionType> + <iconId>VAADIN:ARROW_DOWN</iconId> + <stateProcess>%aditoprj%/entity/EmailFilterHandling_entity/entityfields/filterviewactiongroup/children/decreasepriority/stateProcess.js</stateProcess> + <tooltipProcess>%aditoprj%/entity/EmailFilterHandling_entity/entityfields/filterviewactiongroup/children/decreasepriority/tooltipProcess.js</tooltipProcess> + </entityActionField> + <entityActionField> + <name>setWorkflow</name> + <title>Set workflow</title> + <onActionProcess>%aditoprj%/entity/EmailFilterHandling_entity/entityfields/filterviewactiongroup/children/setworkflow/onActionProcess.js</onActionProcess> + <iconId>VAADIN:PLAY</iconId> + </entityActionField> + </children> + </entityActionGroup> <entityField> <name>DATE_NEW</name> <contentType>DATE</contentType> @@ -138,6 +156,7 @@ <dbRecordContainer> <name>db</name> <orderClauseProcess>%aditoprj%/entity/EmailFilterHandling_entity/recordcontainers/db/orderClauseProcess.js</orderClauseProcess> + <onDBDelete>%aditoprj%/entity/EmailFilterHandling_entity/recordcontainers/db/onDBDelete.js</onDBDelete> <alias>Data_alias</alias> <recordFieldMappings> <dbRecordFieldMapping> @@ -175,10 +194,6 @@ <name>PRIORITY.value</name> <recordfield>EMAIL_FILTER_HANDLING.PRIORITY</recordfield> </dbRecordFieldMapping> - <dbRecordFieldMapping> - <name>ISFALLTHROUGH.value</name> - <recordfield>EMAIL_FILTER_HANDLING.ISFALLTHROUGH</recordfield> - </dbRecordFieldMapping> <dbRecordFieldMapping> <name>DESCRIPTION.value</name> <recordfield>EMAIL_FILTER_HANDLING.DESCRIPTION</recordfield> diff --git a/entity/EmailFilterHandling_entity/documentation.adoc b/entity/EmailFilterHandling_entity/documentation.adoc new file mode 100644 index 0000000000000000000000000000000000000000..ce6fc79ad76fc54226ee256dd0f7243e4159e7f5 --- /dev/null +++ b/entity/EmailFilterHandling_entity/documentation.adoc @@ -0,0 +1,3 @@ += EmailFilterHandling_entity + +Entity for the configuring rules related to bulk mails (bounces and blacklists) \ No newline at end of file diff --git a/entity/EmailFilterHandling_entity/entityfields/filterviewactiongroup/children/decreasepriority/onActionProcess.js b/entity/EmailFilterHandling_entity/entityfields/filterviewactiongroup/children/decreasepriority/onActionProcess.js new file mode 100644 index 0000000000000000000000000000000000000000..8935f16e3300da673a4846e6ad072b2dedc94f70 --- /dev/null +++ b/entity/EmailFilterHandling_entity/entityfields/filterviewactiongroup/children/decreasepriority/onActionProcess.js @@ -0,0 +1,8 @@ +import("system.vars"); +import("system.neon"); +import("EmailFilterHandling_lib"); + +EmailFilterHandlingUtils.decreasePriority(vars.get("$field.EMAIL_FILTER_HANDLINGID")) + + +neon.refreshAll(); diff --git a/entity/EmailFilterHandling_entity/entityfields/filterviewactiongroup/children/decreasepriority/stateProcess.js b/entity/EmailFilterHandling_entity/entityfields/filterviewactiongroup/children/decreasepriority/stateProcess.js new file mode 100644 index 0000000000000000000000000000000000000000..d193e77e000172a8dfb33205a319b6fff16c6c43 --- /dev/null +++ b/entity/EmailFilterHandling_entity/entityfields/filterviewactiongroup/children/decreasepriority/stateProcess.js @@ -0,0 +1,18 @@ +import("system.result"); +import("Sql_lib"); +import("system.vars"); +import("system.neon"); + +var priority = parseInt(vars.get("$field.PRIORITY")); + +var maxPriority = newSelect("max(PRIORITY)") + .from("EMAIL_FILTER_HANDLING") + .cell(); +if (priority != maxPriority) +{ + result.string(neon.COMPONENTSTATE_EDITABLE); +} +else +{ + result.string(neon.COMPONENTSTATE_DISABLED); +} \ No newline at end of file diff --git a/entity/EmailFilterHandling_entity/entityfields/filterviewactiongroup/children/decreasepriority/tooltipProcess.js b/entity/EmailFilterHandling_entity/entityfields/filterviewactiongroup/children/decreasepriority/tooltipProcess.js new file mode 100644 index 0000000000000000000000000000000000000000..fa761ad7a600a86d9fc2d5830af05b3a8f7b46dc --- /dev/null +++ b/entity/EmailFilterHandling_entity/entityfields/filterviewactiongroup/children/decreasepriority/tooltipProcess.js @@ -0,0 +1,4 @@ +import("system.translate"); +import("system.result"); + +result.string(translate.text("decrease priority")); \ No newline at end of file diff --git a/entity/EmailFilterHandling_entity/entityfields/filterviewactiongroup/children/increasepriority/onActionProcess.js b/entity/EmailFilterHandling_entity/entityfields/filterviewactiongroup/children/increasepriority/onActionProcess.js new file mode 100644 index 0000000000000000000000000000000000000000..184c94b80f9c5dc6b9a263e86fb69a8495a99baa --- /dev/null +++ b/entity/EmailFilterHandling_entity/entityfields/filterviewactiongroup/children/increasepriority/onActionProcess.js @@ -0,0 +1,8 @@ +import("system.vars"); +import("system.neon"); +import("EmailFilterHandling_lib"); + +EmailFilterHandlingUtils.increasePriority(vars.get("$field.EMAIL_FILTER_HANDLINGID")) + + +neon.refreshAll(); diff --git a/entity/EmailFilterHandling_entity/entityfields/filterviewactiongroup/children/increasepriority/stateProcess.js b/entity/EmailFilterHandling_entity/entityfields/filterviewactiongroup/children/increasepriority/stateProcess.js new file mode 100644 index 0000000000000000000000000000000000000000..feaf9fc2c6832f235d8f3425eb23854ebccb34f3 --- /dev/null +++ b/entity/EmailFilterHandling_entity/entityfields/filterviewactiongroup/children/increasepriority/stateProcess.js @@ -0,0 +1,16 @@ +import("system.result"); +import("Sql_lib"); +import("system.vars"); +import("system.neon"); + +var priority = parseInt(vars.get("$field.PRIORITY")); + + +if (priority != 1) +{ + result.string(neon.COMPONENTSTATE_EDITABLE); +} +else +{ + result.string(neon.COMPONENTSTATE_DISABLED); +} \ No newline at end of file diff --git a/entity/EmailFilterHandling_entity/entityfields/filterviewactiongroup/children/increasepriority/tooltipProcess.js b/entity/EmailFilterHandling_entity/entityfields/filterviewactiongroup/children/increasepriority/tooltipProcess.js new file mode 100644 index 0000000000000000000000000000000000000000..11c260a5944118ddd9cf994f07e7b523614071ca --- /dev/null +++ b/entity/EmailFilterHandling_entity/entityfields/filterviewactiongroup/children/increasepriority/tooltipProcess.js @@ -0,0 +1,4 @@ +import("system.translate"); +import("system.result"); + +result.string(translate.text("increase priority")); \ No newline at end of file diff --git a/entity/EmailFilterHandling_entity/entityfields/filterviewactiongroup/children/setworkflow/onActionProcess.js b/entity/EmailFilterHandling_entity/entityfields/filterviewactiongroup/children/setworkflow/onActionProcess.js new file mode 100644 index 0000000000000000000000000000000000000000..57bfcdde180441256fb21f64682c4d61217894bf --- /dev/null +++ b/entity/EmailFilterHandling_entity/entityfields/filterviewactiongroup/children/setworkflow/onActionProcess.js @@ -0,0 +1,10 @@ +import("system.vars"); +import("system.neon"); + +var selection = JSON.stringify(vars.get("$sys.selection")); +var filter = JSON.stringify(vars.get("$sys.filter")); + + neon.openContext("EmailFilterHandlingSetWorkflow", "EmailFilterHandlingSetWorkflowEdit_view", null, neon.OPERATINGSTATE_VIEW, { + "Selection_param": selection, + "Filter_param": filter + }); \ No newline at end of file diff --git a/entity/EmailFilterHandling_entity/entityfields/priority/valueProcess.js b/entity/EmailFilterHandling_entity/entityfields/priority/valueProcess.js index dfe73fb463cc738c21425b263856cd993e990d30..c18a3ea99cf70cecab437235010259fd99560379 100644 --- a/entity/EmailFilterHandling_entity/entityfields/priority/valueProcess.js +++ b/entity/EmailFilterHandling_entity/entityfields/priority/valueProcess.js @@ -3,12 +3,11 @@ import("Sql_lib"); import("system.neon"); import("system.vars"); -var filterType = vars.get("$field.FILTER_TYPE"); -if (vars.get("$sys.recordstate") == neon.OPERATINGSTATE_NEW && filterType && !vars.get("$this.value")) + +if (vars.get("$sys.recordstate") == neon.OPERATINGSTATE_NEW && !vars.get("$this.value")) { var lastPriority = newSelect("max(PRIORITY)") .from("EMAIL_FILTER_HANDLING") - .where("EMAIL_FILTER_HANDLING.FILTER_TYPE", filterType) .cell(); //no check if value == "" because Number("") === 0 result.string(Number(lastPriority) + 1); diff --git a/entity/EmailFilterHandling_entity/entityfields/workflowsignal_name/stateProcess.js b/entity/EmailFilterHandling_entity/entityfields/workflowsignal_name/stateProcess.js deleted file mode 100644 index a8892ce33aa94fa012dd1c30e32963eae278dbf6..0000000000000000000000000000000000000000 --- a/entity/EmailFilterHandling_entity/entityfields/workflowsignal_name/stateProcess.js +++ /dev/null @@ -1,7 +0,0 @@ -import("system.result"); -import("system.vars"); -import("KeywordRegistry_basic"); -import("system.neon"); - -var actionType = vars.get("$field.ACTION_TYPE"); -result.string(actionType == $KeywordRegistry.weblinkActionType$sendWorkflowSignal() ? neon.COMPONENTSTATE_EDITABLE : neon.COMPONENTSTATE_INVISIBLE); \ No newline at end of file diff --git a/entity/EmailFilterHandling_entity/recordcontainers/db/onDBDelete.js b/entity/EmailFilterHandling_entity/recordcontainers/db/onDBDelete.js new file mode 100644 index 0000000000000000000000000000000000000000..f9936168edc5dccc6e2ffa9fccb22d2df4761fad --- /dev/null +++ b/entity/EmailFilterHandling_entity/recordcontainers/db/onDBDelete.js @@ -0,0 +1,12 @@ +import("EmailFilterHandling_lib"); +import("Sql_lib"); + +newSelect("EMAIL_FILTER_HANDLING.EMAIL_FILTER_HANDLINGID") +.from("EMAIL_FILTER_HANDLING") +.where("EMAIL_FILTER_HANDLING.PRIORITY","$field.PRIORITY",SqlBuilder.GREATER_OR_EQUAL()) +.orderBy("EMAIL_FILTER_HANDLING.PRIORITY asc") +.arrayColumn() +.forEach(function(pEmailFilterHandlingId) + { + EmailFilterHandlingUtils.increasePriority(pEmailFilterHandlingId) + }); \ No newline at end of file diff --git a/language/_____LANGUAGE_EXTRA/_____LANGUAGE_EXTRA.aod b/language/_____LANGUAGE_EXTRA/_____LANGUAGE_EXTRA.aod index 31a9db278e932e6813eeb1e9fe7be639fa32b5cf..86e5ea54d68ec542ac75389ee2a349a10366d492 100644 --- a/language/_____LANGUAGE_EXTRA/_____LANGUAGE_EXTRA.aod +++ b/language/_____LANGUAGE_EXTRA/_____LANGUAGE_EXTRA.aod @@ -9190,6 +9190,21 @@ <entry> <key>Landingpage</key> </entry> + <entry> + <key>Due on</key> + </entry> + <entry> + <key>decrease priority</key> + </entry> + <entry> + <key>Set workflow</key> + </entry> + <entry> + <key>Changed because of mailfilter \"%0\"</key> + </entry> + <entry> + <key>increase Priority</key> + </entry> </keyValueMap> <font name="Dialog" style="0" size="11" /> <sqlModels> diff --git a/language/_____LANGUAGE_de/_____LANGUAGE_de.aod b/language/_____LANGUAGE_de/_____LANGUAGE_de.aod index 5b6c55b4ccf4ccac76bfdb126da3c737a2fdff94..d425bdbf4ecde17202454339da08a47224fb737e 100644 --- a/language/_____LANGUAGE_de/_____LANGUAGE_de.aod +++ b/language/_____LANGUAGE_de/_____LANGUAGE_de.aod @@ -26,6 +26,10 @@ <key>Number of clicks</key> <value>Anzahl Klicks</value> </entry> + <entry> + <key>decrease priority</key> + <value>Priorität verringern</value> + </entry> <entry> <key>Move selection up</key> <value>Auswahl nach oben verschieben</value> @@ -546,6 +550,10 @@ <key>ARCHIVE</key> <value>Archiviert</value> </entry> + <entry> + <key>Changed because of mailfilter \"%0\"</key> + <value>Geändert wegen Mailfilter \"%0\"</value> + </entry> <entry> <key>Maximal</key> <value>Maximal</value> @@ -966,6 +974,10 @@ <key>Email must be unique!</key> <value>Die E-Mail-Adresse muss eindeutig sein!</value> </entry> + <entry> + <key>increase priority</key> + <value>Priorität erhöhen</value> + </entry> <entry> <key>${COUNT_PREPOSITION_SINGLE}</key> <value>mal</value> @@ -2487,6 +2499,10 @@ <key>Edit defaults</key> <value>Standards anpassen</value> </entry> + <entry> + <key>Set workflow</key> + <value>Workflow setzen</value> + </entry> <entry> <key>no valid mail-address format</key> <value>keine gültige E-Mail Adresse</value> @@ -11918,9 +11934,6 @@ Bitte Datumseingabe prüfen</value> <key>The function could not be deleted because it has links to other objects. The status of the function was set to inactive.</key> <value>Die Funktion konnte nicht gelöscht werden, da sie Verknüpfungen zu weiteren Objekten besitzt. Der Status der Funktion wurde auf Inaktiv gesetzt.</value> </entry> - <entry> - <key>set attribute (use filter result)</key> - </entry> <entry> <key>DSGVO - relevant attributes</key> <value>DSGVO - Relevante Eigenschaften</value> diff --git a/language/_____LANGUAGE_en/_____LANGUAGE_en.aod b/language/_____LANGUAGE_en/_____LANGUAGE_en.aod index fb1fc7e2bf63cec250ad78a713db30ba71792bc3..6ec6ebd31445fee5aef7ad0f62c9d097b5e07a3b 100644 --- a/language/_____LANGUAGE_en/_____LANGUAGE_en.aod +++ b/language/_____LANGUAGE_en/_____LANGUAGE_en.aod @@ -9278,6 +9278,21 @@ <entry> <key>Landingpage</key> </entry> + <entry> + <key>Due on</key> + </entry> + <entry> + <key>decrease priority</key> + </entry> + <entry> + <key>Set workflow</key> + </entry> + <entry> + <key>Changed because of mailfilter \"%0\"</key> + </entry> + <entry> + <key>increase Priority</key> + </entry> </keyValueMap> <font name="Dialog" style="0" size="11" /> </language> diff --git a/neonContext/EmailFilterHandlingSetWorkflow/EmailFilterHandlingSetWorkflow.aod b/neonContext/EmailFilterHandlingSetWorkflow/EmailFilterHandlingSetWorkflow.aod new file mode 100644 index 0000000000000000000000000000000000000000..1834537c21f942e9ec8d12f96df7c221b461c34f --- /dev/null +++ b/neonContext/EmailFilterHandlingSetWorkflow/EmailFilterHandlingSetWorkflow.aod @@ -0,0 +1,13 @@ +<?xml version="1.0" encoding="UTF-8"?> +<neonContext xmlns="http://www.adito.de/2018/ao/Model" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" VERSION="1.1.1" xsi:schemaLocation="http://www.adito.de/2018/ao/Model adito://models/xsd/neonContext/1.1.1"> + <name>EmailFilterHandlingSetWorkflow</name> + <majorModelMode>DISTRIBUTED</majorModelMode> + <editView>EmailFilterHandlingSetWorkflowEdit_view</editView> + <entity>EmailFilterHandlingSetWorkflow_entity</entity> + <references> + <neonViewReference> + <name>47e14be3-431d-4ac8-96d1-3a6db3b70605</name> + <view>EmailFilterHandlingSetWorkflowEdit_view</view> + </neonViewReference> + </references> +</neonContext> diff --git a/neonView/CommunicationSettingsEdit_view/CommunicationSettingsEdit_view.aod b/neonView/CommunicationSettingsEdit_view/CommunicationSettingsEdit_view.aod index e617c0d1ac520aa028fd4fd381e784548e7e1e4a..6e211feea953ec80048f4a870c1fb14d8db19de2 100644 --- a/neonView/CommunicationSettingsEdit_view/CommunicationSettingsEdit_view.aod +++ b/neonView/CommunicationSettingsEdit_view/CommunicationSettingsEdit_view.aod @@ -33,6 +33,10 @@ <name>6d34768e-ea37-426b-b1e0-242b0a245c1c</name> <entityField>INFO</entityField> </entityFieldLink> + <entityFieldLink> + <name>49f87db0-d495-45b4-9195-e5336490d230</name> + <entityField>ISACTIVE</entityField> + </entityFieldLink> </fields> </genericViewTemplate> </children> diff --git a/neonView/CommunicationSettingsFilter_view/CommunicationSettingsFilter_view.aod b/neonView/CommunicationSettingsFilter_view/CommunicationSettingsFilter_view.aod index 969334026b5760bd6ccbec315ed7a2033b94f752..7c2518ba09535bc4d3593484be3f90fdb9751e5d 100644 --- a/neonView/CommunicationSettingsFilter_view/CommunicationSettingsFilter_view.aod +++ b/neonView/CommunicationSettingsFilter_view/CommunicationSettingsFilter_view.aod @@ -36,6 +36,10 @@ <name>14c8c930-01ad-4142-bad9-456666317435</name> <entityField>INFO</entityField> </neonTreeTableColumn> + <neonTreeTableColumn> + <name>ef35df7d-c617-4882-b898-4a57131167d7</name> + <entityField>ISACTIVE</entityField> + </neonTreeTableColumn> </columns> </treeTableViewTemplate> </children> diff --git a/neonView/EmailFilterHandlingFilter_view/EmailFilterHandlingFilter_view.aod b/neonView/EmailFilterHandlingFilter_view/EmailFilterHandlingFilter_view.aod index 307b0c8ccd1079e250b282ac6e02ef2e8a365449..d055d48f92a531ef8548ad756eec9983b2d92c2f 100644 --- a/neonView/EmailFilterHandlingFilter_view/EmailFilterHandlingFilter_view.aod +++ b/neonView/EmailFilterHandlingFilter_view/EmailFilterHandlingFilter_view.aod @@ -12,6 +12,7 @@ <tableViewTemplate> <name>Table</name> <entityField>#ENTITY</entityField> + <favoriteActionGroup1>filterViewActionGroup</favoriteActionGroup1> <linkedColumns> <element>TITLE</element> </linkedColumns> @@ -24,6 +25,14 @@ <name>9f23688c-26e4-494c-9637-f2641a792339</name> <entityField>FILTER_TYPE</entityField> </neonTableColumn> + <neonTableColumn> + <name>c731ae60-85f6-4108-94da-68209d552b88</name> + <entityField>ISACTIVE</entityField> + </neonTableColumn> + <neonTableColumn> + <name>0a00d684-4d8b-4336-b998-73ccacb97f45</name> + <entityField>PRIORITY</entityField> + </neonTableColumn> <neonTableColumn> <name>6638b293-f15e-4d33-a9d9-1628e185ac0f</name> <entityField>WORKFLOWDEFINITION_KEY</entityField> diff --git a/neonView/EmailFilterHandlingPreview_view/EmailFilterHandlingPreview_view.aod b/neonView/EmailFilterHandlingPreview_view/EmailFilterHandlingPreview_view.aod index 11d730a4ab6604c87094d7578136a707ce299fff..993d1862da415bbf57a9b99e16fde8f5cd7101e8 100644 --- a/neonView/EmailFilterHandlingPreview_view/EmailFilterHandlingPreview_view.aod +++ b/neonView/EmailFilterHandlingPreview_view/EmailFilterHandlingPreview_view.aod @@ -23,14 +23,6 @@ <name>a71ac88f-f0c3-4de7-9d1f-a989212bed71</name> <entityField>ISACTIVE</entityField> </entityFieldLink> - <entityFieldLink> - <name>6cbad6d9-8434-4328-8d82-6010240a5a7f</name> - <entityField>ISFALLTHROUGH</entityField> - </entityFieldLink> - <entityFieldLink> - <name>2adc5e19-553a-41e6-8bd0-40e3b7fc98f6</name> - <entityField>ACTION_TYPE</entityField> - </entityFieldLink> <entityFieldLink> <name>560c1795-60ff-4ea6-b17b-19f49610bc8f</name> <entityField>WORKFLOWDEFINITION_KEY</entityField> diff --git a/neonView/EmailFilterHandlingSetWorkflowEdit_view/EmailFilterHandlingSetWorkflowEdit_view.aod b/neonView/EmailFilterHandlingSetWorkflowEdit_view/EmailFilterHandlingSetWorkflowEdit_view.aod new file mode 100644 index 0000000000000000000000000000000000000000..fa613d827283a60287ecaf90ab6c745569c16bd0 --- /dev/null +++ b/neonView/EmailFilterHandlingSetWorkflowEdit_view/EmailFilterHandlingSetWorkflowEdit_view.aod @@ -0,0 +1,30 @@ +<?xml version="1.0" encoding="UTF-8"?> +<neonView xmlns="http://www.adito.de/2018/ao/Model" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" VERSION="1.1.8" xsi:schemaLocation="http://www.adito.de/2018/ao/Model adito://models/xsd/neonView/1.1.8"> + <name>EmailFilterHandlingSetWorkflowEdit_view</name> + <majorModelMode>DISTRIBUTED</majorModelMode> + <size>SMALL</size> + <layout> + <headerFooterLayout> + <name>layout</name> + </headerFooterLayout> + </layout> + <children> + <genericViewTemplate> + <name>generic</name> + <editMode v="true" /> + <hideEmptyFields v="false" /> + <fields> + <entityFieldLink> + <name>326601ea-ff15-44b9-ab42-b4655625083e</name> + <entityField>WORKFLOWDEFINITION_KEY</entityField> + </entityFieldLink> + </fields> + </genericViewTemplate> + <actionsViewTemplate> + <name>actions</name> + <actions> + <element>SetWorkflow</element> + </actions> + </actionsViewTemplate> + </children> +</neonView> diff --git a/preferences/_____PREFERENCES_PROJECT/_____PREFERENCES_PROJECT.aod b/preferences/_____PREFERENCES_PROJECT/_____PREFERENCES_PROJECT.aod index 373d655f28ec9048982adfd44d59c465f5ecf024..bb37d522905059e84bc0abb80decff1920129d44 100644 --- a/preferences/_____PREFERENCES_PROJECT/_____PREFERENCES_PROJECT.aod +++ b/preferences/_____PREFERENCES_PROJECT/_____PREFERENCES_PROJECT.aod @@ -204,7 +204,6 @@ <customStringProperty> <name>mosaico.url</name> <description>Url of the Mosaico Email Editor</description> - <property></property> </customStringProperty> </customProperties> </preferences> diff --git a/process/BulkmailAnalysis_lib/process.js b/process/BulkmailAnalysis_lib/process.js index 6077fbb5e0119cee32fa70d3de2492baef0ace63..c6ab18a3a11dac3a413a80b5a92be7fa23c00644 100644 --- a/process/BulkmailAnalysis_lib/process.js +++ b/process/BulkmailAnalysis_lib/process.js @@ -81,6 +81,7 @@ BulkMailAnalysisSql.prototype.buildSelect = function() .where("WEBLINK.PLACEHOLDER","pixel") ,SqlBuilder.NOT_EQUAL()) ) + .leftJoin("MAIL_BOUNCE","MAIL_BOUNCE.MAIL_LOG_ID = MAIL_LOG.MAIL_LOGID") .where("MAIL_RUN.OBJECT_TYPE","bulkmail"); if (this._selects) @@ -117,9 +118,9 @@ BulkMailAnalysisSql.countSelects = CLICKCOUNT:"count(distinct WEBLINK_CLICK.WEBLINK_CLICKID)", UNIQUECLICKCOUNT:"count(distinct WEBLINK_CLICK.MAIL_LOG_ID)", OPENERCOUNT:"count(distinct MAIL_LOG.OPENER_LINK_CLICK_ID)", - BOUNCECOUNT:"count (distinct case when MAIL_LOG.STATUS in ('"+$KeywordRegistry.bulkMailRecipientStatus$softBounce()+"','"+$KeywordRegistry.bulkMailRecipientStatus$hardBounce()+"') then MAIL_LOG.MAIL_LOGID else null end)", - SOFTBOUNCECOUNT:"count (distinct case when MAIL_LOG.STATUS ='"+$KeywordRegistry.bulkMailRecipientStatus$softBounce()+"' then MAIL_LOG.MAIL_LOGID else null end)", - HARDBOUNCECOUNT:"count (distinct case when MAIL_LOG.STATUS ='"+$KeywordRegistry.bulkMailRecipientStatus$hardBounce()+"' then MAIL_LOG.MAIL_LOGID else null end)", + BOUNCECOUNT:"count (distinct case when MAIL_BOUNCE.CATEGORY in ('"+$KeywordRegistry.emailFilterType$bounceSoft()+"','"+$KeywordRegistry.emailFilterType$bounceHard()+"') then MAIL_BOUNCE.MAIL_LOG_ID else null end)", + SOFTBOUNCECOUNT:"count (distinct case when MAIL_BOUNCE.CATEGORY ='"+$KeywordRegistry.emailFilterType$bounceSoft()+"' then MAIL_BOUNCE.MAIL_LOG_ID else null end)", + HARDBOUNCECOUNT:"count (distinct case when MAIL_BOUNCE.CATEGORY ='"+$KeywordRegistry.emailFilterType$bounceHard()+"' then MAIL_BOUNCE.MAIL_LOG_ID else null end)", SENDCOUNT:"count (distinct MAIL_LOG.MAIL_LOGID)", RECEIVEDCOUNT:"count (distinct case when MAIL_LOG.STATUS='"+$KeywordRegistry.bulkMailRecipientStatus$sent()+"' then MAIL_LOG.MAIL_LOGID else null end)", UNSUBSCRIBECOUNT:"count (distinct case when WEBLINK_CLICK.WEBLINK_ID = '"+newSelect(["WEBLINK.WEBLINKID"]).from("WEBLINK").where("WEBLINK.PLACEHOLDER","rejectEmail").cell()+"' then WEBLINK_CLICK.MAIL_LOG_ID else null end)" diff --git a/process/Bulkmail_lib/process.js b/process/Bulkmail_lib/process.js index d6ecc5e3d93f4e88b0dc0f8c011c367ddb05e095..36dde36169bb20e24e05d621be21e8ae0e7f9b43 100644 --- a/process/Bulkmail_lib/process.js +++ b/process/Bulkmail_lib/process.js @@ -223,7 +223,7 @@ BulkMailUtils.sendBulkMail = function (pBulkMailId, pIsTestRun) //TODO: Klären was von alter Logik noch bleiben soll. Status macht nur Sinn wenn jede Bulkmail nur einmal gesendet wird. Bleiben Activitys? if (isSuccess) { - sucessIds.push(recipientId); + successIds.push(recipientId); } else if (bouncedStatus == $KeywordRegistry.bulkMailRecipientStatus$softBounce()) { @@ -617,6 +617,22 @@ BulkMailUtils.storeEmlFile = function (pBulkMailId, pMailRunId, pMailLogId, pFil fileIO.storeData(fullPath, pFile, util.DATA_BINARY, false); } +/* + * Stores the eml file of a bounce in the filesystem + * + * @param {String} pBounceId <p> + * The id of the bounce.<br> + * @param {String} pFile + **/ +BulkMailUtils.storeBounceEmlFile = function (pBounceId, pFile) +{ + var locationoption = project.getPreferenceValue("bulkmail.fileStorage", "/bulkMailFiles/"); + var path = vars.get("$sys.serverdata") + locationoption + "Bounces/"; + var filename = pBounceId + ".eml" + var fullPath = path + filename; + fileIO.storeData(fullPath, pFile, util.DATA_TEXT, false); +} + /* *Loads the Eml file for a bulkmailrecipient from the Filesystem * diff --git a/process/Contact_lib/process.js b/process/Contact_lib/process.js index 680fa7a6fa9650d04592b12329701c426f1f14b7..b6677f48572f0d056e8bd596538cbc5b07d6be57 100644 --- a/process/Contact_lib/process.js +++ b/process/Contact_lib/process.js @@ -582,6 +582,7 @@ ContactUtils.getCommRestrictionCondition = function (pMedium, pNoRestriction, pS .where(newWhereIfSet("COMMUNICATIONSETTINGS.MEDIUM", pMedium) .or("COMMUNICATIONSETTINGS.CHANNEL_TYPE", $KeywordRegistry.communicationChannelType$global())) .and("COMMUNICATIONSETTINGS.STATUS", $KeywordRegistry.communicationSettingStatus$rejected()) + .and("COMMUNICATIONSETTINGS.ISACTIVE",1) .and(newWhere() // check contactid .or("COMMUNICATIONSETTINGS.CONTACT_ID = CONTACT.CONTACTID") @@ -637,6 +638,7 @@ ContactUtils.getCommunicationRejectionSummary = function (pContactId) var communicationRejections = newSelect(["CHANNEL_TYPE", "MEDIUM", mediumTitleSql]) .from("COMMUNICATIONSETTINGS") .where("COMMUNICATIONSETTINGS.CONTACT_ID", pContactId) + .and("COMMUNICATIONSETTINGS.ISACTIVE",1) .and("COMMUNICATIONSETTINGS.CHANNEL_TYPE", $KeywordRegistry.communicationChannelType$profiling(), SqlBuilder.NOT_EQUAL()) .and("COMMUNICATIONSETTINGS.STATUS", $KeywordRegistry.communicationSettingStatus$rejected()) .orderBy(mediumTitleSql) diff --git a/process/EmailFilterHandling_lib/process.js b/process/EmailFilterHandling_lib/process.js index c1a75508a4b70af4180413a95c1c34c10c153353..156337cb248ad8e26698309f16ad387d86c62fd1 100644 --- a/process/EmailFilterHandling_lib/process.js +++ b/process/EmailFilterHandling_lib/process.js @@ -1,9 +1,13 @@ +import("system.translate"); +import("EmailUtil_lib"); +import("system.vars"); import("system.workflow"); import("system.util"); import("KeywordRegistry_basic"); import("JditoFilter_lib"); import("Sql_lib"); import("system.mail"); +import("Bulkmail_lib"); /** * The IncomingEmailFilterProcessor contains multiple email filters that can be evaluated. @@ -15,17 +19,18 @@ function IncomingEmailFilterProcessor () IncomingEmailFilterProcessor.prototype.loadFilters = function () { - var bounceFilters = newSelect(["TITLE", "FILTER_TYPE", "FILTER", "WORKFLOWDEFINITION_KEY"]) + var bounceFilters = newSelect(["EMAIL_FILTER_HANDLINGID","TITLE", "FILTER_TYPE", "FILTER", "WORKFLOWDEFINITION_KEY"]) .from("EMAIL_FILTER_HANDLING") .where("EMAIL_FILTER_HANDLING.ISACTIVE", "1") .and(newWhere("EMAIL_FILTER_HANDLING.FILTER_TYPE", $KeywordRegistry.emailFilterType$bounceSoft()) - .or("EMAIL_FILTER_HANDLING.FILTER_TYPE", $KeywordRegistry.emailFilterType$bounceHard())) + .or("EMAIL_FILTER_HANDLING.FILTER_TYPE", $KeywordRegistry.emailFilterType$bounceHard()) + .or("EMAIL_FILTER_HANDLING.FILTER_TYPE", $KeywordRegistry.emailFilterType$autoResponder())) .orderBy("PRIORITY asc") .table(); - this.emailFilters = bounceFilters.map(function ([title, type, filterJson, workflowKey]) + this.emailFilters = bounceFilters.map(function ([id, title, type, filterJson, workflowKey]) { - return new IncomingEmailFilter(title, type, filterJson, workflowKey); + return new IncomingEmailFilter(id, title, type, filterJson, workflowKey); }); return this; } @@ -35,52 +40,111 @@ IncomingEmailFilterProcessor.prototype.loadFilters = function () */ IncomingEmailFilterProcessor.prototype.process = function (pEmail) { - var mailLogId = this.checkBodyForMailLogId(pEmail); + + + + var [mailLogId, recipientMailAddress, contactId] = this.checkBodyForIds(pEmail); + + var bounceId = util.getNewUUID(); + var emailFilterHandlingId; + + BulkMailUtils.storeBounceEmlFile(bounceId,mail.resolveMailAsRFC(vars.getString("$local.mail"))); var bouncedStatus = null; - this.emailFilters.forEach(function (emailFilter) + this.emailFilters.some(function (emailFilter) { if (emailFilter.checkEmail(pEmail)) { - if(mailLogId) + if(contactId && recipientMailAddress) { - var contactId = newSelect("CONTACT_ID") - .from("MAIL_LOG") - .where("MAIL_LOG.MAIL_LOGID", mailLogId) - .cell(); - - var recipientEmail = newSelect("RECIPIENT_EMAIL") - .from("MAIL_LOG") - .where("MAIL_LOG.MAIL_LOGID", mailLogId) - .cell(); - - emailFilter.startWorkflow(contactId,recipientEmail); + emailFilter.startWorkflow(contactId, recipientMailAddress); } - + + emailFilterHandlingId = emailFilter.mailFilterId; bouncedStatus = emailFilter.type; + return true; } + return false; }); - if(bouncedStatus && mailLogId) - { - this.updateMailLog(bouncedStatus, mailLogId); - } + + //we need at least a contactid to log a meaningful bounce + + this.insertBounce(bounceId, bouncedStatus, mailLogId, recipientMailAddress, contactId, emailFilterHandlingId); + return bouncedStatus; } /* *Checks the Email for a maillogid to document the possible bounce */ -IncomingEmailFilterProcessor.prototype.checkBodyForMailLogId = function (pEmail) +IncomingEmailFilterProcessor.prototype.checkBodyForIds = function (pEmail) { - var body = pEmail[mail.MAIL_TEXT]; - + var body = pEmail[mail.MAIL_HTMLTEXT] || pEmail[mail.MAIL_TEXT]; + var mailLogId; + var mailAddress; + var contactId; + var bounceSubject; + //first check if the mailbody includes the maillogid var mailLogMatch = body.match(/log=([0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12})/); - - return mailLogMatch?mailLogMatch[1]:null; + + if (!mailLogMatch) + { + //check for Subject (regex :/subject: Zeile?/) + var bounceSubjectMatch = pEmail[mail.MAIL_TEXT].match( new RegExp( /Subject: (.*?)(?:\n|\r)/)); + //search for mail_address: to: (regex: /To: mailregex/) + var mailAddressMatch = pEmail[mail.MAIL_TEXT].match( new RegExp(/(?:To:|An:|to) <?"?<?((?:[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*|"(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21\x23-\x5b\x5d-\x7f]|\\[\x01-\x09\x0b\x0c\x0e-\x7f])*")@(?:(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?|\[(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?|[a-z0-9-]*[a-z0-9]:(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21-\x5a\x53-\x7f]|\\[\x01-\x09\x0b\x0c\x0e-\x7f])+)\]))/)); + + + if (bounceSubjectMatch) + bounceSubject = bounceSubjectMatch[1]; + if (mailAddressMatch) + mailAddress = mailAddressMatch[1]; + else //take sender address from email if it was not found in the technichal part of a bounce message + mailAddress = EmailUtils.extractAddress(pEmail[mail.MAIL_SENDER]); + //search for last mailing with matching subject in mail_log + if (bounceSubject && mailAddress) + { + [mailLogId,contactId] = newSelect(["MAIL_LOG.MAIL_LOGID", "MAIL_LOG.CONTACT_ID"]) + .from("MAIL_LOG") + .where("MAIL_LOG.MAILING_SUBJECT",bounceSubject) + .and("MAIL_LOG.RECIPIENT_EMAIL",mailAddress) + .orderBy("MAIL_LOG.DATE_SEND desc") + .arrayRow(); + } + //if nothing was found search for last mailing with matching recipient in mail_log + if (!mailLogId && mailAddress) + { + + [mailLogId,contactId] = newSelect(["MAIL_LOG.MAIL_LOGID", "MAIL_LOG.CONTACT_ID"]) + .from("MAIL_LOG") + .where("MAIL_LOG.RECIPIENT_EMAIL",mailAddress) + .orderBy("MAIL_LOG.DATE_SEND desc") + .arrayRow(); + } + + //if no maillog was found at least match the mailaddress to a contact + if(!mailLogId && mailAddress) + { + contactId = newSelect("COMMUNICATION.CONTACT_ID") + .from("COMMUNICATION") + .where("COMMUNICATION.ADDR",mailAddress) + .cell() + } + + } + else + { + mailLogId = mailLogMatch[1]; + [mailAddress,contactId] = newSelect(["MAIL_LOG.RECIPIENT_EMAIL", "MAIL_LOG.CONTACT_ID"]) + .from("MAIL_LOG") + .where("MAIL_LOG.MAIL_LOGID",mailLogId) + .arrayRow(); + } + return [mailLogId,mailAddress,contactId]; } /* *Updates the matched maillog entry to document the bounce **/ -IncomingEmailFilterProcessor.prototype.updateMailLog = function (pBounceType, pMailLogId) +IncomingEmailFilterProcessor.prototype.insertBounce = function (pBounceId, pBounceType, pMailLogId, pMailAddress, pContactId, pEmailFilterHandlingId) { var recipientStatus; switch(pBounceType) @@ -92,8 +156,20 @@ IncomingEmailFilterProcessor.prototype.updateMailLog = function (pBounceType, pM recipientStatus= $KeywordRegistry.bulkMailRecipientStatus$softBounce(); break; } - - newWhere("MAIL_LOG.MAIL_LOGID", pMailLogId).updateFields({"STATUS":recipientStatus}); + + new SqlBuilder() + .tableName("MAIL_BOUNCE") + .insertFields({ + "MAIL_BOUNCEID": pBounceId, + "MAIL_LOG_ID": pMailLogId, + "CONTACT_ID": pContactId, + "CATEGORY": pBounceType, + "RECIPIENT_EMAIL": pMailAddress, + "EMAIL_FILTER_HANDLING_ID": pEmailFilterHandlingId, + "DATE_BOUNCE": vars.get("$sys.date") + }); + if(pMailLogId && recipientStatus) + newWhere("MAIL_LOG.MAIL_LOGID", pMailLogId).updateFields({"STATUS":recipientStatus}); } IncomingEmailFilterProcessor.prototype.processError = function (pErrorMessage, pContactId, pEmailAddress) @@ -113,8 +189,9 @@ IncomingEmailFilterProcessor.prototype.processError = function (pErrorMessage, p /** * Object representing a single email filter that can check an email and execute a workflow. */ -function IncomingEmailFilter (pTitle, pType, pFilterJson, pWorkflowKey) +function IncomingEmailFilter (pId, pTitle, pType, pFilterJson, pWorkflowKey) { + this.mailFilterId = pId this.title = pTitle; this.type = pType; this.filter = new JditoFilter() @@ -178,8 +255,11 @@ IncomingEmailFilter.prototype.startWorkflow = function (pContactId, pEmailAddres { if (this.workflowKey) { + var infotext = translate.withArguments("Changed because of mailfilter \"%0\"",[this.title]); workflow.startProcessByKey(this.workflowKey, { - contactId: pContactId, + targetContext:"Contact", + targetId: pContactId, + infoText: infotext.toString(), emailAddress: pEmailAddress, channelType: $KeywordRegistry.communicationChannelType$communication(), medium: $KeywordRegistry.communicationMediumCampaign$mail() @@ -187,4 +267,53 @@ IncomingEmailFilter.prototype.startWorkflow = function (pContactId, pEmailAddres } } +/** + * Functions for EmailFilterHandling. + */ +function EmailFilterHandlingUtils () {} + + +/* + * Swaps the Priority of a mailfilter with the one above it + * + * @param {String} pEmailFilterHandlingId EmailFilterHandlingId of the mailfilter that should be moved up + */ +EmailFilterHandlingUtils.increasePriority = function(pEmailFilterHandlingId) +{ + var priority = newSelect(["EMAIL_FILTER_HANDLING.PRIORITY"]) + .from("EMAIL_FILTER_HANDLING") + .where("EMAIL_FILTER_HANDLING.EMAIL_FILTER_HANDLINGID",pEmailFilterHandlingId) + .cell(); + + priority = parseInt(priority); + + + newWhere("EMAIL_FILTER_HANDLING.PRIORITY",priority-1) + .updateFields({"PRIORITY":priority}); + + newWhere("EMAIL_FILTER_HANDLING.EMAIL_FILTER_HANDLINGID",pEmailFilterHandlingId) + .updateFields({"PRIORITY":priority-1}); +} + +/* + * Swaps the priority of a mailfilter with the one below it + * + * @param {String} pEmailFilterHandlingId EmailFilterHandlingId of the mailfilter that should be moved down + */ +EmailFilterHandlingUtils.decreasePriority = function(pEmailFilterHandlingId) +{ + var priority = newSelect(["EMAIL_FILTER_HANDLING.PRIORITY"]) + .from("EMAIL_FILTER_HANDLING") + .where("EMAIL_FILTER_HANDLING.EMAIL_FILTER_HANDLINGID",pEmailFilterHandlingId) + .cell(); + + priority = parseInt(priority); + + + newWhere("EMAIL_FILTER_HANDLING.PRIORITY",priority+1) + .updateFields({"PRIORITY":priority}); + + newWhere("EMAIL_FILTER_HANDLING.EMAIL_FILTER_HANDLINGID",pEmailFilterHandlingId) + .updateFields({"PRIORITY":priority+1}); +} diff --git a/process/KeywordRegistry_basic/process.js b/process/KeywordRegistry_basic/process.js index 26b18d42c1827d1c2ca75e9a745fbd4fb74b060f..1b1d3fedc64e9b914022092293873d3ad01a8a43 100644 --- a/process/KeywordRegistry_basic/process.js +++ b/process/KeywordRegistry_basic/process.js @@ -432,4 +432,5 @@ $KeywordRegistry.advertisingDelivery$mail = function(){return "ADVERTDELIVERYMAI $KeywordRegistry.emailFilterType = function(){return "EmailFilterType";}; $KeywordRegistry.emailFilterType$blacklist = function(){return "EMAIL_FILTER_BLACKLIST";}; $KeywordRegistry.emailFilterType$bounceSoft = function(){return "EMAIL_FILTER_BOUNCESOFT";}; -$KeywordRegistry.emailFilterType$bounceHard = function(){return "EMAIL_FILTER_BOUNCEHARD";}; \ No newline at end of file +$KeywordRegistry.emailFilterType$bounceHard = function(){return "EMAIL_FILTER_BOUNCEHARD";}; +$KeywordRegistry.emailFilterType$autoResponder = function(){return "EMAIL_FILTER_AUTORESPONDER";}; diff --git a/process/MarketingCondition_lib/process.js b/process/MarketingCondition_lib/process.js index 2a2e22e6ca05668d5031a587e0786327db73dc6c..2b9d802931095e92f14fdebcb2ce036c2a559179 100644 --- a/process/MarketingCondition_lib/process.js +++ b/process/MarketingCondition_lib/process.js @@ -181,7 +181,8 @@ CommunicationSettingsCondition.prototype.buildSelect = function (pSelectFields) pSelectFields = "COMMUNICATIONSETTINGS.COMMUNICATIONSETTINGSID"; var sql = newSelect(pSelectFields) .from("COMMUNICATIONSETTINGS") - .whereIfSet("COMMUNICATIONSETTINGS.STATUS", this._settingStatus); + .whereIfSet("COMMUNICATIONSETTINGS.STATUS", this._settingStatus) + .and("COMMUNICATIONSETTINGS.ISACTIVE",1); if (this._contactIdSql) { diff --git a/process/SetCommunicationSetting_workflowService/process.js b/process/SetCommunicationSetting_workflowService/process.js index dccc2bf4d424365db18f72e4e41a1d87e0be68f5..29a6afc8889750223081c889716911b068c12969 100644 --- a/process/SetCommunicationSetting_workflowService/process.js +++ b/process/SetCommunicationSetting_workflowService/process.js @@ -8,12 +8,15 @@ var contactId = variables.contactId || variables.targetId; var channelType = variables.channelType; var medium = variables.medium || ""; var channelId = variables.channelId || ""; +var infoText = variables.infoText || ""; var status = variables.status || $KeywordRegistry.communicationSettingStatus$rejected(); + var settingsIdSql = newSelect("COMMUNICATIONSETTINGSID") .from("COMMUNICATIONSETTINGS") .where("COMMUNICATIONSETTINGS.CONTACT_ID", contactId) - .and("COMMUNICATIONSETTINGS.CHANNEL_TYPE", channelType); + .and("COMMUNICATIONSETTINGS.CHANNEL_TYPE", channelType) + .and("COMMUNICATIONSETTINGS.ISACTIVE",1); if (medium) { @@ -33,26 +36,32 @@ else } var settingsId = settingsIdSql.cell(); +var currentDate = vars.get("$sys.date"); + if (settingsId) { newWhere("COMMUNICATIONSETTINGS.COMMUNICATIONSETTINGSID", settingsId) - .updateFields({"STATUS": status}); + .updateFields({ + "ISACTIVE": 0, + "DATE_EDIT": currentDate, + "USER_EDIT": "workflow"}); } -else + { - var currentDate = vars.get("$sys.date"); + settingsId = util.getNewUUID(); new SqlBuilder() .tableName("COMMUNICATIONSETTINGS") .insertFields({ - "CONTACT_ID":contactId, + "CONTACT_ID": contactId, "COMMUNICATIONSETTINGSID": settingsId, "CHANNEL_TYPE": channelType, "CHANNEL_ID": channelId, "MEDIUM": medium, "STATUS": status, - "USER_NEW":"workflow", - "DATE_NEW":currentDate + "USER_NEW": "workflow", + "DATE_NEW": currentDate, + "ISACTIVE": 1 }); new SqlBuilder() .tableName("COMMUNICATIONLEGALBASE") @@ -60,7 +69,8 @@ else "COMMUNICATIONLEGALBASEID": util.getNewUUID(), "COMMUNICATIONSETTINGS_ID": settingsId, "VERSION": 1, - "USER_NEW":"workflow", - "DATE_NEW":currentDate + "INFO": infoText, + "USER_NEW": "workflow", + "DATE_NEW": currentDate }); } \ No newline at end of file