Skip to content

Commit

Permalink
Merge pull request mfbx9da4#40 from micalevisk/patch-1
Browse files Browse the repository at this point in the history
fix: handle only one connection socket failure event
  • Loading branch information
mfbx9da4 authored Dec 20, 2021
2 parents 9aaa980 + d0470a5 commit f0ce7b7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/smtp/smtp.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ export const checkSMTP = async (
socket.emit('fail', 'Mail server closed connection without sending any data.')
}
})
socket.on('fail', msg => {
socket.once('fail', msg => {
r(createOutput('smtp', msg))
if (socket.writable && !socket.destroyed) {
socket.write(`quit\r\n`)
Expand Down

0 comments on commit f0ce7b7

Please sign in to comment.