mirror of
https://github.com/moparisthebest/mail
synced 2024-11-23 01:12:19 -05:00
fetching a message over TSL/IMAP works
This commit is contained in:
parent
79b297e624
commit
472c4125ab
24
gmail-test-proxy/build.js
Normal file
24
gmail-test-proxy/build.js
Normal file
@ -0,0 +1,24 @@
|
|||||||
|
'use strict';
|
||||||
|
|
||||||
|
var browserify = require('browserify'),
|
||||||
|
fs = require('fs'),
|
||||||
|
path = require('path');
|
||||||
|
|
||||||
|
var b = browserify('./imap-client.js');
|
||||||
|
b.require('net-chromeify', {
|
||||||
|
expose: 'net'
|
||||||
|
});
|
||||||
|
b.require('tls-chromeify', {
|
||||||
|
expose: 'tls'
|
||||||
|
});
|
||||||
|
|
||||||
|
b.bundle(function(err, src) {
|
||||||
|
if (err) {
|
||||||
|
throw err;
|
||||||
|
}
|
||||||
|
|
||||||
|
var file = path.join(__dirname + '/foo.js');
|
||||||
|
fs.writeFileSync(file, src);
|
||||||
|
|
||||||
|
console.log('bundle written to: ' + file);
|
||||||
|
});
|
@ -6,6 +6,7 @@
|
|||||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||||
|
|
||||||
<!-- The Scripts -->
|
<!-- The Scripts -->
|
||||||
|
<script src="lib/forge.min.js"></script>
|
||||||
<script src="foo.js"></script>
|
<script src="foo.js"></script>
|
||||||
</head>
|
</head>
|
||||||
|
|
||||||
|
@ -1,13 +0,0 @@
|
|||||||
var assert = require('assert'),
|
|
||||||
inbox = require("inbox");
|
|
||||||
|
|
||||||
describe('IMAP client', function() {
|
|
||||||
|
|
||||||
describe("Init", function() {
|
|
||||||
|
|
||||||
it('should work', function(done) {
|
|
||||||
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
});
|
|
@ -2,8 +2,8 @@
|
|||||||
|
|
||||||
var inbox = require('inbox');
|
var inbox = require('inbox');
|
||||||
|
|
||||||
var client = inbox.createConnection(143, "imapmail.t-online.de", {
|
var client = inbox.createConnection(false, "imap.gmail.com", {
|
||||||
secureConnection: false,
|
secureConnection: true,
|
||||||
// auth: {
|
// auth: {
|
||||||
// XOAuth2: {
|
// XOAuth2: {
|
||||||
// user: "safewithme.testuser@gmail.com",
|
// user: "safewithme.testuser@gmail.com",
|
||||||
@ -11,14 +11,14 @@ var client = inbox.createConnection(143, "imapmail.t-online.de", {
|
|||||||
// accessToken: "ya29.AHES6ZTVj9_kCdP8zEYCA9OZ6fvTqT_TmCe4UsmYPF3ffYM8eGHX2uw"
|
// accessToken: "ya29.AHES6ZTVj9_kCdP8zEYCA9OZ6fvTqT_TmCe4UsmYPF3ffYM8eGHX2uw"
|
||||||
// }
|
// }
|
||||||
// }
|
// }
|
||||||
// auth: {
|
|
||||||
// user: "safewithme.testuser@gmail.com",
|
|
||||||
// pass: "hellosafe"
|
|
||||||
// }
|
|
||||||
auth: {
|
auth: {
|
||||||
user: 'whiteout.test@t-online.de',
|
user: "safewithme.testuser@gmail.com",
|
||||||
pass: '@6IyFg1SIlWH91Co' // 'R2nUXJlh9JKV3ZEp1#jH'
|
pass: "hellosafe"
|
||||||
}
|
}
|
||||||
|
// auth: {
|
||||||
|
// user: 'whiteout.test@t-online.de',
|
||||||
|
// pass: '@6IyFg1SIlWH91Co' // 'R2nUXJlh9JKV3ZEp1#jH'
|
||||||
|
// }
|
||||||
});
|
});
|
||||||
|
|
||||||
console.log("Connecting to server...");
|
console.log("Connecting to server...");
|
||||||
@ -32,17 +32,17 @@ client.on("connect", function() {
|
|||||||
if (error) throw error;
|
if (error) throw error;
|
||||||
|
|
||||||
// List newest 10 messages
|
// List newest 10 messages
|
||||||
client.listMessages(-10, function(err, messages) {
|
client.listMessages(-1, 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);
|
||||||
|
|
||||||
var msgStream = client.createMessageStream(message.UID);
|
var msgStream = client.createMessageStream(message.UID);
|
||||||
msgStream.on('data', function(chunk) {
|
msgStream.on('data', function(chunk) {
|
||||||
console.log(chunk.toString('utf8'));
|
console.log(chunk.toString('utf8'));
|
||||||
})
|
})
|
||||||
msgStream.on('end', function() {
|
msgStream.on('end', function() {
|
||||||
console.log('\n\nthere will be no more data.');
|
console.log('\n\nthere will be no more data.');
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
1
gmail-test-proxy/lib/forge.min.js
vendored
Normal file
1
gmail-test-proxy/lib/forge.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
@ -8,13 +8,15 @@
|
|||||||
"test": "grunt test && test/test.sh"
|
"test": "grunt test && test/test.sh"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"express": "~3.2.4",
|
"net-chromeify": "https://github.com/whiteout-io/net-chromeify/tarball/rewrite",
|
||||||
"inbox": "https://github.com/whiteout-io/inbox/tarball/chrome",
|
"tls-chromeify": "https://github.com/whiteout-io/tls-chromeify/tarball/node-test",
|
||||||
|
"inbox": "https://github.com/whiteout-io/inbox/tarball/iconv-lite",
|
||||||
"nodemailer": "~0.4.3"
|
"nodemailer": "~0.4.3"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"mocha": "~1.10.0",
|
"browserify": "*",
|
||||||
"chai": "~1.6.0",
|
"mocha": "~1.12.0",
|
||||||
|
"chai": "~1.7.2",
|
||||||
"grunt": "~0.4.1",
|
"grunt": "~0.4.1",
|
||||||
"grunt-contrib-jshint": "~0.5.3"
|
"grunt-contrib-jshint": "~0.5.3"
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user