diff --git a/helpers/is-arbitrary.js b/helpers/is-arbitrary.js index 2baef091c..7fcf1cd0f 100644 --- a/helpers/is-arbitrary.js +++ b/helpers/is-arbitrary.js @@ -7,11 +7,12 @@ const RE2 = require('re2'); const isSANB = require('is-string-and-not-blank'); const { fromUrl, parseDomain } = require('parse-domain'); -const config = require('#config'); -const env = require('#config/env'); const SMTPError = require('#helpers/smtp-error'); const checkSRS = require('#helpers/check-srs'); +const config = require('#config'); +const env = require('#config/env'); const getHeaders = require('#helpers/get-headers'); +const isAutoReplyOrMailingList = require('#helpers/is-auto-reply-or-mailing-list'); const logger = require('#helpers/logger'); const parseHostFromDomainOrAddress = require('#helpers/parse-host-from-domain-or-address'); const parseRootDomain = require('#helpers/parse-root-domain'); @@ -160,8 +161,11 @@ function isArbitrary(session, headers) { )) || (session.originalFromAddress.startsWith('postmaster@') && session.originalFromAddress.endsWith('.onmicrosoft.com'))) && - subject && - subject.startsWith('Undeliverable: ') + isAutoReplyOrMailingList(headers) + // subject && + // subject.startsWith('Undeliverable: ') + // NOTE: there are too many edge cases with outlook since it needs translated for subject + // e.g. there is a subject that is "No se puede entregar: " ) throw new SMTPError( 'Due to spam from onmicrosoft.com we have implemented restrictions; see https://old.reddit.com/r/msp/comments/16n8p0j/spam_increase_from_onmicrosoftcom_addresses/ ;'