1
0
mirror of https://github.com/moparisthebest/mail synced 2024-11-29 20:32:15 -05:00

[WO-316] imap-client works

This commit is contained in:
Tankred Hase 2014-04-17 15:13:18 +02:00
parent 7e8c0d75b8
commit 834e0434d5
3 changed files with 17 additions and 11 deletions

View File

@ -127,8 +127,17 @@ module.exports = function(grunt) {
src: [ src: [
'requirejs/require.js', 'requirejs/require.js',
'imap-client/src/*.js', 'imap-client/src/*.js',
'imap-client/node_modules/browserbox/src/*.js',
'imap-client/node_modules/browserbox/node_modules/imap-handler/src/*.js',
'imap-client/node_modules/browserbox/node_modules/mimefuncs/src/*.js',
'imap-client/node_modules/browserbox/node_modules/mimefuncs/node_modules/stringencoding/dist/stringencoding.js',
'imap-client/node_modules/browserbox/node_modules/tcp-socket/src/*.js',
'imap-client/node_modules/browserbox/node_modules/utf7/src/*.js',
'mailreader/src/*.js', 'mailreader/src/*.js',
'pgpmailer/src/*.js', 'mailreader/node_modules/mimeparser/src/*.js',
'mailreader/node_modules/mimeparser/node_modules/addressparser/src/*.js',
'pgpmailer/src/*.js', /* TODO: copy sending deps */
'pgpbuilder/src/*.js' 'pgpbuilder/src/*.js'
], ],
dest: 'src/lib/' dest: 'src/lib/'

View File

@ -11,7 +11,7 @@
}, },
"dependencies": { "dependencies": {
"crypto-lib": "https://github.com/whiteout-io/crypto-lib/tarball/v0.1.1", "crypto-lib": "https://github.com/whiteout-io/crypto-lib/tarball/v0.1.1",
"imap-client": "https://github.com/whiteout-io/imap-client/tarball/v0.2.0", "imap-client": "https://github.com/whiteout-io/imap-client/tarball/master",
"mailreader": "https://github.com/whiteout-io/mailreader/tarball/v0.2.0", "mailreader": "https://github.com/whiteout-io/mailreader/tarball/v0.2.0",
"pgpmailer": "https://github.com/whiteout-io/pgpmailer/tarball/v0.1.0", "pgpmailer": "https://github.com/whiteout-io/pgpmailer/tarball/v0.1.0",
"pgpbuilder": "https://github.com/whiteout-io/pgpbuilder/tarball/v0.1.0", "pgpbuilder": "https://github.com/whiteout-io/pgpbuilder/tarball/v0.1.0",

View File

@ -6,9 +6,9 @@ define(function(require) {
var Auth = require('js/bo/auth'), var Auth = require('js/bo/auth'),
PGP = require('js/crypto/pgp'), PGP = require('js/crypto/pgp'),
PgpMailer = require('pgpmailer'), /* PgpMailer = require('pgpmailer'), */
OAuth = require('js/util/oauth'), OAuth = require('js/util/oauth'),
PgpBuilder = require('pgpbuilder'), /* PgpBuilder = require('pgpbuilder'), */
OutboxBO = require('js/bo/outbox'), OutboxBO = require('js/bo/outbox'),
mailreader = require('mailreader'), mailreader = require('mailreader'),
ImapClient = require('imap-client'), ImapClient = require('imap-client'),
@ -71,7 +71,7 @@ define(function(require) {
self._invitationDao = new InvitationDAO(restDao); self._invitationDao = new InvitationDAO(restDao);
self._keychain = keychain = new KeychainDAO(lawnchairDao, pubkeyDao); self._keychain = keychain = new KeychainDAO(lawnchairDao, pubkeyDao);
self._crypto = pgp = new PGP(); self._crypto = pgp = new PGP();
self._pgpbuilder = pgpbuilder = new PgpBuilder(); self._pgpbuilder = pgpbuilder = {}; //new PgpBuilder();
emailSync = new EmailSync(keychain, userStorage); emailSync = new EmailSync(keychain, userStorage);
self._emailDao = emailDao = new EmailDAO(keychain, pgp, userStorage, pgpbuilder, mailreader, emailSync); self._emailDao = emailDao = new EmailDAO(keychain, pgp, userStorage, pgpbuilder, mailreader, emailSync);
self._outboxBo = new OutboxBO(emailDao, keychain, userStorage); self._outboxBo = new OutboxBO(emailDao, keychain, userStorage);
@ -107,11 +107,8 @@ define(function(require) {
var auth, imapOptions, imapClient, smtpOptions, pgpMailer; var auth, imapOptions, imapClient, smtpOptions, pgpMailer;
auth = { auth = {
XOAuth2: { user: credentials.emailAddress,
user: credentials.emailAddress, xoauth2: credentials.oauthToken
clientId: config.gmail.clientId,
accessToken: credentials.oauthToken
}
}; };
imapOptions = { imapOptions = {
secure: config.gmail.imap.secure, secure: config.gmail.imap.secure,
@ -131,7 +128,7 @@ define(function(require) {
onError: console.error onError: console.error
}; };
pgpMailer = new PgpMailer(smtpOptions, self._pgpbuilder); //pgpMailer = new PgpMailer(smtpOptions, self._pgpbuilder);
imapClient = new ImapClient(imapOptions, mailreader); imapClient = new ImapClient(imapOptions, mailreader);
imapClient.onError = onImapError; imapClient.onError = onImapError;