Skip to content

Commit d0470a5

Browse files
authored
fix: handle only one connection socket failure event
Closes #35
1 parent 7f34d7b commit d0470a5

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/smtp/smtp.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ export const checkSMTP = async (
2828
socket.emit('fail', 'Mail server closed connection without sending any data.')
2929
}
3030
})
31-
socket.on('fail', msg => {
31+
socket.once('fail', msg => {
3232
r(createOutput('smtp', msg))
3333
if (socket.writable && !socket.destroyed) {
3434
socket.write(`quit\r\n`)

0 commit comments

Comments
 (0)