Skip to content

Commit

Permalink
tweak
Browse files Browse the repository at this point in the history
  • Loading branch information
msimerson committed Apr 14, 2024
1 parent a25f4ac commit 021365f
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 16 deletions.
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,11 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/).

### [1.3.6] - 2024-04-14

- connection: import more from haraka/Haraka/connection
- transaction: sync with haraka/Haraka
- connection: import more from haraka/Haraka/connection
- test(conn): expect more connection properties
- doc(CONTRIBUTING): added
- doc(README): added example setup

### [1.3.5] - 2024-04-07

Expand Down
26 changes: 12 additions & 14 deletions lib/connection.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,7 @@ class Connection {
constructor(client, server, cfg) {
this.client = client
this.server = server
this.cfg =
cfg ||
config.get('smtp.ini', {
booleans: [
'+main.smtputf8',
'+headers.add_received',
'+headers.clean_auth_results',
],
})
this.cfg = cfg

this.local = {
ip: null,
Expand Down Expand Up @@ -250,9 +242,15 @@ class Connection {

exports.Connection = Connection

exports.createConnection = function (client, server) {
if (typeof client === 'undefined') client = {}
if (typeof server === 'undefined') server = {}

return new Connection(client, server)
exports.createConnection = function (client = {}, server = {}, cfg = {}) {
if (!cfg || Object.keys(cfg).length === 0) {
cfg = config.get('smtp.ini', {
booleans: [
'+main.smtputf8',
'+headers.add_received',
'+headers.clean_auth_results',
],
})
}
return new Connection(client, server, cfg)
}
2 changes: 1 addition & 1 deletion lib/transaction.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
const util = require('util')

const Notes = require('haraka-notes')
const utils = require('haraka-utils');
const utils = require('haraka-utils')

Check warning on line 6 in lib/transaction.js

View workflow job for this annotation

GitHub Actions / lint / lint

'utils' is assigned a value but never used

Check warning on line 6 in lib/transaction.js

View workflow job for this annotation

GitHub Actions / lint / lint

'utils' is assigned a value but never used
const message = require('haraka-email-message')

const logger = require('./logger')
Expand Down

0 comments on commit 021365f

Please sign in to comment.