Comparing version 0.3.11 to 0.3.12
{ | ||
"name": "emailjs", | ||
"description": "send text/html emails and attachments (files, streams and strings) from node.js to any smtp server", | ||
"version": "0.3.11", | ||
"version": "0.3.12", | ||
"author": "eleith", | ||
@@ -15,3 +15,4 @@ "contributors":["izuzak", "Hiverness", "mscdex", "jimmybergman"], | ||
"moment" : "= 1.7.0", | ||
"mimelib": "0.2.14" | ||
"mimelib": "0.2.14", | ||
"starttls": "0.2.1" | ||
}, | ||
@@ -18,0 +19,0 @@ "optionalDependencies": |
@@ -165,2 +165,4 @@ # emailjs [![Build Status](https://secure.travis-ci.org/eleith/emailjs.png)](http://travis-ci.org/eleith/emailjs) | ||
name // name to give the file as perceived by the recipient | ||
charset // charset to encode attatchment in | ||
method // method to send attachment as (used by calendar invites) | ||
alternative // if true, will be attached inline as an alternative (also defaults type='text/html') | ||
@@ -167,0 +169,0 @@ inline // if true, will be attached inline |
@@ -293,3 +293,5 @@ var stream = require('stream'); | ||
{ | ||
'content-type': attachment.type + (attachment.charset ? "; charset=" + attachment.charset : ""), | ||
'content-type': attachment.type + | ||
(attachment.charset ? "; charset=" + attachment.charset : "") + | ||
(attachment.method ? "; method=" + attachment.method : ""), | ||
'content-transfer-encoding': 'base64', | ||
@@ -296,0 +298,0 @@ 'content-disposition': attachment.inline ? 'inline' : 'attachment; filename="' + mimelib.encodeMimeWord(attachment.name, 'Q', 'utf-8') + '"' |
@@ -30,6 +30,5 @@ var SMTPError = require('./error'); | ||
watch = function() | ||
watch = function(data) | ||
{ | ||
var data = stream.read(); | ||
//var data = stream.read(); | ||
if (data !== null) { | ||
@@ -57,3 +56,4 @@ var decoded = data.toString(); | ||
stream.removeAllListeners('response'); | ||
stream.removeListener('readable', watch); | ||
//stream.removeListener('readable', watch); | ||
stream.removeListener('data', watch); | ||
stream.removeListener('end', end); | ||
@@ -67,3 +67,4 @@ stream.removeListener('close', close); | ||
stream.on('readable', watch); | ||
//stream.on('readable', watch); | ||
stream.on('data', watch); | ||
stream.on('end', end); | ||
@@ -70,0 +71,0 @@ stream.on('close', close); |
@@ -10,3 +10,3 @@ /* | ||
var events = require('events'); | ||
var starttls = require('./tls'); | ||
var starttls = require('starttls'); | ||
@@ -252,3 +252,14 @@ var SMTPResponse = require('./response'); | ||
secured_socket = starttls.secure(self.sock, self.tls, secured); | ||
//secured_socket = starttls.secure(self.sock, self.tls, secured); | ||
secured_socket = starttls({ | ||
socket: self.sock, | ||
host: self.host, | ||
port: self.port, | ||
pair: tls.createSecurePair(crypto.createCredentials(self.tls), false) | ||
}, secured).cleartext; | ||
secured_socket.on('error', function(err) { | ||
self.close(true); | ||
caller(callback, err); | ||
}); | ||
} | ||
@@ -426,3 +437,3 @@ }; | ||
encode_plain = function() { | ||
return (new Buffer("\0" + login.user() + "\0" + login.password())).toString("base64"); | ||
return (new Buffer("\u0000" + login.user() + "\u0000" + login.password())).toString("base64"); | ||
}, | ||
@@ -433,3 +444,3 @@ | ||
// see: https://developers.google.com/gmail/xoauth2_protocol | ||
return (new Buffer("user=" + login.user() + "\1auth=Bearer " + login.password() + "\1\1")).toString("base64"); | ||
return (new Buffer("user=" + login.user() + "\u0001auth=Bearer " + login.password() + "\u0001\u0001")).toString("base64"); | ||
}; | ||
@@ -436,0 +447,0 @@ |
186
2
58482
4
10
1582
+ Addedstarttls@0.2.1
+ Addedstarttls@0.2.1(transitive)