christianhuth / helm-charts

Helm Charts for various Applications: https://charts.christianhuth.de
MIT License
33 stars 18 forks source link

[MailDev] Unable to set SMTP service port to 25 #1037

Closed redzioch closed 5 months ago

redzioch commented 5 months ago

I tried to set SMTP port to 25 (--set="services.smtp.port=25"), but then container fails with error:

MailDev using directory /home/node/maildev-data
MailDev webapp running at http://0.0.0.0:1080/
/home/node/lib/mailserver.js:267
  } else throw err
         ^

Error: listen EACCES: permission denied 0.0.0.0:25
    at Server.setupListenHandle [as _listen2] (node:net:1734:21)
    at listenInCluster (node:net:1799:12)
    at doListen (node:net:1948:7)
    at process.processTicksAndRejections (node:internal/process/task_queues:83:21) {
  code: 'EACCES',
  errno: -13,
  syscall: 'listen',
  address: '0.0.0.0',
  port: 25
}

Node.js v18.17.0

This is because MailDev is run with non-root user and therefore it is unable to use ports below 1024.

As a workaround I propose to separate Pod ports used by MailDev from Service ports exposed to another applications.

I have created PR: https://github.com/christianknell/helm-charts/pull/1036

christianhuth commented 5 months ago

fixed with v1.1.1 of the Helm Chart