Skip to content

Commit

Permalink
Consolidated changes
Browse files Browse the repository at this point in the history
  • Loading branch information
ditesh committed Nov 8, 2011
1 parent 269e36f commit c1a1324
Show file tree
Hide file tree
Showing 11 changed files with 57 additions and 42 deletions.
17 changes: 15 additions & 2 deletions CHANGELOG
Original file line number Diff line number Diff line change
@@ -1,4 +1,17 @@
0.1.4 (Tue Nov 8 11:30:36 MYT 2011):

* Fixed issue #1 (thanks to Nazar [http://github.com/nazar] )
* Removed unused files
* Fixed demo/demo.js
* Fixed bug for non-match on multiline response when -ERR is received

0.1.3:

* Fixed default value for options in constructor
* Fixed documentation text
* Miscellaneous minor fixes

0.1.2:

* Removed unixlib as a dependency
* Added CHANGELOG
* Removed unixlib as a dependency
* Added CHANGELOG
24 changes: 13 additions & 11 deletions demos/demo.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,11 @@ var msgnumber = argv.msgnumber;
var username = argv.username;
var password = argv.password;

var client = new POP3Client(port, host, { argv.networkdebug: (argv.debug === "on" ? true: false) });
var client = new POP3Client(port, host, {

debug: (argv.networkdebug === "on" ? true: false)

});

