How do I change my SMTP settings (Discourse Docker Install)


(Matthew) #1

Hi,

I’m trying to switch over my Discourse installation from Mailgun to Mandrill. I installed my Discourse app using Docker and I can’t seem to find the settings file for this. I tried doing grep or find searches but the files that show up, when edited doesn’t affect the settings shown in the admin email tab.

I did a google search and people said in the results to edit production.rb but I can’t find my mailgun settings there, just GlobalSettings stuff. When I try to edit the globalsettings to my Mandrill it breaks the app.

Can someone please tell me how I can change my email settings? I mean, it can’t be that hard, right?

Thanks,
Matt


Can I update smtp config without rebuild?
How to change SMTP details
(Jeff Atwood) #2

Edit app.yml and then ./launcher rebuild app


(Matthew) #3

Seriously??? It’s that easy? Well, that’s 3 hours of my life I will never get back!

Thanks!


(Nick M.) #4

Trying this now!.

Thank you so much. Just saved me many hours as well.


(Craig Bowes) #6

I just found this old thread. Is there some reason that you have to rebuild the docker instance vs. just restarting the app? The docker rebuild seems riskier and more time consuming.


(g0st) #7

Does the rebuild cause you to lose any forum data? Specifically posts users and configure changes you’ve made via the /admin page like sites name and style changes.


(Sam) #8

Docker rebuild isn’t risky (except in that it does pull in any forum updates on the branch you’re on, which you might not want - not what I’d call risky though, exactly) and you don’t lose any data. It does cause some downtime though (10-15 min on my 1GB DO instance), unless you are using one of the fancier multi-container configurations.


(Hugo Rodger-Brown) #9

Hi there - I did a DigitalOcean install, and set up the SMTP settings incorrectly. I’ve managed to resurrect and accounts from the command line, and get the install running - but now I need to update the SMTP settings. I can’t find the app.yml on our install - where would it be?


(Tom Newsom) #10

/var/discourse/containers


(Craig Bowes) #11

Is there another way to do this without rebuilding the entire site and dealing with the downtime?


(Jeff Atwood) #12

No, this is the only way to change those settings.


(Claas Aug.) #13

It would in fact help a lot, especially when troubleshooting email.

In contrast to SiteSettings, GlobalSettings don’t seem to be editable at runtime via rails c.

I suppose there are technical reasons for this.


#14

What’s the difference between this and ./launcher bootstrap app ? I used bootstrap app in installation


(Serhat Kapusuz) #15

i was looking 1 hour for it…


#16

This is not correct.
Stop the docker daemon
Edit /var/lib/docker/containers/container-id/config.json and change the value of DISCOURSE_SMTP_ADDRESS
Start the docker daemon

The new SMTP address will be displayed in your email setting


(Olivier Lambert) #17

Hey @unitb! Would you care to elaborate on the exact procedure to do that?

I currently have a big problem… When I rebuild my container, my SSO generates a redirect loop, so I’ve had to restore my droplet to before I’ve rebuilt my app. But I need to switch from mandrill to mailgun.

So I need to change my smtp without rebuilding my app OR figuring out why I get a redirect loop when all I’ve changes was my SMTP config.


(Mark) #18

I’m not @unitb, but what part are you stuck at?

I made a quick video that should clarify the process; 2016-10-18_0223


(Olivier Lambert) #19

Holy cow, that’s just what I need thank you!


(OG) #20

Thanks, looks like this is going to save me some time :wink:

I can confirm this solution works, but of course there is danger of invalidating your docker instance so be careful when editing…


(Felix Freiberger) #21

Also note that you will lose these changes on the next rebuild, so you should also edit app.yml.