deep-email-validator icon indicating copy to clipboard operation
deep-email-validator copied to clipboard

No handling for close event in smtp validation

Open StructByLightning opened this issue 3 years ago • 1 comments

There's no event handler for the close event in the smtp validator. If you give it the email [email protected] it'll never resolve its promise and your script will exit without an error.

There should be a block like this:

    socket.on("close", (err)=>{
      //resolve the promise with something
    })

in src/smtp/smtp.ts

StructByLightning avatar Nov 15 '21 22:11 StructByLightning

For quick fix I added in node_modules/deep-email-validator/dist/smtp/smtp.js

socket.on('close', () => {                                     
   r(output_1.createOutput('smtp', 'Socket closed'));           
})

Thank you @StructByLightning for pointing out.

I am not familiar to TS, so someone has to make pull request with test case.

gagan-bansal avatar Dec 04 '21 04:12 gagan-bansal