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:
Database verification - ran
SELECT provider_id, channel_type, configuration FROM notify_providersmultiple times. The config showssmtp.gmail.comcorrectly. verified the notification is linked to the correct provider withchannel_type = 1which is smtp.Docker troubleshooting - rebuilt containers with
docker compose build --no-cache, deletednode_modulesbefore rebuilding.Local testing - changed
.envfrom 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.comconfigurationerror always shows
127.0.0.1:587never the configured hostthis setup worked previously but is now broken everywhere.
Where could this
127.0.0.1:587default 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.