From 0c8fbd218cf68200aadae564b790928b1e65daf2 Mon Sep 17 00:00:00 2001 From: Tim Otten Date: Fri, 19 May 2023 02:29:16 -0700 Subject: [PATCH] (REF) civicrm_data - Extract civicrm_mailing_bounce_type and civicrm_mailing_bounce_pattern --- CRM/Core/CodeGen/BounceType.php | 63 ++++ .../AOL.sqldata.php | 9 + .../Away.sqldata.php | 10 + .../Dns.sqldata.php | 13 + .../Host.sqldata.php | 29 ++ .../Inactive.sqldata.php | 30 ++ .../Invalid.sqldata.php | 65 +++++ .../Loop.sqldata.php | 14 + .../Quota.sqldata.php | 25 ++ .../Relay.sqldata.php | 22 ++ .../Spam.sqldata.php | 39 +++ .../Syntax.sqldata.php | 11 + xml/templates/civicrm_data.tpl | 274 +----------------- 13 files changed, 341 insertions(+), 263 deletions(-) create mode 100644 CRM/Core/CodeGen/BounceType.php create mode 100644 sql/civicrm_data/civicrm_mailing_bounce_type/AOL.sqldata.php create mode 100644 sql/civicrm_data/civicrm_mailing_bounce_type/Away.sqldata.php create mode 100644 sql/civicrm_data/civicrm_mailing_bounce_type/Dns.sqldata.php create mode 100644 sql/civicrm_data/civicrm_mailing_bounce_type/Host.sqldata.php create mode 100644 sql/civicrm_data/civicrm_mailing_bounce_type/Inactive.sqldata.php create mode 100644 sql/civicrm_data/civicrm_mailing_bounce_type/Invalid.sqldata.php create mode 100644 sql/civicrm_data/civicrm_mailing_bounce_type/Loop.sqldata.php create mode 100644 sql/civicrm_data/civicrm_mailing_bounce_type/Quota.sqldata.php create mode 100644 sql/civicrm_data/civicrm_mailing_bounce_type/Relay.sqldata.php create mode 100644 sql/civicrm_data/civicrm_mailing_bounce_type/Spam.sqldata.php create mode 100644 sql/civicrm_data/civicrm_mailing_bounce_type/Syntax.sqldata.php diff --git a/CRM/Core/CodeGen/BounceType.php b/CRM/Core/CodeGen/BounceType.php new file mode 100644 index 0000000000..64f342cbe3 --- /dev/null +++ b/CRM/Core/CodeGen/BounceType.php @@ -0,0 +1,63 @@ +metadata['name'] = $name; + $og->var = '@bounceTypeID'; + return $og; + } + + /** + * @param array $fields + * List of BounceType fields/values. + * Ex: ['is_reserved' => 0, 'description' => 'Store the stuff'] + * @return $this + */ + public function addMetadata(array $fields): CRM_Core_CodeGen_BounceType { + $this->metadata = array_merge($this->metadata, $fields); + return $this; + } + + public function toArray(): array { + $result = []; + foreach ($this->rows as $row) { + $row = $this->applySyncRules($row); + $result[] = array_merge(['bounce_type_id' => new CRM_Utils_SQL_Literal($this->var)], $this->defaults, $row); + } + return $result; + } + + public function toSQL(): string { + $result = ''; + $result .= CRM_Utils_SQL_Insert::into('civicrm_mailing_bounce_type') + ->row($this->metadata) + ->toSQL() . ";\n"; + + $rows = $this->toArray(); + if ($rows) { + $result .= CRM_Utils_SQL_Select::from('civicrm_mailing_bounce_type') + ->select("{$this->var} := max(id)") + ->where('name = @NAME', ['NAME' => $this->metadata['name']]) + ->toSQL() . ";\n"; + + $result .= CRM_Utils_SQL_Insert::into('civicrm_mailing_bounce_pattern') + ->allowLiterals() + ->rows($rows) + ->toSQL() . ";\n"; + } + return $result; + } + +} diff --git a/sql/civicrm_data/civicrm_mailing_bounce_type/AOL.sqldata.php b/sql/civicrm_data/civicrm_mailing_bounce_type/AOL.sqldata.php new file mode 100644 index 0000000000..c22d64b265 --- /dev/null +++ b/sql/civicrm_data/civicrm_mailing_bounce_type/AOL.sqldata.php @@ -0,0 +1,9 @@ +addMetadata([ + 'description' => ts('AOL Terms of Service complaint'), + 'hold_threshold' => 1, + ]) + ->addValueTable(['pattern'], [ + ['Client TOS Notification'], + ]); diff --git a/sql/civicrm_data/civicrm_mailing_bounce_type/Away.sqldata.php b/sql/civicrm_data/civicrm_mailing_bounce_type/Away.sqldata.php new file mode 100644 index 0000000000..8e508635bc --- /dev/null +++ b/sql/civicrm_data/civicrm_mailing_bounce_type/Away.sqldata.php @@ -0,0 +1,10 @@ +addMetadata([ + 'description' => ts('Recipient is on vacation'), + 'hold_threshold' => 30, + ]) + ->addValueTable(['pattern'], [ + ['(be|am)? (out of|away from) (the|my)? (office|computer|town)'], + ['i am on vacation'], + ]); diff --git a/sql/civicrm_data/civicrm_mailing_bounce_type/Dns.sqldata.php b/sql/civicrm_data/civicrm_mailing_bounce_type/Dns.sqldata.php new file mode 100644 index 0000000000..1bdb64d40b --- /dev/null +++ b/sql/civicrm_data/civicrm_mailing_bounce_type/Dns.sqldata.php @@ -0,0 +1,13 @@ +addMetadata([ + 'description' => ts('Unable to resolve recipient domain'), + 'hold_threshold' => 3, + ]) + ->addValueTable(['pattern'], [ + ['name(server entry| lookup failure)'], + ['no (mail server|matches to nameserver query|dns entries)'], + ['reverse dns entry'], + ['Host or domain name not found'], + ['Unable to resolve MX record for'], + ]); diff --git a/sql/civicrm_data/civicrm_mailing_bounce_type/Host.sqldata.php b/sql/civicrm_data/civicrm_mailing_bounce_type/Host.sqldata.php new file mode 100644 index 0000000000..916cefc7e2 --- /dev/null +++ b/sql/civicrm_data/civicrm_mailing_bounce_type/Host.sqldata.php @@ -0,0 +1,29 @@ +addMetadata([ + // FIXME: Typo + 'description' => ts('Unable to deliver to destintation mail server'), + // 'description' => ts('Unable to deliver to destination mail server'), + 'hold_threshold' => 3, + ]) + ->addValueTable(['pattern'], [ + ['(unknown|not local) host'], + ['all hosts have been failing'], + ['allowed rcpthosts'], + ['connection (refused|timed out)'], + ['not connected'], + ['couldn\'t find any host named'], + ['error involving remote host'], + ['host unknown'], + ['invalid host name'], + ['isn\'t in my control/locals file'], + ['local configuration error'], + ['not a gateway'], + ['server is (down or unreachable|not responding)'], + ['too many connections'], + ['unable to connect'], + ['lost connection'], + ['conversation with [^ ]* timed out while'], + ['server requires authentication'], + ['authentication (is )?required'], + ]); diff --git a/sql/civicrm_data/civicrm_mailing_bounce_type/Inactive.sqldata.php b/sql/civicrm_data/civicrm_mailing_bounce_type/Inactive.sqldata.php new file mode 100644 index 0000000000..aa45415f58 --- /dev/null +++ b/sql/civicrm_data/civicrm_mailing_bounce_type/Inactive.sqldata.php @@ -0,0 +1,30 @@ +addMetadata([ + 'description' => ts('User account is no longer active'), + 'hold_threshold' => 1, + ]) + ->addValueTable(['pattern'], [ + ['(my )?e-?mail( address)? has changed'], + ['account (inactive|expired|deactivated)'], + ['account is locked'], + + // FIXME: In the old SQL, the "\" in "\w" didn't get through. We're probably loading the wrong data. + // ['changed \w+( e-?mail)? address'], + ['changed w+( e-?mail)? address'], + + ['deactivated mailbox'], + ['disabled or discontinued'], + ['inactive user'], + ['is inactive on this domain'], + ['mail receiving disabled'], + ['mail( ?)address is administrative?ly disabled'], + ['mailbox (temporarily disabled|currently suspended)'], + ['no longer (accepting mail|on server|in use|with|employed|on staff|works for|using this account)'], + ['not accepting (mail|messages)'], + ['please use my new e-?mail address'], + ['this address no longer accepts mail'], + ['user account suspended'], + ['account that you tried to reach is disabled'], + ['User banned'], + ]); diff --git a/sql/civicrm_data/civicrm_mailing_bounce_type/Invalid.sqldata.php b/sql/civicrm_data/civicrm_mailing_bounce_type/Invalid.sqldata.php new file mode 100644 index 0000000000..86828e4957 --- /dev/null +++ b/sql/civicrm_data/civicrm_mailing_bounce_type/Invalid.sqldata.php @@ -0,0 +1,65 @@ +addMetadata([ + 'description' => ts('Email address is not valid'), + 'hold_threshold' => 1, + ]) + ->addValueTable(['pattern'], [ + ['(user|recipient( name)?) is not recognized'], + ['554 delivery error'], + ['address does not exist'], + ['address(es)?( you (entered|specified))? (could|was)( not|n.t)( be)? found'], + ['address(ee)? (unknown|invalid)'], + ['bad destination'], + ['badly formatted address'], + ['can\'t open mailbox for'], + ['cannot deliver'], + ['delivery to the following recipient(s)? failed'], + ['destination addresses were unknown'], + ['did not reach the following recipient'], + ['does not exist'], + ['does not like recipient'], + ['does not specify a valid notes mail file'], + ['illegal alias'], + ['invalid (mailbox|(e-?mail )?address|recipient|final delivery)'], + ['invalid( or unknown)?( virtual)? user'], + ['(mail )?delivery (to this user )?is not allowed'], + ['mailbox (not found|unavailable|name not allowed)'], + ['message could not be forwarded'], + ['missing or malformed local(-| )part'], + ['no e-?mail address registered'], + ['no such (mail drop|mailbox( \\w+)?|(e-?mail )?address|recipient|(local )?user|person)( here)?'], + ['no mailbox (here )?by that name'], + ['not (listed in|found in directory|known at this site|our customer)'], + ['not a valid( (user|mailbox))?'], + ['not present in directory entry'], + ['recipient (does not exist|(is )?unknown|rejected|denied|not found)'], + ['this user doesn\'t have a yahoo.com address'], + ['unavailable to take delivery of the message'], + ['unavailable mailbox'], + ['unknown (local( |-)part|recipient|address error)'], + ['unknown( or illegal)? user( account)?'], + ['unrecognized recipient'], + ['unregistered address'], + ['user (unknown|(does not|doesn\'t) exist)'], + + // FIXME: In the old SQL, the "\" in "\w" didn't get through. We're probably loading the wrong data. + // ['user doesn\'t have an? \w+ account'], + ['user doesn\'t have an? w+ account'], + + ['user(\'s e-?mail name is)? not found'], + ['^Validation failed for:'], + ['5.1.0 Address rejected'], + ['no valid recipients?'], + ['RecipNotFound'], + ['no one at this address'], + ['misconfigured forwarding address'], + ['account is not allowed'], + ['Address .<[^>]*>. not known here'], + ['Recipient address rejected: ([a-zA-Z0-9-]+\\.)+[a-zA-Z]{2,}'], + ['Non sono riuscito a trovare l.indirizzo e-mail'], + ['nadie con esta direcci..?n'], + ['ni bilo mogo..?e najti prejemnikovega e-po..?tnega naslova'], + ['Elektronski naslov (je ukinjen|ne obstaja)'], + ['nepravilno nastavljen predal'], + ]); diff --git a/sql/civicrm_data/civicrm_mailing_bounce_type/Loop.sqldata.php b/sql/civicrm_data/civicrm_mailing_bounce_type/Loop.sqldata.php new file mode 100644 index 0000000000..a1e9ca9b39 --- /dev/null +++ b/sql/civicrm_data/civicrm_mailing_bounce_type/Loop.sqldata.php @@ -0,0 +1,14 @@ +addMetadata([ + 'description' => ts('Mail routing error'), + 'hold_threshold' => 3, + ]) + ->addValueTable(['pattern'], [ + ['(mail( forwarding)?|routing).loop'], + ['excessive recursion'], + ['loop detected'], + ['maximum hop count exceeded'], + ['message was forwarded more than the maximum allowed times'], + ['too many (hops|recursive forwards)'], + ]); diff --git a/sql/civicrm_data/civicrm_mailing_bounce_type/Quota.sqldata.php b/sql/civicrm_data/civicrm_mailing_bounce_type/Quota.sqldata.php new file mode 100644 index 0000000000..d1ab5d8139 --- /dev/null +++ b/sql/civicrm_data/civicrm_mailing_bounce_type/Quota.sqldata.php @@ -0,0 +1,25 @@ +addMetadata([ + 'description' => ts('User inbox is full'), + 'hold_threshold' => 3, + ]) + ->addValueTable(['pattern'], [ + ['(disk(space)?|over the allowed|exceed(ed|s)?|storage) quota'], + ['522_mailbox_full'], + ['exceeds allowed message count'], + ['file too large'], + ['full mailbox'], + ['(mail|in)(box|folder) ((for user \\w+ )?is )?full'], + ['mailbox (has exceeded|is over) the limit'], + ['mailbox( exceeds allowed)? size'], + ['no space left for this user'], + ['over\\s?quota'], + ['quota (for the mailbox )?has been exceeded'], + ['quota ?(usage|violation|exceeded)'], + ['recipient storage full'], + ['not able to receive more mail'], + ['doesn.t have enough disk space left'], + ['exceeded storage allocation'], + ['running out of disk space'], + ]); diff --git a/sql/civicrm_data/civicrm_mailing_bounce_type/Relay.sqldata.php b/sql/civicrm_data/civicrm_mailing_bounce_type/Relay.sqldata.php new file mode 100644 index 0000000000..f7ba7380fd --- /dev/null +++ b/sql/civicrm_data/civicrm_mailing_bounce_type/Relay.sqldata.php @@ -0,0 +1,22 @@ +addMetadata([ + 'description' => ts('Unable to reach destination mail server'), + 'hold_threshold' => 3, + ]) + ->addValueTable(['pattern'], [ + ['cannot find your hostname'], + ['ip name lookup'], + ['not configured to relay mail'], + ['relay(ing)? (not permitted|(access )?denied)'], + ['relayed mail to .+? not allowed'], + ['sender ip must resolve'], + ['unable to relay'], + ['No route to host'], + ['Network is unreachable'], + ['unrouteable address'], + ['We don.t handle mail for'], + ['we do not relay'], + ['Rejected by next-hop'], + ['not permitted to( *550)? relay through this server'], + ]); diff --git a/sql/civicrm_data/civicrm_mailing_bounce_type/Spam.sqldata.php b/sql/civicrm_data/civicrm_mailing_bounce_type/Spam.sqldata.php new file mode 100644 index 0000000000..a68a52dfcf --- /dev/null +++ b/sql/civicrm_data/civicrm_mailing_bounce_type/Spam.sqldata.php @@ -0,0 +1,39 @@ +addMetadata([ + 'description' => ts('Message caught by a content filter'), + 'hold_threshold' => 1, + ]) + ->addValueTable(['pattern'], [ + ['(bulk( e-?mail)|content|attachment blocking|virus|mail system) filters?'], + ['(hostile|questionable|unacceptable) content'], + ['address .+? has not been verified'], + + // FIXME: In the old SQL, the "\" in "\w" didn't get through. We're probably loading the wrong data. + // ['anti-?spam (polic\w+|software)'], + ['anti-?spam (policw+|software)'], + + ['anti-?virus gateway has detected'], + ['blacklisted'], + ['blocked message'], + ['content control'], + ['delivery not authorized'], + ['does not conform to our e-?mail policy'], + ['excessive spam content'], + ['message looks suspicious'], + ['open relay'], + ['sender was rejected'], + ['spam(check| reduction software| filters?)'], + ['blocked by a user configured filter'], + ['(detected|rejected) (as|due to) spam'], + ['X-HmXmrOriginalRecipient'], + ['Client host .[^ ]*. blocked'], + ['automatic(ally-generated)? messages are not accepted'], + ['denied by policy'], + ['has no corresponding reverse \\(PTR\\) address'], + ['has a policy that( [^ ]*)? prohibited the mail that you sent'], + ['is likely unsolicited mail'], + ['Local Policy Violation'], + ['ni bilo mogo..?e dostaviti zaradi varnostnega pravilnika'], + ['abuse report'], + ]); diff --git a/sql/civicrm_data/civicrm_mailing_bounce_type/Syntax.sqldata.php b/sql/civicrm_data/civicrm_mailing_bounce_type/Syntax.sqldata.php new file mode 100644 index 0000000000..a2ddd206ca --- /dev/null +++ b/sql/civicrm_data/civicrm_mailing_bounce_type/Syntax.sqldata.php @@ -0,0 +1,11 @@ +addMetadata([ + 'description' => ts('Error in SMTP transaction'), + 'hold_threshold' => 3, + ]) + ->addValueTable(['pattern'], [ + ['nonstandard smtp line terminator'], + ['syntax error in from address'], + ['unknown smtp code'], + ]); diff --git a/xml/templates/civicrm_data.tpl b/xml/templates/civicrm_data.tpl index 8891e1a95b..e9b4cba688 100644 --- a/xml/templates/civicrm_data.tpl +++ b/xml/templates/civicrm_data.tpl @@ -145,269 +145,17 @@ VALUES (@drgid, 'civicrm_contact', 'first_name', '5'), {php}echo (include "sql/civicrm_data/civicrm_county.sqldata.php")->toSQL();{/php} -- Bounce classification patterns -INSERT INTO civicrm_mailing_bounce_type - (name, description, hold_threshold) - VALUES ('AOL', '{ts escape="sql"}AOL Terms of Service complaint{/ts}', 1); - -SELECT @bounceTypeID := max(id) FROM civicrm_mailing_bounce_type WHERE name = 'AOL'; -INSERT INTO civicrm_mailing_bounce_pattern - (bounce_type_id, pattern) - VALUES - (@bounceTypeID, 'Client TOS Notification'); - -INSERT INTO civicrm_mailing_bounce_type - (name, description, hold_threshold) - VALUES ('Away', '{ts escape="sql"}Recipient is on vacation{/ts}', 30); - -SELECT @bounceTypeID := max(id) FROM civicrm_mailing_bounce_type WHERE name = 'Away'; -INSERT INTO civicrm_mailing_bounce_pattern - (bounce_type_id, pattern) - VALUES - (@bounceTypeID, '(be|am)? (out of|away from) (the|my)? (office|computer|town)'), - (@bounceTypeID, 'i am on vacation'); - -INSERT INTO civicrm_mailing_bounce_type - (name, description, hold_threshold) - VALUES ('Dns', '{ts escape="sql"}Unable to resolve recipient domain{/ts}', 3); - -SELECT @bounceTypeID := max(id) FROM civicrm_mailing_bounce_type WHERE name = 'Dns'; -INSERT INTO civicrm_mailing_bounce_pattern - (bounce_type_id, pattern) - VALUES - (@bounceTypeID, 'name(server entry| lookup failure)'), - (@bounceTypeID, 'no (mail server|matches to nameserver query|dns entries)'), - (@bounceTypeID, 'reverse dns entry'), - (@bounceTypeID, 'Host or domain name not found'), - (@bounceTypeID, 'Unable to resolve MX record for'); - -INSERT INTO civicrm_mailing_bounce_type - (name, description, hold_threshold) - VALUES ('Host', '{ts escape="sql"}Unable to deliver to destintation mail server{/ts}', 3); - -SELECT @bounceTypeID := max(id) FROM civicrm_mailing_bounce_type WHERE name = 'Host'; -INSERT INTO civicrm_mailing_bounce_pattern - (bounce_type_id, pattern) - VALUES - (@bounceTypeID, '(unknown|not local) host'), - (@bounceTypeID, 'all hosts have been failing'), - (@bounceTypeID, 'allowed rcpthosts'), - (@bounceTypeID, 'connection (refused|timed out)'), - (@bounceTypeID, 'not connected'), - (@bounceTypeID, 'couldn\'t find any host named'), - (@bounceTypeID, 'error involving remote host'), - (@bounceTypeID, 'host unknown'), - (@bounceTypeID, 'invalid host name'), - (@bounceTypeID, 'isn\'t in my control/locals file'), - (@bounceTypeID, 'local configuration error'), - (@bounceTypeID, 'not a gateway'), - (@bounceTypeID, 'server is (down or unreachable|not responding)'), - (@bounceTypeID, 'too many connections'), - (@bounceTypeID, 'unable to connect'), - (@bounceTypeID, 'lost connection'), - (@bounceTypeID, 'conversation with [^ ]* timed out while'), - (@bounceTypeID, 'server requires authentication'), - (@bounceTypeID, 'authentication (is )?required'); - -INSERT INTO civicrm_mailing_bounce_type - (name, description, hold_threshold) - VALUES ('Inactive', '{ts escape="sql"}User account is no longer active{/ts}', 1); - -SELECT @bounceTypeID := max(id) FROM civicrm_mailing_bounce_type WHERE name = 'Inactive'; -INSERT INTO civicrm_mailing_bounce_pattern - (bounce_type_id, pattern) - VALUES - (@bounceTypeID, '(my )?e-?mail( address)? has changed'), - (@bounceTypeID, 'account (inactive|expired|deactivated)'), - (@bounceTypeID, 'account is locked'), - (@bounceTypeID, 'changed \w+( e-?mail)? address'), - (@bounceTypeID, 'deactivated mailbox'), - (@bounceTypeID, 'disabled or discontinued'), - (@bounceTypeID, 'inactive user'), - (@bounceTypeID, 'is inactive on this domain'), - (@bounceTypeID, 'mail receiving disabled'), - (@bounceTypeID, 'mail( ?)address is administrative?ly disabled'), - (@bounceTypeID, 'mailbox (temporarily disabled|currently suspended)'), - (@bounceTypeID, 'no longer (accepting mail|on server|in use|with|employed|on staff|works for|using this account)'), - (@bounceTypeID, 'not accepting (mail|messages)'), - (@bounceTypeID, 'please use my new e-?mail address'), - (@bounceTypeID, 'this address no longer accepts mail'), - (@bounceTypeID, 'user account suspended'), - (@bounceTypeID, 'account that you tried to reach is disabled'), - (@bounceTypeID, 'User banned'); - -INSERT INTO civicrm_mailing_bounce_type - (name, description, hold_threshold) - VALUES ('Invalid', '{ts escape="sql"}Email address is not valid{/ts}', 1); - -SELECT @bounceTypeID := max(id) FROM civicrm_mailing_bounce_type WHERE name = 'Invalid'; -INSERT INTO civicrm_mailing_bounce_pattern - (bounce_type_id, pattern) - VALUES - (@bounceTypeID, '(user|recipient( name)?) is not recognized'), - (@bounceTypeID, '554 delivery error'), - (@bounceTypeID, 'address does not exist'), - (@bounceTypeID, 'address(es)?( you (entered|specified))? (could|was)( not|n.t)( be)? found'), - (@bounceTypeID, 'address(ee)? (unknown|invalid)'), - (@bounceTypeID, 'bad destination'), - (@bounceTypeID, 'badly formatted address'), - (@bounceTypeID, 'can\'t open mailbox for'), - (@bounceTypeID, 'cannot deliver'), - (@bounceTypeID, 'delivery to the following recipient(s)? failed'), - (@bounceTypeID, 'destination addresses were unknown'), - (@bounceTypeID, 'did not reach the following recipient'), - (@bounceTypeID, 'does not exist'), - (@bounceTypeID, 'does not like recipient'), - (@bounceTypeID, 'does not specify a valid notes mail file'), - (@bounceTypeID, 'illegal alias'), - (@bounceTypeID, 'invalid (mailbox|(e-?mail )?address|recipient|final delivery)'), - (@bounceTypeID, 'invalid( or unknown)?( virtual)? user'), - (@bounceTypeID, '(mail )?delivery (to this user )?is not allowed'), - (@bounceTypeID, 'mailbox (not found|unavailable|name not allowed)'), - (@bounceTypeID, 'message could not be forwarded'), - (@bounceTypeID, 'missing or malformed local(-| )part'), - (@bounceTypeID, 'no e-?mail address registered'), - (@bounceTypeID, 'no such (mail drop|mailbox( \\w+)?|(e-?mail )?address|recipient|(local )?user|person)( here)?'), - (@bounceTypeID, 'no mailbox (here )?by that name'), - (@bounceTypeID, 'not (listed in|found in directory|known at this site|our customer)'), - (@bounceTypeID, 'not a valid( (user|mailbox))?'), - (@bounceTypeID, 'not present in directory entry'), - (@bounceTypeID, 'recipient (does not exist|(is )?unknown|rejected|denied|not found)'), - (@bounceTypeID, 'this user doesn\'t have a yahoo.com address'), - (@bounceTypeID, 'unavailable to take delivery of the message'), - (@bounceTypeID, 'unavailable mailbox'), - (@bounceTypeID, 'unknown (local( |-)part|recipient|address error)'), - (@bounceTypeID, 'unknown( or illegal)? user( account)?'), - (@bounceTypeID, 'unrecognized recipient'), - (@bounceTypeID, 'unregistered address'), - (@bounceTypeID, 'user (unknown|(does not|doesn\'t) exist)'), - (@bounceTypeID, 'user doesn\'t have an? \w+ account'), - (@bounceTypeID, 'user(\'s e-?mail name is)? not found'), - (@bounceTypeID, '^Validation failed for:'), - (@bounceTypeID, '5.1.0 Address rejected'), - (@bounceTypeID, 'no valid recipients?'), - (@bounceTypeID, 'RecipNotFound'), - (@bounceTypeID, 'no one at this address'), - (@bounceTypeID, 'misconfigured forwarding address'), - (@bounceTypeID, 'account is not allowed'), - (@bounceTypeID, 'Address .<[^>]*>. not known here'), - (@bounceTypeID, '{literal}Recipient address rejected: ([a-zA-Z0-9-]+\\.)+[a-zA-Z]{2,}{/literal}'), - (@bounceTypeID, 'Non sono riuscito a trovare l.indirizzo e-mail'), - (@bounceTypeID, 'nadie con esta direcci..?n'), - (@bounceTypeID, 'ni bilo mogo..?e najti prejemnikovega e-po..?tnega naslova'), - (@bounceTypeID, 'Elektronski naslov (je ukinjen|ne obstaja)'), - (@bounceTypeID, 'nepravilno nastavljen predal'); - -INSERT INTO civicrm_mailing_bounce_type - (name, description, hold_threshold) - VALUES ('Loop', '{ts escape="sql"}Mail routing error{/ts}', 3); - -SELECT @bounceTypeID := max(id) FROM civicrm_mailing_bounce_type WHERE name = 'Loop'; -INSERT INTO civicrm_mailing_bounce_pattern - (bounce_type_id, pattern) - VALUES - (@bounceTypeID, '(mail( forwarding)?|routing).loop'), - (@bounceTypeID, 'excessive recursion'), - (@bounceTypeID, 'loop detected'), - (@bounceTypeID, 'maximum hop count exceeded'), - (@bounceTypeID, 'message was forwarded more than the maximum allowed times'), - (@bounceTypeID, 'too many (hops|recursive forwards)'); - -INSERT INTO civicrm_mailing_bounce_type - (name, description, hold_threshold) - VALUES ('Quota', '{ts escape="sql"}User inbox is full{/ts}', 3); - -SELECT @bounceTypeID := max(id) FROM civicrm_mailing_bounce_type WHERE name = 'Quota'; -INSERT INTO civicrm_mailing_bounce_pattern - (bounce_type_id, pattern) - VALUES - (@bounceTypeID, '(disk(space)?|over the allowed|exceed(ed|s)?|storage) quota'), - (@bounceTypeID, '522_mailbox_full'), - (@bounceTypeID, 'exceeds allowed message count'), - (@bounceTypeID, 'file too large'), - (@bounceTypeID, 'full mailbox'), - (@bounceTypeID, '(mail|in)(box|folder) ((for user \\w+ )?is )?full'), - (@bounceTypeID, 'mailbox (has exceeded|is over) the limit'), - (@bounceTypeID, 'mailbox( exceeds allowed)? size'), - (@bounceTypeID, 'no space left for this user'), - (@bounceTypeID, 'over\\s?quota'), - (@bounceTypeID, 'quota (for the mailbox )?has been exceeded'), - (@bounceTypeID, 'quota ?(usage|violation|exceeded)'), - (@bounceTypeID, 'recipient storage full'), - (@bounceTypeID, 'not able to receive more mail'), - (@bounceTypeID, 'doesn.t have enough disk space left'), - (@bounceTypeID, 'exceeded storage allocation'), - (@bounceTypeID, 'running out of disk space'); - -INSERT INTO civicrm_mailing_bounce_type - (name, description, hold_threshold) - VALUES ('Relay', '{ts escape="sql"}Unable to reach destination mail server{/ts}', 3); - -SELECT @bounceTypeID := max(id) FROM civicrm_mailing_bounce_type WHERE name = 'Relay'; -INSERT INTO civicrm_mailing_bounce_pattern - (bounce_type_id, pattern) - VALUES - (@bounceTypeID, 'cannot find your hostname'), - (@bounceTypeID, 'ip name lookup'), - (@bounceTypeID, 'not configured to relay mail'), - (@bounceTypeID, 'relay(ing)? (not permitted|(access )?denied)'), - (@bounceTypeID, 'relayed mail to .+? not allowed'), - (@bounceTypeID, 'sender ip must resolve'), - (@bounceTypeID, 'unable to relay'), - (@bounceTypeID, 'No route to host'), - (@bounceTypeID, 'Network is unreachable'), - (@bounceTypeID, 'unrouteable address'), - (@bounceTypeID, 'We don.t handle mail for'), - (@bounceTypeID, 'we do not relay'), - (@bounceTypeID, 'Rejected by next-hop'), - (@bounceTypeID, 'not permitted to( *550)? relay through this server'); - -INSERT INTO civicrm_mailing_bounce_type - (name, description, hold_threshold) - VALUES ('Spam', '{ts escape="sql"}Message caught by a content filter{/ts}', 1); - -SELECT @bounceTypeID := max(id) FROM civicrm_mailing_bounce_type WHERE name = 'Spam'; -INSERT INTO civicrm_mailing_bounce_pattern - (bounce_type_id, pattern) - VALUES - (@bounceTypeID, '(bulk( e-?mail)|content|attachment blocking|virus|mail system) filters?'), - (@bounceTypeID, '(hostile|questionable|unacceptable) content'), - (@bounceTypeID, 'address .+? has not been verified'), - (@bounceTypeID, 'anti-?spam (polic\w+|software)'), - (@bounceTypeID, 'anti-?virus gateway has detected'), - (@bounceTypeID, 'blacklisted'), - (@bounceTypeID, 'blocked message'), - (@bounceTypeID, 'content control'), - (@bounceTypeID, 'delivery not authorized'), - (@bounceTypeID, 'does not conform to our e-?mail policy'), - (@bounceTypeID, 'excessive spam content'), - (@bounceTypeID, 'message looks suspicious'), - (@bounceTypeID, 'open relay'), - (@bounceTypeID, 'sender was rejected'), - (@bounceTypeID, 'spam(check| reduction software| filters?)'), - (@bounceTypeID, 'blocked by a user configured filter'), - (@bounceTypeID, '(detected|rejected) (as|due to) spam'), - (@bounceTypeID, 'X-HmXmrOriginalRecipient'), - (@bounceTypeID, 'Client host .[^ ]*. blocked'), - (@bounceTypeID, 'automatic(ally-generated)? messages are not accepted'), - (@bounceTypeID, 'denied by policy'), - (@bounceTypeID, 'has no corresponding reverse \\(PTR\\) address'), - (@bounceTypeID, 'has a policy that( [^ ]*)? prohibited the mail that you sent'), - (@bounceTypeID, 'is likely unsolicited mail'), - (@bounceTypeID, 'Local Policy Violation'), - (@bounceTypeID, 'ni bilo mogo..?e dostaviti zaradi varnostnega pravilnika'), - (@bounceTypeID, 'abuse report'); - -INSERT INTO civicrm_mailing_bounce_type - (name, description, hold_threshold) - VALUES ('Syntax', '{ts escape="sql"}Error in SMTP transaction{/ts}', 3); - -SELECT @bounceTypeID := max(id) FROM civicrm_mailing_bounce_type WHERE name = 'Syntax'; -INSERT INTO civicrm_mailing_bounce_pattern - (bounce_type_id, pattern) - VALUES - (@bounceTypeID, 'nonstandard smtp line terminator'), - (@bounceTypeID, 'syntax error in from address'), - (@bounceTypeID, 'unknown smtp code'); +{php}echo (include "sql/civicrm_data/civicrm_mailing_bounce_type/AOL.sqldata.php")->toSQL();{/php} +{php}echo (include "sql/civicrm_data/civicrm_mailing_bounce_type/Away.sqldata.php")->toSQL();{/php} +{php}echo (include "sql/civicrm_data/civicrm_mailing_bounce_type/Dns.sqldata.php")->toSQL();{/php} +{php}echo (include "sql/civicrm_data/civicrm_mailing_bounce_type/Host.sqldata.php")->toSQL();{/php} +{php}echo (include "sql/civicrm_data/civicrm_mailing_bounce_type/Inactive.sqldata.php")->toSQL();{/php} +{php}echo (include "sql/civicrm_data/civicrm_mailing_bounce_type/Invalid.sqldata.php")->toSQL();{/php} +{php}echo (include "sql/civicrm_data/civicrm_mailing_bounce_type/Loop.sqldata.php")->toSQL();{/php} +{php}echo (include "sql/civicrm_data/civicrm_mailing_bounce_type/Quota.sqldata.php")->toSQL();{/php} +{php}echo (include "sql/civicrm_data/civicrm_mailing_bounce_type/Relay.sqldata.php")->toSQL();{/php} +{php}echo (include "sql/civicrm_data/civicrm_mailing_bounce_type/Spam.sqldata.php")->toSQL();{/php} +{php}echo (include "sql/civicrm_data/civicrm_mailing_bounce_type/Syntax.sqldata.php")->toSQL();{/php} {php}echo (include "sql/civicrm_data/civicrm_uf_group.sqldata.php")->toSQL();{/php} {php}echo (include "sql/civicrm_data/civicrm_uf_join.sqldata.php")->toSQL();{/php} -- 2.25.1