Comparing version 0.3.0 to 0.3.1
@@ -1,3 +0,3 @@ | ||
exports.server = require('./smtp/client'); | ||
exports.message = require('./smtp/message'); | ||
exports.SMTP = require('./smtp/smtp'); | ||
exports.server = require('./smtp/client'); | ||
exports.message = require('./smtp/message'); | ||
exports.SMTP = require('./smtp/smtp'); |
{ | ||
"name": "emailjs", | ||
"description": "send text/html emails and attachments (files, streams and strings) from node.js to any smtp server", | ||
"version": "0.3.0", | ||
"version": "0.3.1", | ||
"author": "eleith", | ||
@@ -6,0 +6,0 @@ "contributors":["izuzak", "Hiverness", "mscdex"], |
@@ -1,2 +0,2 @@ | ||
# emailjs (v0.3.0) [![Build Status](https://secure.travis-ci.org/eleith/emailjs.png)](http://travis-ci.org/eleith/emailjs) | ||
# emailjs (v0.3.1) [![Build Status](https://secure.travis-ci.org/eleith/emailjs.png)](http://travis-ci.org/eleith/emailjs) | ||
@@ -3,0 +3,0 @@ |
@@ -381,18 +381,13 @@ var stream = require('stream'); | ||
{ | ||
var loops = Math.floor(data.length / MIMECHUNK); | ||
var leftover= Math.abs(data.length - loops*MIMECHUNK); | ||
var loops = Math.ceil(data.length / MIMECHUNK); | ||
var loop = 0; | ||
var loop = function(index) | ||
while(loop < loops) | ||
{ | ||
if(index < loops) | ||
output(data.substring(MIMECHUNK * index, MIMECHUNK * (index + 1)) + CRLF, loop, [index + 1]); | ||
output(data.substring(MIMECHUNK * loop, MIMECHUNK * (loop + 1)) + CRLF); | ||
loop++; | ||
} | ||
else if(leftover) | ||
output(data.substring(index*MIMECHUNK) + CRLF, callback); | ||
else if(callback) | ||
callback(); | ||
}; | ||
loop(0); | ||
if(callback) | ||
callback(); | ||
}; | ||
@@ -499,5 +494,19 @@ | ||
} | ||
// we can't buffer the data, so ship it out! | ||
else if(bytes > self.buffer.length) | ||
{ | ||
close({message:"internal buffer got too large to handle!"}); | ||
if(self.bufferIndex) | ||
{ | ||
self.emit('data', self.buffer.toString("utf-8", 0, self.bufferIndex)); | ||
self.bufferIndex = 0; | ||
} | ||
var loops = Math.ceil(data.length / self.buffer.length); | ||
var loop = 0; | ||
while(loop < loops) | ||
{ | ||
self.emit('data', data.substring(self.buffer.length*loop, self.buffer.length*(loop + 1))); | ||
loop++; | ||
} | ||
} | ||
@@ -504,0 +513,0 @@ else // we need to clean out the buffer, it is getting full |
@@ -23,3 +23,3 @@ /* | ||
var log = function() | ||
var log = function() | ||
{ | ||
@@ -26,0 +26,0 @@ if(DEBUG) |
Non-existent author
Supply chain riskThe package was published by an npm account that no longer exists.
Found 1 instance in 1 package
55757
1610
1