diff --git a/gmail-test-proxy/browserify-test.js b/gmail-test-proxy/browserify-test.js index 6e8b13f..823e2ca 100644 --- a/gmail-test-proxy/browserify-test.js +++ b/gmail-test-proxy/browserify-test.js @@ -2,19 +2,23 @@ var inbox = require('inbox'); -var client = inbox.createConnection(false, "imap.gmail.com", { - secureConnection: true, - auth: { - XOAuth2: { - user: "safewithme.testuser@gmail.com", - clientId: "440907777130.apps.googleusercontent.com", - accessToken: "ya29.AHES6ZTVj9_kCdP8zEYCA9OZ6fvTqT_TmCe4UsmYPF3ffYM8eGHX2uw" - } - } +var client = inbox.createConnection(143, "imapmail.t-online.de", { + secureConnection: false, + // auth: { + // XOAuth2: { + // user: "safewithme.testuser@gmail.com", + // clientId: "440907777130.apps.googleusercontent.com", + // accessToken: "ya29.AHES6ZTVj9_kCdP8zEYCA9OZ6fvTqT_TmCe4UsmYPF3ffYM8eGHX2uw" + // } + // } // auth: { // user: "safewithme.testuser@gmail.com", // pass: "hellosafe" // } + auth: { + user: 'whiteout.test@t-online.de', + pass: '@6IyFg1SIlWH91Co' // 'R2nUXJlh9JKV3ZEp1#jH' + } }); console.log("Connecting to server..."); @@ -24,29 +28,34 @@ client.on("connect", function() { console.log("Connected!"); - // client.openMailbox("INBOX", function(error, mailbox) { - // if (error) throw error; + client.openMailbox("INBOX", function(error, mailbox) { + if (error) throw error; - // // List newest 10 messages - // client.listMessages(-10, function(err, messages) { - // console.log("Listing messages server..."); - // messages.forEach(function(message) { - // console.log(message.UID); - // // client.createMessageStream(message.UID).pipe(process.stdout, { - // // end: false - // // }); - // }); + // List newest 10 messages + client.listMessages(-10, function(err, messages) { + console.log("Listing messages server..."); + messages.forEach(function(message) { + console.log(message.UID); - // client.close(); - // }); - // }); + var msgStream = client.createMessageStream(message.UID); + msgStream.on('data', function(chunk) { + console.log(chunk.toString('utf8')); + }) + msgStream.on('end', function() { + console.log('\n\nthere will be no more data.'); + }); + }); + + client.close(); + }); + }); }); -// client.on('error', function(err) { -// console.log('Error'); -// console.log(err) -// }); +client.on('error', function(err) { + console.log('Error'); + console.log(err) +}); -// client.on('close', function() { -// console.log('DISCONNECTED!'); -// }); \ No newline at end of file +client.on('close', function() { + console.log('DISCONNECTED!'); +}); \ No newline at end of file diff --git a/gmail-test-proxy/package.json b/gmail-test-proxy/package.json index 98d0163..8ab8102 100644 --- a/gmail-test-proxy/package.json +++ b/gmail-test-proxy/package.json @@ -9,7 +9,7 @@ }, "dependencies": { "express": "~3.2.4", - "inbox": "https://github.com/whiteout-io/inbox/tarball/iconv-lite", + "inbox": "https://github.com/whiteout-io/inbox/tarball/chrome", "nodemailer": "~0.4.3" }, "devDependencies": {