Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
0.0.2 version, minor fixes; error handling and package.json fix for npm
- Loading branch information
Humantech Gestao do Conhecimento
committed
Mar 13, 2012
1 parent
c797f67
commit cd66f89
Showing
4 changed files
with
69 additions
and
49 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,14 @@ | ||
var Spamd = require("../lib/spamd"); | ||
var spamd = new Spamd('from@yourdomain.com', 'to@anotherdomain.com', 'localhost', 783); | ||
|
||
var subject = 'Test Subject'; | ||
var message = 'test content.'; | ||
|
||
spamd.evaluate(subject, message, function(res){ | ||
|
||
if(typeof res !== 'undefined'){ | ||
if(res.spam){ | ||
var Spamd = require("node-spamd"), | ||
spamd = new Spamd(sender, receiver, host, port); | ||
|
||
spamd.evaluate(subject, message, function(res, err){ | ||
if (err) { | ||
console.log(err); | ||
} else { | ||
if (res.spam) { | ||
console.log('The message is Spam, is evaluated with ' + res.evaluation + " points in a maximun of " + res.allowed); | ||
}else{ | ||
} else { | ||
console.log('The message is not Spam, is evaluated with ' + res.evaluation + " points in a maximun of " + res.allowed); | ||
} | ||
}else{ | ||
console.log('Some error ocurred.'); | ||
} | ||
|
||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,41 @@ | ||
{ "name": "node-spamd" | ||
, "version": "0.0.1" | ||
, "engines": [ "node >=0.4.0" ] | ||
, "description": "SpamAssassin message evaluator for node.js" | ||
, "author": "Thomas Alexander Ewald <thomas@humantech.com.br>" | ||
, "contributors": [ | ||
{ "name": "Guilherme Henrique de Oliveira", "email": "guilherme@humantech.com.br" } | ||
] | ||
, "keywords" : [ "spam", "evaluation", "spamassassin", "score" ] | ||
, "repository":{ | ||
"type": "git" | ||
, "url": "https://github.com/humantech/node-spamd.git" | ||
} | ||
, "bin" : { "spamd" : "./bin/spamd.js" } | ||
, "scripts": { | ||
{ | ||
"name": "node-spamd", | ||
"version": "0.0.2", | ||
"engines": [ | ||
"node >=0.4.0" | ||
], | ||
"description": "SpamAssassin message evaluator for node.js", | ||
"author": { | ||
"name" : "Humantech Gestao do Conhecimento", | ||
"email" : "admin@humantech.com.br", | ||
"web" : "http://www.humantech.com.br/", | ||
"twitter" : "humantech_" | ||
}, | ||
"contributors": [ | ||
"Guilherme Henrique de Oliveira <guilherme@humantech.com.br>", | ||
"Thomas Alexander Ewald <thomas@humantech.com.br> | ||
], | ||
"license" : { | ||
"type" : "MIT" | ||
}, | ||
"keywords": [ | ||
"spam", | ||
"evaluation", | ||
"spamassassin", | ||
"score" | ||
], | ||
"repository": { | ||
"type": "git", | ||
"url": "git://github.com/humantech/node-spamd.git" | ||
}, | ||
"scripts": { | ||
"test": "vows --spec" | ||
} | ||
, "directories" : { | ||
"bin": "./bin" | ||
} | ||
, "main": "./lib/spamd.js" | ||
}, | ||
"directories" : { | ||
"examples" : "examples" | ||
}, | ||
"main": "./lib/spamd.js", | ||
"dependencies": {}, | ||
"devDependencies": {}, | ||
"optionalDependencies": {} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters