0

I'm working on osmo-x, an open-source notification management API built with NestJS, typeORM, and bullMQ. It supports multiple notification channels (SMTP, Mailgun, SMS, etc.) where provider configurations are stored in PostgreSQL and notifications are processed through Redis queues.

The Problem: All SMTP notifications fail with Error: connect ECONNREFUSED 127.0.0.1:587 regardless of the configuration stored in the database. The provider table clearly shows {"host": "smtp.gmail.com", "port": 587, ...} but the application always attempts to connect to 127.0.0.1:587.

What I've Tried:

  1. Database verification - ran SELECT provider_id, channel_type, configuration FROM notify_providers multiple times. The config shows smtp.gmail.com correctly. verified the notification is linked to the correct provider with channel_type = 1 which is smtp.

  2. Docker troubleshooting - rebuilt containers with docker compose build --no-cache, deleted node_modules before rebuilding.

  3. Local testing - changed .env from docker values (host.docker.internal, osmox-redis) to local values (localhost), deleted the entire database and recreated all tables fresh, created new applications and providers from scratch multiple times.

Observations:

  • Fails identically both locally and in docker which rules out docker networking issues

  • database always shows correct smtp.gmail.com configuration

  • error always shows 127.0.0.1:587 never the configured host

  • this setup worked previously but is now broken everywhere.

    Where could this 127.0.0.1:587 default be coming from? Is there a nodemailer fallback I'm missing? what other places should i check for hardcoded smtp defaults?
    any help would be appreciated. thanks.

0

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.