imap to t-online works

This commit is contained in:
Tankred Hase 2013-08-02 12:52:38 +02:00
parent 90d0fdf504
commit 04e43bde3d
2 changed files with 40 additions and 31 deletions

View File

@ -2,19 +2,23 @@
var inbox = require('inbox'); var inbox = require('inbox');
var client = inbox.createConnection(false, "imap.gmail.com", { var client = inbox.createConnection(143, "imapmail.t-online.de", {
secureConnection: true, secureConnection: false,
auth: { // auth: {
XOAuth2: { // XOAuth2: {
user: "safewithme.testuser@gmail.com", // user: "safewithme.testuser@gmail.com",
clientId: "440907777130.apps.googleusercontent.com", // clientId: "440907777130.apps.googleusercontent.com",
accessToken: "ya29.AHES6ZTVj9_kCdP8zEYCA9OZ6fvTqT_TmCe4UsmYPF3ffYM8eGHX2uw" // accessToken: "ya29.AHES6ZTVj9_kCdP8zEYCA9OZ6fvTqT_TmCe4UsmYPF3ffYM8eGHX2uw"
} // }
} // }
// auth: { // auth: {
// user: "safewithme.testuser@gmail.com", // user: "safewithme.testuser@gmail.com",
// pass: "hellosafe" // pass: "hellosafe"
// } // }
auth: {
user: 'whiteout.test@t-online.de',
pass: '@6IyFg1SIlWH91Co' // 'R2nUXJlh9JKV3ZEp1#jH'
}
}); });
console.log("Connecting to server..."); console.log("Connecting to server...");
@ -24,29 +28,34 @@ client.on("connect", function() {
console.log("Connected!"); console.log("Connected!");
// client.openMailbox("INBOX", function(error, mailbox) { client.openMailbox("INBOX", function(error, mailbox) {
// if (error) throw error; if (error) throw error;
// // List newest 10 messages // List newest 10 messages
// client.listMessages(-10, function(err, messages) { client.listMessages(-10, function(err, messages) {
// console.log("Listing messages server..."); console.log("Listing messages server...");
// messages.forEach(function(message) { messages.forEach(function(message) {
// console.log(message.UID); console.log(message.UID);
// // client.createMessageStream(message.UID).pipe(process.stdout, {
// // end: false
// // });
// });
// 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) { client.on('error', function(err) {
// console.log('Error'); console.log('Error');
// console.log(err) console.log(err)
// }); });
// client.on('close', function() { client.on('close', function() {
// console.log('DISCONNECTED!'); console.log('DISCONNECTED!');
// }); });

View File

@ -9,7 +9,7 @@
}, },
"dependencies": { "dependencies": {
"express": "~3.2.4", "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" "nodemailer": "~0.4.3"
}, },
"devDependencies": { "devDependencies": {