Any success with SMTP?

I’m wondering if anyone has been successful in setting SMTP for mail delivery. I’m running Gramps Web with Docker, but I can’t seem to get mail delivery to work. I tried setting on first run, but didn’t get any email delivery either for me or for the next couple users that signed up. I also tried setting environment variables in docker (prefixing each variable as recommended with GRAMPSWEB_), but this didn’t work either. I succeeded in accessing the sqlite User database with Adminer and I tried changing the SMTP settings to use Gmail SMTP instead of my own mail server’s SMTP, and I removed the docker environment variables to make sure they weren’t interfering, but still no luck. Are there any logs anywhere that could help detect where the problem may be? And has anyone been successful in setting SMTP? If so please share.

I’m wondering if anyone has been successful in setting SMTP for mail delivery

Yes … :roll_eyes:

Please share your configuration, with sensitive values redacted, otherwise we can’t help you.

Here is my configuration in sqlite users database, configuration table:

EMAIL_HOST = smtp.gmail.com
EMAIL_PORT = 587
EMAIL_HOST_USER = myuser@gmail.com
EMAIL_HOST_PASSWORD = mygmailuserpassword
DEFAULT_FROM_EMAIL = myuser@gmail.com
BASE_URL = https://gramps.mydomain.com/
1 Like

I tried checking current configuration via api but I receive an error response:

403 forbidden
You don't have the permission to access the requested resource. It is either read-protected or not readable by the server.

I can query other resources such as media, or importers, but there are a number of resources that give errors: tasks, objects, relations, living, timelines all give:

404 Not Found
The requested URL was not found on the server. If you entered the URL manually please check your spelling and try again.

Only config gives a 403 error.

All other resources (people,families,places,events etc.) are working fine.

I also tried creating the config.cfg volume on disk as indicated here, and setting the configuration that way. And I tried setting EMAIL_USE_TLS=False since I’m using port 587, and I read in the documentation:

When using STARTTLS, set this to False

Still no luck. No emails are sent when I try for example to start password recovery.

I have also tried using port 465, setting EMAIL_USE_TLS=True, however I’m still not getting an email when clicking on password reset.

Like the media import problem, this sounds like the task queue (which handles background tasks like sending e-mails or importing media files) is not picking up the configuration environment or volumes or both. Please share your docker-compose file with personal data redacted.

Please check the celery logs whether the sending of the e-mail shows up as a completed task or whether an error appears.

I have a similar issue. Where is the SMTP config edited?

Can the mail server settings be configured in the GUI?

I finally got SMTP to work using Gmail SMTP and an app password (after activating 2FA) rather than the account password! I also had to set the port to 465. I can’t seem to get port 587 to work; I tried adding this row to the sqlite configuration table:

| id |      key      | value |
|----|---------------|-------|
| 7  | EMAIL_USE_TLS | False |

I also tried:

| id |      key      | value |
|----|---------------|-------|
| 7  | EMAIL_USE_TLS |   0   |

Then I just gave up and set the port to 465 without an EMAIL_USE_TLS entry (can this value be set in the configuration table?)

After downing the docker compose, removing volumes, and upping from scratch, the config resource seems to be working. I now get a response from postman :

{
    "BASE_URL": "https://gramps.mydomain.com",
    "DEFAULT_FROM_EMAIL": "myemail@gmail.com",
    "EMAIL_HOST": "smtp.gmail.com",
    "EMAIL_HOST_PASSWORD": "my_app_password",
    "EMAIL_HOST_USER": "myemail@gmail.com",
    "EMAIL_PORT": "465"
}

I attempted doing this on an implementation on a virtual Debian 12 server, and I still can’t get any emails sent (password reset or new user registration) via my gmail account. I had a little problem obtaining a Google app password since it is now buried on their site, but now the app password does not seem to work.

Updates or suggestions?