Comparing version 0.1.0-alpha.16 to 0.1.0-alpha.17
@@ -70,3 +70,4 @@ 'use strict'; | ||
interfaces: ['feeder'], | ||
rejectSpam: true // if false, then the message is passed on with a spam header, otherwise message is rejected | ||
rejectSpam: false, // if false, then the message is passed on with a spam header, otherwise message is rejected | ||
processSpam: false // if true then drops spam or modifies headers for suspicios messages | ||
}, | ||
@@ -73,0 +74,0 @@ |
{ | ||
"name": "zone-mta", | ||
"private": false, | ||
"version": "0.1.0-alpha.16", | ||
"version": "0.1.0-alpha.17", | ||
"description": "Tiny outbound MTA", | ||
@@ -6,0 +6,0 @@ "main": "app.js", |
@@ -42,2 +42,26 @@ 'use strict'; | ||
if (app.config.processSpam) { | ||
switch (envelope.spam && envelope.spam.default && envelope.spam.default.action) { | ||
case 'reject': | ||
app.logger.info('Queue', '%s DROPPED[spam] (message-id=%s from=%s to=%s)', envelope.id, envelope.messageId, envelope.from, envelope.to.join(',')); | ||
// accept message and silently drop it | ||
next({ | ||
name: 'SMTPResponse', | ||
message: 'Message accepted' | ||
}); | ||
break; | ||
case 'add header': | ||
case 'rewrite subject': | ||
case 'soft reject': | ||
{ | ||
let subject = envelope.headers.getFirst('subject'); | ||
let score = Number(envelope.spam.default.score) || 0; | ||
score = Math.round(score * 100) / 100; | ||
subject = ('[*** SPAM ' + score + ' ***] ' + subject).trim(); | ||
envelope.headers.update('Subject', subject); | ||
break; | ||
} | ||
} | ||
} | ||
if (app.config.rejectSpam && envelope.spam && envelope.spam.default && envelope.spam.default.is_spam) { | ||
@@ -44,0 +68,0 @@ let err = new Error('This message was classified as SPAM and may not be delivered'); |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
301901
5942