mailin
mailin copied to clipboard
ssl handshake failure
When receiving email from Yahoo I get this error message:
error:14094416:SSL routines:ssl3_read_bytes:sslv3 alert certificate unknown:../deps/openssl/openssl/ssl/s3_pkt.c:1493:SSL alert number 46
140050183874432:error:140940E5:SSL routines:ssl3_read_bytes:ssl handshake failure:../deps/openssl/openssl/ssl/s3_pkt.c:1216:
at Error (native)
events.js:165
throw err;
^
Error: Uncaught, unspecified "error" event. (undefined)
at Mailin.emit (events.js:163:17)
at SMTPServer.<anonymous> (/home/arash/.npm-global/lib/node_modules/mailin/lib/mailin.js:519:15)
at emitOne (events.js:96:13)
at SMTPServer.emit (events.js:188:7)
at SMTPServer._onError (/home/arash/.npm-global/lib/node_modules/mailin/node_modules/smtp-server/lib/smtp-server.js:237:10)
at emitOne (events.js:96:13)
at SMTPConnection.emit (events.js:188:7)
at SMTPConnection._onError (/home/arash/.npm-global/lib/node_modules/mailin/node_modules/smtp-server/lib/smtp-connection.js:274:10)
at emitOne (events.js:101:20)
at TLSSocket.emit (events.js:188:7)
at emitErrorNT (net.js:1277:8)
at _combinedTickCallback (internal/process/next_tick.js:80:11)
at process._tickCallback (internal/process/next_tick.js:104:9)
warn: It is likely that an error caused Mailin to crash.
warn: Please report this to https://github.com/Flolagale/mailin/issues
Ubuntu 14.04
OpenSSL 1.0.2k 26 Jan 2017
mailin version: 3.0.4
certificates are updated (apt-get install ca-certificates
)
I am having this issue as well. We have a server setup to receive files from vendors and 1 vendor in South Africa can never send files because this error pops up and crashes the server every time. I hope that there is a fix for this soon.
Same issue here, any help please? the message appeared after upgrade to node 8.8.1
Fixed the issue by adding valid (could be self signed) certificate to mailin config:
const options = {
port: 25,
disableWebhook: true,
logFile: 'mailin.log,
smtpOptions: {
disableDNSValidation: true,
disableDnsValidation: true,
disableDkim: true,
disableSpf: true,
rejectUnauthorized: false,
key: 'privkey.pem',
cert: 'fullchain.pem',
}
}
mailin.start(options);
My certificates are signed with LetsEncrypt. not sure if self signed would work, but should.
I tried this using a .crt and .key files and had no luck. I do not know enough about the certs to fix whatever is broken in using them. The same files work just fine for the https for the app.
okay just for anyone that might have tried @Kostanos solution to no avail, I do not know if he is using an older version of mailin, but I finally got his solution to work by removing the smtpOptions. in other words:
const options = { port: 25, disableWebhook: true, logFile: 'mailin.log, disableDNSValidation: true, disableDnsValidation: true, disableDkim: true, disableSpf: true, rejectUnauthorized: false, key: 'privkey.pem', cert: 'fullchain.pem' }
hope this helps someone.
I'm using the latest version of mailin available - 3.0.4:
$ cat package-lock.json | grep mailin
"mailin": {
"resolved": "https://registry.npmjs.org/mailin/-/mailin-3.0.4.tgz",
I also found some code snippets using smtpOptions
: https://github.com/Flolagale/mailin#embedded-inside-a-node-application
I figured you were since your orig reply was so recent. I am also using the same version. For whatever reason, I had to change the options object. Figured it might help somebody else. Thanks for your reply.
I feel like @Kostanos's config is right, since the option is originating from here, though I'm still having a bit of trouble getting my ssl emails routed right
I have no doubt or argument that his config is correct. I just wanted to point out that, for whatever reason, I could get not my app to start with a config similar to that. I had to adjust the smtp options. Just wanted to share it in case anyone else was getting the same initial results I was. I have no idea what I was doing differently outside of this config. Cheers.