mirror of
https://github.com/moparisthebest/mail
synced 2025-02-07 10:30:18 -05:00
Merge pull request #87 from whiteout-io/dev/WO-455
fix signature behavior
This commit is contained in:
commit
021510d936
@ -13,8 +13,8 @@
|
|||||||
"crypto-lib": "https://github.com/whiteout-io/crypto-lib/tarball/v0.2.0",
|
"crypto-lib": "https://github.com/whiteout-io/crypto-lib/tarball/v0.2.0",
|
||||||
"imap-client": "https://github.com/whiteout-io/imap-client/tarball/v0.3.4",
|
"imap-client": "https://github.com/whiteout-io/imap-client/tarball/v0.3.4",
|
||||||
"mailreader": "https://github.com/whiteout-io/mailreader/tarball/v0.3.4",
|
"mailreader": "https://github.com/whiteout-io/mailreader/tarball/v0.3.4",
|
||||||
"pgpmailer": "https://github.com/whiteout-io/pgpmailer/tarball/v0.3.5",
|
"pgpmailer": "https://github.com/whiteout-io/pgpmailer/tarball/v0.3.6",
|
||||||
"pgpbuilder": "https://github.com/whiteout-io/pgpbuilder/tarball/v0.3.4",
|
"pgpbuilder": "https://github.com/whiteout-io/pgpbuilder/tarball/v0.3.5",
|
||||||
"requirejs": "2.1.14",
|
"requirejs": "2.1.14",
|
||||||
"axe": "https://github.com/whiteout-io/axe/tarball/v0.0.2"
|
"axe": "https://github.com/whiteout-io/axe/tarball/v0.0.2"
|
||||||
},
|
},
|
||||||
|
@ -825,5 +825,67 @@ define(function(require) {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
describe('Compose-Send-Receive-Read round trip', function() {
|
||||||
|
var currentFolder;
|
||||||
|
|
||||||
|
beforeEach(function(done) {
|
||||||
|
emailDao.openFolder({
|
||||||
|
folder: {
|
||||||
|
path: 'INBOX'
|
||||||
|
}
|
||||||
|
}, function(err) {
|
||||||
|
expect(err).to.not.exist;
|
||||||
|
currentFolder = emailDao._account.folders.filter(function(folder) {
|
||||||
|
return folder.path === 'INBOX';
|
||||||
|
}).pop();
|
||||||
|
expect(currentFolder).to.exist;
|
||||||
|
done();
|
||||||
|
});
|
||||||
|
|
||||||
|
sinon.stub(smtpServer, 'onmail', function(mail) {
|
||||||
|
setTimeout(function() {
|
||||||
|
imapServer.appendMessage(currentFolder.path, [], false, mail.body);
|
||||||
|
}, 1000);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
afterEach(function() {
|
||||||
|
smtpServer.onmail.restore();
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should send & receive a signed plaintext message', function(done) {
|
||||||
|
var expectedBody = "asdasdasdasdasdasdasdasdasdasdasdasd asdasdasdasdasdasdasdasdasdasdasdasd asdasdasdasdasdasdasdasdasdasdasdasd asdasdasdasdasdasdasdasdasdasdasdasd asdasdasdasdasdasdasdasdasdasdasdasd asdasdasdasdasdasdasdasdasdasdasdasd asdasdasdasdasdasdasdasdasdasdasdasd asdasdasdasdasdasdasdasdasdasdasdasd asdasdasdasdasdasdasdasdasdasdasdasd asdasdasdasdasdasdasdasdasdasdasdasd asdasdasdasdasdasdasdasdasdasdasdasd ";
|
||||||
|
|
||||||
|
emailDao.onIncomingMessage = function() {
|
||||||
|
emailDao.onIncomingMessage = function(messages) {
|
||||||
|
emailDao.getBody({
|
||||||
|
folder: currentFolder,
|
||||||
|
message: messages[0]
|
||||||
|
}, function(err, message) {
|
||||||
|
expect(err).to.not.exist;
|
||||||
|
expect(message.encrypted).to.be.false;
|
||||||
|
expect(message.signed).to.be.true;
|
||||||
|
expect(message.signaturesValid).to.be.true;
|
||||||
|
expect(message.attachments.length).to.equal(0);
|
||||||
|
expect(message.body).to.equal(expectedBody);
|
||||||
|
done();
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
emailDao.sendPlaintext({
|
||||||
|
smtpclient: smtpClient,
|
||||||
|
email: {
|
||||||
|
from: [testAccount.user],
|
||||||
|
to: [testAccount.user],
|
||||||
|
subject: 'plaintext test',
|
||||||
|
body: expectedBody
|
||||||
|
}
|
||||||
|
}, function(err) {
|
||||||
|
expect(err).to.not.exist;
|
||||||
|
});
|
||||||
|
};
|
||||||
|
});
|
||||||
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
Loading…
Reference in New Issue
Block a user