kushranada
kushranada6mo ago

Deno deploy - My simple mail service is giving a connection error (works fine locally or on vercel)

As the title states my small email sending API is not working on deno deploy. Maybe there needs to be additional configuration or there are some limitations to deno deploy of which I am unaware. I am using nodemailer as my mailing service. This is the repository https://github.com/Robspin/deno-mail-api The error is: gcp-europe-west4Error: connect ECONNREFUSED 52.97.183.194:587 - Local (undefined:undefined) at node_internal_captureLargerStackTrace (ext:deno_node/internal/errors.ts:91:9) at node_internal_exceptionWithHostPort (ext:deno_node/internal/errors.ts:215:10) at TCPConnectWrap._afterConnect [as oncomplete] (node:net:170:16) at TCP.afterConnect (ext:deno_node/internal_binding/connection_wrap.ts:45:11) at ext:deno_node/internal_binding/tcp_wrap.ts:302:14 at eventLoopTick (ext:core/01_core.js:182:7) { errno: -111, code: "ESOCKET", syscall: "connect", address: "52.97.183.194", port: 587, localAddress: undefined, localPort: undefined, command: "CONN" } Help will be much appreciated
GitHub
GitHub - Robspin/deno-mail-api
Contribute to Robspin/deno-mail-api development by creating an account on GitHub.
2 Replies
raunioroo
raunioroo6mo ago
I might be wrong, and maybe best if someone from the actual team can confirm or deny.. But IIRC deno deploy has a policy of not allowing deployments to send email. I guess to prevent the service to be used for spam for other malicious purposes. I was unable to confirm this with a quick look on the deno homepage, but whaddayaknow: see this issue about that not being stated in the docs: https://github.com/denoland/deploy_feedback/issues/555
GitHub
Add mail policy to Fair Use section of Deploy docs · Issue #555 · d...
What problem are you trying to solve? I've seen a number of users puzzled at not being able to send emails directly from Deno Deploy. It would be beneficial to have this policy explicitly detai...
kushranada
kushranada6mo ago
You are correct, apparently they blocked ports 25, 465 and 587 because of spam abuse... I will look into another solution. Thanks for your reply @raunioroo