smtp-server icon indicating copy to clipboard operation
smtp-server copied to clipboard

Can't receive email from Microsoft

Open binary64 opened this issue 6 years ago • 11 comments

Hi so I have smtp-server running on port 25. It receives email sent from gmail.com just fine (well, there is a 60 second delay, presumably gmail is trying TLS first, and it times out, then it tries 25).

However, emails sent from Microsoft/Hotmail do not come through at all.

I'm wondering how to set up TLS on port 587 or something, so I can receive from Microsoft.

I saw you have sniOptions but the documentation doesn't describe its contents. Is there any possibility of a small example showing how to host a secure smtp server?

Many thanks! Excellent project

binary64 avatar Jun 22 '18 14:06 binary64

Hi @binary64 , i am also trying to set up a smtp server which recieves emails ( using smtp-server module ), but i cant recieve emails. I turned the logger on, and it keeps showing mei Error : socket closed unexpectedly I am attaching my code, please tell me if you did anything different

Note - i am using port 9000 because i have setup port forwading in my router (to forward incoming 25 requests to 9000 )

SMTPserver.txt

Shadowfox38 avatar Mar 24 '20 14:03 Shadowfox38

Hey @binary64 @Shadowfox38,

Did you guys manage to resolve your issues with Microsoft? I have a secure smtp-server instance, and I'm trying to add my email address to Outlook, but I get the following error:

Error: Socket closed unexpectedly
    at TLSSocket.onError (/usr/src/app/node_modules/smtp-server/lib/smtp-server.js:457:29)
    at Object.onceWrapper (node:events:483:26)
    at TLSSocket.emit (node:events:388:22)
    at node:net:661:12
    at Socket.done (node:_tls_wrap:564:7)
    at Object.onceWrapper (node:events:483:26)
    at Socket.emit (node:events:376:20)
    at TCP.<anonymous> (node:net:661:12)

Any direction would be great!

dextermb avatar Nov 26 '20 11:11 dextermb

Just turn the secure option off :)

Apparently the initial handshake is insecure, and it then upgrades using TLS (I'm not sure about this though)

Shadowfox38 avatar Nov 26 '20 11:11 Shadowfox38

Just turn the secure option off :)

Hm. Interesting. I'll give this a go, but I'm not sure how it'd upgrade.

Edit: @shadowfox38 I'm still getting the same issue when secure is not set to true.

dextermb avatar Nov 26 '20 11:11 dextermb

As a follow up Outlook desktop tries to use the server as an IMAP server rather than an SMTP user by going through the "Add account" dialogs.

I used Outlook web and added a CA along with my certificates, selected SMTP only, and it now works flawlessly.

I believe you can add send only accounts on Outlook desktop but it's more hidden

dextermb avatar Nov 30 '20 08:11 dextermb

Any help with this? Nothing here works for me. I have been struggling without any solutions.

Zonalds avatar Jun 13 '22 20:06 Zonalds

flawlessly

Hi, @dextermb, can you explain a bit more, when you said "added a CA along with..."? do you use an Outlook certificate?

I'm facing the same issues but trying to connect Dynamics CRM with smtp-server; but with others email clients works flawlessly without any issues.

Error: Socket closed unexpectedly
    at TLSSocket.onError (/opt/smtp-signature-relay/node_modules/smtp-server/lib/smtp-server.js:473:29)
    at Object.onceWrapper (events.js:286:20)
    at TLSSocket.emit (events.js:203:15)
    at _handle.close (net.js:607:12)
    at Socket.done (_tls_wrap.js:388:7)
    at Object.onceWrapper (events.js:286:20)
    at Socket.emit (events.js:198:13)
    at TCP._handle.close (net.js:607:12)
Emitted 'error' event at:
    at SMTPServer._onError (/opt/smtp-signature-relay/node_modules/smtp-server/lib/smtp-server.js:332:14)
    at _upgrade (/opt/smtp-signature-relay/node_modules/smtp-server/lib/smtp-server.js:72:41)
    at TLSSocket.onError (/opt/smtp-signature-relay/node_modules/smtp-server/lib/smtp-server.js:473:13)
    at Object.onceWrapper (events.js:286:20)
    [... lines matching original stack trace ...]
    at TCP._handle.close (net.js:607:12)

fulvi0 avatar Jun 15 '22 04:06 fulvi0

Hi, @dextermb, can you explain a bit more

@fulvi0 unfortunately this was two years ago and the project I set up is not used anymore.

Have you attempted to add accounts to Outlook via the live.com site to an already existing email account?

dextermb avatar Jun 15 '22 07:06 dextermb

for me it is also crashing with mails from microsoft, all other providers are working without problems in the tls handshake.

Error: 38DB7273897F0000:error:0A000076:SSL routines:tls_choose_sigalg:no suitable signature algorithm:../deps/openssl/openssl/ssl/t1_lib.c:3318:

Emitted 'error' event on SMTPServer instance at:
    at SMTPServer._onError (/app/node_modules/smtp-server/lib/smtp-server.js:332:14)
    at SMTPConnection.<anonymous> (/app/node_modules/smtp-server/lib/smtp-server.js:95:44)
    at SMTPConnection.emit (node:events:513:28)
    at SMTPConnection._onError (/app/node_modules/smtp-server/lib/smtp-connection.js:388:14)
    at TLSSocket.<anonymous> (/app/node_modules/smtp-server/lib/smtp-connection.js:1415:52)
    at Object.onceWrapper (node:events:628:26)
    at TLSSocket.emit (node:events:513:28)
    at TLSSocket._tlsError (node:_tls_wrap:919:8)
    at TLSSocket.emit (node:events:525:35)
    at emitErrorNT (node:internal/streams/destroy:151:8) {
  library: 'SSL routines',
  reason: 'no suitable signature algorithm',
  code: 'ERR_SSL_NO_SUITABLE_SIGNATURE_ALGORITHM',
}

wodka avatar Aug 04 '23 09:08 wodka

One thing to do, so at least the server is not just crashing:

const server = new SMTPServer({ ... })

// this is the important line to only display the error and not stop the process!
server.on('error', (e) => console.error(e))

wodka avatar Sep 14 '23 19:09 wodka

I'm getting this quite a lot, any solution @wodka @binary64 ?

charlesmudy avatar May 06 '24 05:05 charlesmudy