nodemailer / smtp-server

Create custom SMTP servers on the fly
Other
846 stars 146 forks source link

(Observation) EPIPE error when receiving email from Office365 #63

Closed chriswiggins closed 7 years ago

chriswiggins commented 7 years ago

Hi @andris9,

Loving the library - simple yet straightforward and already have it handling a whole lot of automated incoming emails.

I have an observation that I'm not sure is something you'll want to fix in the core library, however it appears that any email coming from Office365 throws an EPIPE error once the email is received properly. I guess they're closing the socket before we've had the chance to send the TCP FIN? Using node v4.4.0 and smtp-server v1.14.0

Currently I'm just ignoring those errors but happy to help if this is something you want to look into further? Otherwise happy to close the issue as wontfix based on Microsoft's SMTP implementation :-)

chriswiggins commented 7 years ago

Also not using TLS, just plain old SMTP on port 25

andris9 commented 7 years ago

It's a valid concern, if an error is exposed then it should mean that the underlying module is not able to handle it by itself. In this case the module should have been able to handle it as the error happens after client issues QUIT. I fixed it and released as v1.14.1. From now on, if a connection error happens outside message transaction (before MAIL FROM or after the server has accepted the message) it gets silently ignored and connection is closed.

chriswiggins commented 7 years ago

That was fast!! Thanks so much. Updated to latest version