Why is Devise mailer on Heroku still using Mailgun after switching to Mandrill?

I’m stuck with a weird issue on Heroku. I was using Mailgun for Devise confirmable emails but switched to Mandrill SMTP. I removed all Mailgun stuff from my code and searched everywhere. No trace of it left.

When I try to sign up a user on Heroku, I get this error:

Net::SMTPAuthenticationError (535 5.7.0 Mailgun is not loving your login or password)

It’s strange because I set up Mandrill SMTP and removed Mailgun addon and ENV variables. But the error still mentions Mailgun. What’s going on? Is there some hidden setting I’m missing?

I checked my vendor folder too, but no luck. It’s like Heroku is stuck on Mailgun somehow. Any ideas on how to fix this? I’m out of options here.

I’ve run into similar issues before, and it can be maddening. One thing that’s often overlooked is checking the Heroku dyno’s environment. Sometimes, even after updating config vars, the changes don’t propagate immediately to all dynos.

Try restarting your dynos with ‘heroku restart’. This forces them to pick up the latest environment variables. If that doesn’t work, you might need to redeploy your app entirely.

Another sneaky culprit could be your database. If you’re storing mailer settings in the database, make sure those are updated too. I once spent hours debugging only to find an old setting lurking in a rarely-accessed table.

Lastly, if you’re using any caching mechanisms, clear those out. Cached mailer configurations can persist longer than you’d expect. Good luck sorting it out!

Have you double-checked your Heroku config vars? Sometimes, old environment variables can linger even after removing addons. Try running ‘heroku config’ in your terminal to see all current variables. You might find a forgotten Mailgun-related setting there.

If that’s not it, consider clearing your app’s build cache. Heroku can sometimes hold onto old configurations. Use ‘heroku builds:cache:purge’ to force a fresh build.

Lastly, ensure your Procfile or any startup scripts aren’t referencing Mailgun. These could be overriding your new Mandrill settings.

If all else fails, you might need to recreate your Heroku app from scratch. It’s a hassle, but sometimes it’s the quickest way to resolve persistent configuration issues.

hey man, sounds frustrating. did u check ur initializers? sometimes old mailer configs hide there. also, try heroku run rails console and check ActionMailer settings. might reveal sumthing unexpected. if all else fails, nuke it from orbit (aka recreate the app). Good luck!