Skip to content

Commit

Permalink
messagestream: don't send default settings (#3290)
Browse files Browse the repository at this point in the history
I'm pretty sure most of these are anachronisms, left over from when message_stream didn't have robust options handling and one *had* to pass in an object or an exception was thrown. Now requests to [message_stream.pipe](https://github.com/haraka/message-stream/blob/master/index.js#L316) have a default argument object.

Checklist:
- [ ] docs updated
- [ ] tests updated
- [x] [Changes](https://github.com/haraka/Haraka/blob/master/Changes.md)
updated
  • Loading branch information
msimerson authored Apr 15, 2024
1 parent 502ce30 commit 0215754
Show file tree
Hide file tree
Showing 8 changed files with 19 additions and 18 deletions.
1 change: 1 addition & 0 deletions Changes.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
- new NPM plugin dns-list, repackages dnsbl, dnswl, backscatterer #3313
- test: add a connection.response test case with DSN #3305
- deps: bump all versions to latest #3303
- when using message-stream, don't send default options #3290
- auth_base: enable disabling constrain_sender at runtime #3298
- connection: support IPv6 when setting remote.is_private #3295
- in setTLS, replace forEach with for...of
Expand Down
2 changes: 1 addition & 1 deletion outbound/hmail.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ const dns = require('dns');
const path = require('path');
const net = require('net');

const { Address } = require('address-rfc2821');
const { Address } = require('address-rfc2821');
const config = require('haraka-config');
const constants = require('haraka-constants');
const DSN = require('haraka-dsn');
Expand Down
4 changes: 2 additions & 2 deletions outbound/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ const fs = require('fs');
const path = require('path');

const async = require('async');
const { Address } = require('address-rfc2821');
const { Address } = require('address-rfc2821');
const config = require('haraka-config');
const constants = require('haraka-constants');
const net_utils = require('haraka-net-utils');
Expand Down Expand Up @@ -308,7 +308,7 @@ exports.process_delivery = function (ok_paths, todo, hmails, cb) {
})

this.build_todo(todo, ws, () => {
todo.message_stream.pipe(ws, { line_endings: '\r\n', dot_stuffing: true, ending_dot: false });
todo.message_stream.pipe(ws, { dot_stuffing: true });
});
}

Expand Down
22 changes: 11 additions & 11 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
},
"dependencies": {
"address-rfc2821": "^2.1.2",
"address-rfc2822": "^2.2.0",
"address-rfc2822": "^2.2.1",
"async": "^3.2.5",
"daemon": "~1.1.0",
"ipaddr.js": "~2.1.0",
Expand All @@ -32,35 +32,35 @@
"sprintf-js": "~1.1.3",
"haraka-config": "^1.1.0",
"haraka-constants": "^1.0.6",
"haraka-dsn": "^1.0.4",
"haraka-email-message": "^1.2.1",
"haraka-dsn": "^1.0.5",
"haraka-email-message": "^1.2.2",
"haraka-message-stream": "^1.2.1",
"haraka-net-utils": "^1.5.4",
"haraka-notes": "^1.0.6",
"haraka-plugin-attachment": "^1.1.0",
"haraka-notes": "^1.0.7",
"haraka-plugin-attachment": "^1.1.2",
"haraka-plugin-dkim": "^1.0.2",
"haraka-plugin-spf": "1.2.4",
"haraka-plugin-redis": "^2.0.6",
"haraka-results": "^2.2.3",
"haraka-results": "^2.2.4",
"haraka-tld": "^1.2.1",
"haraka-utils": "^1.1.1",
"haraka-utils": "^1.1.2",
"openssl-wrapper": "^0.3.4",
"redis": "~4.6.13",
"sockaddr": "^1.0.1"
},
"optionalDependencies": {
"haraka-plugin-access": "^1.1.5",
"haraka-plugin-access": "^1.1.6",
"haraka-plugin-aliases": "^1.0.1",
"haraka-plugin-asn": "^2.0.2",
"haraka-plugin-auth-ldap": "^1.1.0",
"haraka-plugin-dcc": "^1.0.2",
"haraka-plugin-dns-list": "^1.1.0",
"haraka-plugin-dns-list": "^1.2.0",
"haraka-plugin-elasticsearch": "^8.0.2",
"haraka-plugin-fcrdns": "^1.1.0",
"haraka-plugin-graph": "^1.0.5",
"haraka-plugin-geoip": "^1.1.0",
"haraka-plugin-headers": "^1.0.4",
"haraka-plugin-karma": "^2.1.3",
"haraka-plugin-karma": "^2.1.4",
"haraka-plugin-limit": "^1.2.1",
"haraka-plugin-p0f": "^1.0.9",
"haraka-plugin-qmail-deliverable": "^1.2.1",
Expand All @@ -78,7 +78,7 @@
"nodeunit-x": "^0.16.0",
"haraka-test-fixtures": "^1.3.7",
"mock-require": "^3.0.3",
"eslint-plugin-haraka": "^1.0.15",
"eslint-plugin-haraka": "^1.0.16",
"nodemailer": "^6.9.13"
},
"bugs": {
Expand Down
2 changes: 1 addition & 1 deletion plugins/avg.js
Original file line number Diff line number Diff line change
Expand Up @@ -158,5 +158,5 @@ exports.hook_data_post = function (next, connection) {
socket.connect((plugin.cfg.main.port || 54322), plugin.cfg.main.host);
});

connection.transaction.message_stream.pipe(ws, { line_endings: '\r\n' });
connection.transaction.message_stream.pipe(ws);
}
2 changes: 1 addition & 1 deletion plugins/esets.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,5 +67,5 @@ exports.hook_data_post = function (next, connection) {
wsOnClose);
});

connection.transaction.message_stream.pipe(ws, { line_endings: '\r\n' });
connection.transaction.message_stream.pipe(ws);
}
2 changes: 1 addition & 1 deletion plugins/messagesniffer.js
Original file line number Diff line number Diff line change
Expand Up @@ -321,7 +321,7 @@ exports.hook_data_post = function (next, connection) {
});

// TODO: we only need the first 64Kb of the message
txn.message_stream.pipe(ws, { line_endings: '\r\n' });
txn.message_stream.pipe(ws);
}

exports.hook_disconnect = function (next, connection) {
Expand Down
2 changes: 1 addition & 1 deletion tests/outbound/hmail.js
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ exports.HMailItem = {
// test.equals(this.hmail.todo.message_stream.headers.length, 22);

const ds = this.hmail.data_stream()
ds.pipe(ws, { line_endings: '\r\n', dot_stuffing: true, ending_dot: false });
ds.pipe(ws, { dot_stuffing: true });

ws.on('close', () => {
// console.log(this.hmail.todo)
Expand Down

0 comments on commit 0215754

Please sign in to comment.