Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 13 additions & 3 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:
strategy:
matrix:
node: [16.x, 18.x, 20.x, 22.x]
os: [ubuntu-20.04]
os: [ubuntu-latest]
runs-on: ${{ matrix.os }}
# Service containers to run with `container-job`
services:
Expand All @@ -31,15 +31,25 @@ jobs:
- name: Start MongoDB
uses: supercharge/mongodb-github-action@1.7.0
with:
mongodb-version: 4.4
mongodb-version: 6.0
mongodb-port: 27017
mongodb-db: wildduck-test

- name: Use Node.js ${{ matrix.node }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node }}
- run: which mongo

- name: Install mongosh
run: |
sudo apt-get update
sudo apt-get install -y wget gnupg
wget -qO - https://www.mongodb.org/static/pgp/server-6.0.asc | sudo apt-key add -
echo "deb [ arch=amd64,arm64 ] https://repo.mongodb.org/apt/ubuntu jammy/mongodb-org/6.0 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-6.0.list
sudo apt-get update
sudo apt-get install -y mongodb-mongosh

- run: which mongosh
- run: npm install
- name: Run tests
run: npm run runtest
Expand Down
5 changes: 5 additions & 0 deletions lib/smtp-interface.js
Original file line number Diff line number Diff line change
Expand Up @@ -284,6 +284,11 @@ class SMTPInterface {
onConnect: (session, callback) => {
session.interface = this.interface;

if (this.closing) {
let err = new Error('Server shutdown in progress');
return setImmediate(() => callback(err));
}

plugins.handler.runHooks('smtp:connect', [session], err => {
if (err) {
return setImmediate(() => callback(err));
Expand Down