Comparing version 1.2.4 to 1.2.5
# Changelog | ||
## v1.2.5 2015-09-24 | ||
* Fixed a bug where ascii html content was not properly handled | ||
* Updated buildmail for stricter quoted printable encoding | ||
## v1.2.4 2015-04-15 | ||
@@ -4,0 +9,0 @@ |
{ | ||
"name": "buildmail", | ||
"version": "1.2.4", | ||
"version": "1.2.5", | ||
"description": "buildmail is a low level rfc2822 message composer. Define your own mime tree, no magic included.", | ||
@@ -23,12 +23,13 @@ "author": "Andris Reinman <andris@kreata.ee>", | ||
"libbase64": "^0.1.0", | ||
"libmime": "^1.0.0", | ||
"libqp": "^1.0.0" | ||
"libmime": "^1.1.0", | ||
"libqp": "^1.1.0" | ||
}, | ||
"devDependencies": { | ||
"chai": "~2.2.0", | ||
"chai": "~3.3.0", | ||
"grunt": "~0.4.5", | ||
"grunt-contrib-jshint": "~0.11.1", | ||
"grunt-contrib-jshint": "~0.11.3", | ||
"grunt-mocha-test": "~0.12.7", | ||
"sinon": "^1.14.1" | ||
"mocha": "^2.3.3", | ||
"sinon": "^1.17.0" | ||
} | ||
} |
@@ -386,3 +386,3 @@ 'use strict'; | ||
// If there are no special symbols, no need to modify the text | ||
if (this._isPlainText) { | ||
if (this._isPlainText && (/^text\/plain/i.test(contentType) || !this._canUseFlowedContent)) { | ||
transferEncoding = '7bit'; | ||
@@ -737,3 +737,3 @@ } else { | ||
trim().toLowerCase(). | ||
// use uppercase words, except MIME | ||
// use uppercase words, except MIME | ||
replace(/^MIME\b|^[a-z]|\-[a-z]/ig, function(c) { | ||
@@ -876,4 +876,4 @@ return c.toUpperCase(); | ||
if (!uniqueList.filter(function(a) { | ||
return a.address === address.address; | ||
}).length) { | ||
return a.address === address.address; | ||
}).length) { | ||
uniqueList.push(address); | ||
@@ -880,0 +880,0 @@ } |
@@ -11,3 +11,3 @@ 'use strict'; | ||
var expect = chai.expect; | ||
chai.Assertion.includeStack = true; | ||
chai.config.includeStack = true; | ||
@@ -394,2 +394,56 @@ describe('Buildmail', function() { | ||
it('should flow text', function(done) { | ||
var mb = new Buildmail('text/plain'). | ||
setContent('a b c d e f g h i j k l m o p q r s t u w x y z 1 2 3 4 5 6 7 8 9 0 a b c d e f g h i j k l m o p q r s t u w x y z 1 2 3 4 5 6 7 8 9 0'); | ||
mb.build(function(err, msg) { | ||
msg = msg.toString(); | ||
expect(/^Content-Type: text\/plain; format=flowed$/m.test(msg)).to.be.true; | ||
expect(/^Content-Transfer-Encoding: 7bit$/m.test(msg)).to.be.true; | ||
msg = msg.split('\r\n\r\n'); | ||
msg.shift(); | ||
msg = msg.join('\r\n\r\n'); | ||
expect(msg).to.equal('a b c d e f g h i j k l m o p q r s t u w x y z 1 2 3 4 5 6 7 8 9 0 a b c d \r\ne f g h i j k l m o p q r s t u w x y z 1 2 3 4 5 6 7 8 9 0'); | ||
done(); | ||
}); | ||
}); | ||
it('should not flow html', function(done) { | ||
var mb = new Buildmail('text/html'). | ||
setContent('a b c d e f g h i j k l m o p q r s t u w x y z 1 2 3 4 5 6 7 8 9 0 a b c d e f g h i j k l m o p q r s t u w x y z 1 2 3 4 5 6 7 8 9 0'); | ||
mb.build(function(err, msg) { | ||
msg = msg.toString(); | ||
expect(/^Content-Type: text\/html$/m.test(msg)).to.be.true; | ||
expect(/^Content-Transfer-Encoding: quoted-printable$/m.test(msg)).to.be.true; | ||
msg = msg.split('\r\n\r\n'); | ||
msg.shift(); | ||
msg = msg.join('\r\n\r\n'); | ||
expect(msg).to.equal('a b c d e f g h i j k l m o p q r s t u w x y z 1 2 3 4 5 6 7 8 9 0 a b c d=\r\n e f g h i j k l m o p q r s t u w x y z 1 2 3 4 5 6 7 8 9 =\r\n0'); | ||
done(); | ||
}); | ||
}); | ||
it('should use 7bit for html', function(done) { | ||
var mb = new Buildmail('text/html'). | ||
setContent('a b c d e f g h i j k l m o p\r\nq r s t u w x y z 1 2 3 4 5 6\r\n7 8 9 0 a b c d e f g h i j k\r\nl m o p q r s t u w x y z\r\n1 2 3 4 5 6 7 8 9 0'); | ||
mb.build(function(err, msg) { | ||
msg = msg.toString(); | ||
expect(/^Content-Type: text\/html$/m.test(msg)).to.be.true; | ||
expect(/^Content-Transfer-Encoding: 7bit$/m.test(msg)).to.be.true; | ||
msg = msg.split('\r\n\r\n'); | ||
msg.shift(); | ||
msg = msg.join('\r\n\r\n'); | ||
expect(msg).to.equal('a b c d e f g h i j k l m o p\r\nq r s t u w x y z 1 2 3 4 5 6\r\n7 8 9 0 a b c d e f g h i j k\r\nl m o p q r s t u w x y z\r\n1 2 3 4 5 6 7 8 9 0'); | ||
done(); | ||
}); | ||
}); | ||
it('should fetch ascii filename', function(done) { | ||
@@ -396,0 +450,0 @@ var mb = new Buildmail('text/plain', { |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
80881
1679
6
Updatedlibmime@^1.1.0
Updatedlibqp@^1.1.0