Tutor config save is not working in setting EMAIL_HOST

My env is tutor 14.0.5, ubuntu 20.04 (digitalocean) using docker 20.10.21 and docker-compose 2.12.2.
I want to use mailjet as the smtp server. Below are my steps.

$ tutor config save --set DEFAULT_FROM_EMAIL="myname@myhost.com"  --set CONTACT_EMAIL="myname@myhost.com" --set EMAIL_HOST="in-v3.mailjet.com" --set EMAIL_PORT="465" --set EMAIL_USE_TLS=true --set EMAIL_HOST_USER="Mailjet_API_Key" --set EMAIL_HOST_PASSWORD="Mailjet_Secret" 

(I already used the above configuration in thunderbird successfully.

in $(tutor config printroot)/config.yml I got

CONTACT_EMAIL: myname@myhost.com
DEFAULT_FROM_EMAIL: myname@myhost.com
EMAIL_HOST: in-v3.mailjet.com
EMAIL_HOST_PASSWORD: Mailjet_Secret
EMAIL_HOST_USER: Mailjet_API_Key
EMAIL_PORT: 465
EMAIL_USE_TLS: true

these look good. then I do

$ tutor local quickstart

then I check $(tutor config printroot)/env/apps/openedx/config/lms.env.yml

CONTACT_EMAIL: "myname@myhost.com"  (**this is the only field changed successfully**)
EMAIL_HOST: "smtp"
EMAIL_PORT: 8025
EMAIL_USE_TLS: false
EMAIL_HOST_USER: ""
EMAIL_HOST_PASSWORD: ""

when issue “forgot password” from UI, I record the logs of smtp_1

smtp_1                       | 2022-11-15 20:49:29 1ov2s4-00000A-Io <= myname@myhost.com H=(c60635618ce4) [172.18.0.7] P=esmtp S=10716 id=166854536856.7.7046375211031467318@c60635618ce4
smtp_1                       | 2022-11-15 20:49:29 1ov2s4-00000A-Io H=gmail-smtp-in.l.google.com [2404:6800:4003:c11::1b] Address not available
smtp_1                       | 2022-11-15 20:49:30 1ov2s4-00000A-Io ** myname@gmail.com R=dnslookup T=remote_smtp H=gmail-smtp-in.l.google.com [172.217.194.26] X=TLS1.3:TLS_AES_256_GCM_SHA384:256 CV=yes: SMTP error from remote mail server after end of data: 550-5.7.1 **[my.server.ip.address]** The IP you're using to send mail is not authorized\n550-5.7.1 to send email directly to our servers. Please use the SMTP relay at\n550-5.7.1 your service provider instead. Learn more at\n550 5.7.1  https://support.google.com/mail/?p=NotAuthorizedError s4-20020a056a00178400b0056c01ece001si14693342pfg.252 - gsmtp
smtp_1                       | 2022-11-15 20:49:30 1ov2s6-00000D-GS <= <> R=1ov2s4-00000A-Io U=exim P=local S=12788
smtp_1                       | 2022-11-15 20:49:30 1ov2s4-00000A-Io Completed
=> **my.server.ip.address is my server IP. so it is still sending email from my server instead of mailjet server**

How can I get the new values into configuration correctly?
Thanks for your help in advanced.

How did you decide to setup these settings? This is not how Tutor works. You need to understand that there is a difference between edx-platform settings and the Tutor configuration. See for instance:

https://docs.tutor.overhang.io/configuration.html#smtp
https://docs.tutor.overhang.io/tutorials/google-smtp.html
https://docs.tutor.overhang.io/intro.html#how-does-tutor-work

You should also search for similar questions in this forum, many people have asked how to configure a third party SMTP server.

Hi,

Have you already disabled the smtp that tutor installs?

tutor config save --set RUN_SMTP=false

1 Like

Thanks a lot. This resolves configuration issue. I got confused when google “openedx tutor smtp”, this “How to setup smtp email in production - #18 by Herve_siyou” shows up the first. I should have read the instructions carefully. tutor/google-smtp.rst at master · overhangio/tutor · GitHub has an example.
$ tutor config save
–set SMTP_HOST=smtp.gmail.com
–set SMTP_PORT=587
–set SMTP_USE_SSL=false
–set SMTP_USE_TLS=true
–set SMTP_USERNAME=YOURUSERNAME@gmail.com
–set SMTP_PASSWORD=‘YOURPASSWORD’

1 Like

Thanks for helping. The above post resolves my issue.

1 Like