client.on("error", function(err) {

Expand All @@ -52,7 +56,7 @@ client.on("error", function(err) {
client.on("connect", function(rawdata) {

console.log("CONNECT success");
client.auth(username, password);
client.login(username, password);

});

Expand All @@ -64,7 +68,7 @@ client.on("locked", function(cmd) {
console.log("Current command has not finished yet. You tried calling " + cmd);
});

client.on("auth", function(status, rawdata) {
client.on("login", function(status, rawdata) {

if (status) {

Expand Down Expand Up @@ -121,7 +125,7 @@ client.on("stat", function(status, data, rawdata) {

console.log("STAT success");
if (debug) console.log(" Parsed data: " + util.inspect(data));
client.list(msgnumber);
client.list();

} else {

Expand All @@ -135,10 +139,8 @@ client.on("list", function(status, msgcount, msgnumber, data, rawdata) {

if (status === false) {

if (msgnumber !== undefined)
console.log("LIST failed for msgnumber " + msgnumber);
else
console.log("LIST failed");
if (msgnumber !== undefined) console.log("LIST failed for msgnumber " + msgnumber);
else console.log("LIST failed");

client.quit();

Expand All @@ -150,7 +152,7 @@ client.on("list", function(status, msgcount, msgnumber, data, rawdata) {
} else {

console.log("LIST success with " + msgcount + " element(s)");
client.uidl(msgnumber);
client.uidl();

}
});
Expand All @@ -159,9 +161,9 @@ client.on("uidl", function(status, msgnumber, data, rawdata) {

if (status === true) {

console.log("UIDL success for msgnumber " + msgnumber);
console.log("UIDL success");
if (debug) console.log(" Parsed data: " + data);
client.top(msgnumber, 10);
client.top(123123, 10);

} else {

Expand Down
20 changes: 10 additions & 10 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
{
"name": "poplib",
"version": "v0.1.2",
"description": "POP3 client library for Node.js",
"homepage": "https://github.com/ditesh/node-poplib",
"version": "v0.1.3",
"description": "POP3 client library for Node.js",
"homepage": "https://github.com/ditesh/node-poplib",
"keywords": ["POP3", "pop3", "pop", "client", "mail", "email"],
"author": {
"name": "Ditesh Shashikant Gathani",
"email": "ditesh@gathani.org",
"url": "http://ditesh.gathani.org/blog/"
},
"author": {
"name": "Ditesh Shashikant Gathani",
"email": "ditesh@gathani.org",
"url": "http://ditesh.gathani.org/blog/"
},
"dependencies": ["optimist", "hashlib"],
"repository": { "type" : "git", "url" : "https://github.com/ditesh/node-poplib.git" },
"main": "main.js"
"repository": { "type" : "git", "url" : "https://github.com/ditesh/node-poplib.git" },
"main": "main.js"
}
2 changes: 1 addition & 1 deletion tests/apop.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
Node.js POP3 client demo in retrieving all POP3 messages into mbox file
Node.js POP3 client test file
Copyright (C) 2011 by Ditesh Shashikant Gathani <ditesh@gathani.org>
Expand Down
2 changes: 1 addition & 1 deletion tests/basic.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
Node.js POP3 client demo in retrieving all POP3 messages into mbox file
Node.js POP3 client test file
Copyright (C) 2011 by Ditesh Shashikant Gathani <ditesh@gathani.org>
Expand Down
4 changes: 4 additions & 0 deletions tests/basic.sh
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,10 @@ print_test "Sending test message to $EMAIL (str: $RANDOMID)"
OUTPUT=`./sendmail.sh -q 1 $EMAIL "subject with $RANDOMID" "body with $RANDOMID"`
print_result 0 $OUTPUT

print_test "Sleeping 5 seconds"
OUTPUT=`sleep 5`
print_result 0 $OUTPUT

print_test "CAPA test"
OUTPUT=`node basic.js --username $USER --password $PASS --host $HOST --port $PORT`;
print_result 0 $OUTPUT
Expand Down
8 changes: 1 addition & 7 deletions tests/login.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
Node.js POP3 client demo in retrieving all POP3 messages into mbox file
Node.js POP3 client test file
Copyright (C) 2011 by Ditesh Shashikant Gathani <ditesh@gathani.org>
Expand Down Expand Up @@ -41,12 +41,6 @@ var currentmsg = 0;

var client = new POP3Client(port, host, { debug: (argv.debug === "on" ? true: false) });

client.on("connect-error", function(err) {

console.log("potato");

});

client.on("error", function(err) {
console.log("Server error occurred, failed, " + err);
});
Expand Down
16 changes: 9 additions & 7 deletions tests/runner.sh
Original file line number Diff line number Diff line change
Expand Up @@ -51,13 +51,15 @@ if [ $# -lt 6 ]; then

echo "Usage:"
echo " runner.sh username password host standard-port tls-port testemail@example.com [test]"
echo " username: POP3 username"
echo " password: POP3 password"
echo " host: POP3 host"
echo " standard-port: POP3 port (eg 110)"
echo " tls-port: POP3 TLS port (eg 995)"
echo " email: valid email address on POP3 server which can receive emails"
echo " test: which test to run (default all"
echo
echo " username: POP3 username"
echo " password: POP3 password"
echo " host: POP3 host"
echo " standard-port: POP3 port (eg 110)"
echo " tls-port: POP3 TLS port (eg 995)"
echo " email: valid email address on POP3 server which can receive emails"
echo " test: which test to run (default all)"
echo
exit 1

fi
Expand Down
2 changes: 1 addition & 1 deletion tests/sasl.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
Node.js POP3 client demo in retrieving all POP3 messages into mbox file
Node.js POP3 client test file
Copyright (C) 2011 by Ditesh Shashikant Gathani <ditesh@gathani.org>
Expand Down
2 changes: 1 addition & 1 deletion tests/stls.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
Node.js POP3 client demo in retrieving all POP3 messages into mbox file
Node.js POP3 client test file
Copyright (C) 2011 by Ditesh Shashikant Gathani <ditesh@gathani.org>
Expand Down
2 changes: 1 addition & 1 deletion tests/tls.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
Node.js POP3 client demo in retrieving all POP3 messages into mbox file
Node.js POP3 client test file
Copyright (C) 2011 by Ditesh Shashikant Gathani <ditesh@gathani.org>
Expand Down

0 comments on commit c1a1324

Please sign in to comment.