Self-Hosted - email configs

I use baserow on a Self-Hosted server, I configured the SMTP variables as informed in the documentation, but baserow does not send the invitation email to users.

EMAIL_SMTP=True
EMAIL_SMTP_HOST= URL Server e-mail
EMAIL_SMTP_PORT=465
FROM_EMAIL= e-mail
EMAIL_SMTP_USER= e-mail 2
EMAIL_SMTP_PASSWORD=XXXXXXXXXXXXX
EMAIL_SMTP_USE_TLS=True

Hi @fernandesneto, what do the output logs of the Baserow celery workers say just after you’ve send an email? Does your SMTP server have output logs? Have you tried connecting to the SMTP server with the same credentials from your own device?

The only place my email (SMTP) doesn’t work is in the baserow. Absolutely on all other services is working without any error. I honestly see that the baserow makes it as difficult as possible to force use their paid service. That’s too ugly! Makes it simple!

It’s strange that SMTP is working on all your other devices but not in Baserow. Have you been able to see the Celery worker logs after sending an email? A more detailed error message could be visible there. Can you share with me how you’re self hosting, that might help us to identify the problem?

Would you mind elaborating on how Baserow is making it more difficult to setup SMTP for open source users? Environment variables seem like an easy way to configure SMTP settings. Even if you’re on the premium plan, it’s not possible configure differently.

After entering the invitation email, no error message is displayed. apparently everything is right. However, the guest does not receive the email. How do I see the logs?

How are you currently self hosting?

Hey @fernandesneto,

What mail server are you using? My gut feel is the config needs tweaking or maybe it is a self signed cert.

Ubuntu 20 and Docker:latest

own email server. Letsencrypt. It works perfectly, except for baserow. How do I see the logs?

Can you be a bit more specific? The reason I’m asking is because it depends on how you’re self hosting to view the logs. Have you for example used this Ubuntu guide: Installation on Ubuntu // Baserow?

1 Like

I’m using the n8n image available on hub.docker. Installation is inside docker.

Hey @fernandesneto,

n8n or Baserow? If you are using the docker image you could follow the docker logs in the normal way and send a notification to see what happens.

Can you share specifically what mail server it is, Assuming you have not made your own some servers can do odd things but being able to find the connection logs for the mail server would say if the connection is even making it that far and would rule out a lot of possible issues.

1 Like

[BACKEND][2022-10-17 11:51:53] 127.0.0.1:60854 - “GET /_health/ HTTP/1.1” 200
[CELERY_WORKER][2022-10-17 11:52:00] [2022-10-17 11:51:13,744: INFO/MainProcess] Task djcelery_email_send_multiple[2a6c22d4-085f-43a4-a373-46566f8b16b2] received
[BACKEND][2022-10-17 11:52:00] 127.0.0.1:60932 - “GET /_health/ HTTP/1.1” 200
[BACKEND][2022-10-17 11:52:14] 172.20.0.1:0 - “POST /api/groups/invitations/group/60/ HTTP/1.1” 200
[BACKEND][2022-10-17 11:52:34] 127.0.0.1:32792 - “GET /_health/ HTTP/1.1” 200
[BACKEND][2022-10-17 11:52:37] 127.0.0.1:32964 - “GET /_health/ HTTP/1.1” 200

[BACKEND][2022-10-17 11:50:23] 172.20.0.1:0 - “GET /api/database/fields/table/326/ HTTP/1.1” 200
[BACKEND][2022-10-17 11:50:23] 172.20.0.1:0 - “POST /api/user/token-auth/ HTTP/1.1” 201
[BACKEND][2022-10-17 11:50:23] 172.20.0.1:0 - “GET /api/database/rows/table/326/?filter__field_2709__equal=42694741000160&page=1&size=100 HTTP/1.1” 200
[BACKEND][2022-10-17 11:50:23] 172.20.0.1:0 - “GET /api/database/fields/table/326/ HTTP/1.1” 200
[BACKEND][2022-10-17 11:50:23] 172.20.0.1:0 - “GET /api/database/rows/table/326/?filter__field_2709__equal=42255563000170&page=1&size=100 HTTP/1.1” 200
[BACKEND][2022-10-17 11:50:23] 172.20.0.1:0 - “POST /api/user/token-auth/ HTTP/1.1” 201
[BACKEND][2022-10-17 11:50:24] 172.20.0.1:0 - “GET /api/database/fields/table/326/ HTTP/1.1” 200
[BACKEND][2022-10-17 11:50:24] 172.20.0.1:0 - “POST /api/user/token-auth/ HTTP/1.1” 201
[BACKEND][2022-10-17 11:50:24] 172.20.0.1:0 - “GET /api/database/rows/table/326/?filter__field_2709__equal=32336931000151&page=1&size=100 HTTP/1.1” 200
[BACKEND][2022-10-17 11:50:24] 172.20.0.1:0 - “GET /api/database/fields/table/326/ HTTP/1.1” 200
[BACKEND][2022-10-17 11:50:24] 172.20.0.1:0 - “GET /api/database/rows/table/326/?filter__field_2709__equal=42694741000160&page=1&size=100 HTTP/1.1” 200
[BACKEND][2022-10-17 11:50:24] 172.20.0.1:0 - “POST /api/user/token-auth/ HTTP/1.1” 201
[BACKEND][2022-10-17 11:50:24] 172.20.0.1:0 - “GET /api/database/fields/table/326/ HTTP/1.1” 200
[BACKEND][2022-10-17 11:50:24] 172.20.0.1:0 - “POST /api/user/token-auth/ HTTP/1.1” 201
[BACKEND][2022-10-17 11:50:24] 172.20.0.1:0 - “GET /api/database/rows/table/326/?filter__field_2709__equal=31083910000109&page=1&size=100 HTTP/1.1” 200
[BACKEND][2022-10-17 11:50:24] 172.20.0.1:0 - “GET /api/database/fields/table/326/ HTTP/1.1” 200
[BACKEND][2022-10-17 11:50:24] 172.20.0.1:0 - “GET /api/database/rows/table/326/?filter__field_2709__equal=32336931000151&page=1&size=100 HTTP/1.1” 200
[BACKEND][2022-10-17 11:50:24] 172.20.0.1:0 - “POST /api/user/token-auth/ HTTP/1.1” 201
[BACKEND][2022-10-17 11:50:24] 172.20.0.1:0 - “GET /api/database/fields/table/326/ HTTP/1.1” 200
[BACKEND][2022-10-17 11:50:24] 172.20.0.1:0 - “POST /api/user/token-auth/ HTTP/1.1” 201
[BACKEND][2022-10-17 11:50:24] 172.20.0.1:0 - “GET /api/database/fields/table/326/ HTTP/1.1” 200
[BACKEND][2022-10-17 11:50:24] 172.20.0.1:0 - “GET /api/database/rows/table/326/?filter__field_2709__equal=42255563000170&page=1&size=100 HTTP/1.1” 200
[BACKEND][2022-10-17 11:50:24] 172.20.0.1:0 - “GET /api/database/rows/table/326/?filter__field_2709__equal=43297342000128&page=1&size=100 HTTP/1.1” 200
[BACKEND][2022-10-17 11:50:24] 172.20.0.1:0 - “POST /api/user/token-auth/ HTTP/1.1” 201
[BACKEND][2022-10-17 11:50:25] 172.20.0.1:0 - “GET /api/database/fields/table/326/ HTTP/1.1” 200
[BACKEND][2022-10-17 11:50:25] 172.20.0.1:0 - “POST /api/user/token-auth/ HTTP/1.1” 201
[BACKEND][2022-10-17 11:50:25] 172.20.0.1:0 - “GET /api/database/rows/table/326/?filter__field_2709__equal=42694741000160&page=1&size=100 HTTP/1.1” 200
[BACKEND][2022-10-17 11:50:25] 172.20.0.1:0 - “GET /api/database/fields/table/326/ HTTP/1.1” 200
[BACKEND][2022-10-17 11:50:25] 172.20.0.1:0 - “GET /api/database/rows/table/326/?filter__field_2709__equal=26764393000101&page=1&size=100 HTTP/1.1” 200
[BACKEND][2022-10-17 11:50:25] 172.20.0.1:0 - “POST /api/user/token-auth/ HTTP/1.1” 201
[BACKEND][2022-10-17 11:50:25] 172.20.0.1:0 - “GET /api/database/fields/table/326/ HTTP/1.1” 200
[BACKEND][2022-10-17 11:50:25] 172.20.0.1:0 - “GET /api/database/rows/table/326/?filter__field_2709__equal=32336931000151&page=1&size=100 HTTP/1.1” 200
[BACKEND][2022-10-17 11:50:25] 172.20.0.1:0 - “POST /api/user/token-auth/ HTTP/1.1” 201
[BACKEND][2022-10-17 11:50:25] 172.20.0.1:0 - “GET /api/database/fields/table/326/ HTTP/1.1” 200
[BACKEND][2022-10-17 11:50:25] 172.20.0.1:0 - “GET /api/database/rows/table/326/?filter__field_2709__equal=43297342000128&page=1&size=100 HTTP/1.1” 200
[BACKEND][2022-10-17 11:50:25] 172.20.0.1:0 - “POST /api/user/token-auth/ HTTP/1.1” 201
[BACKEND][2022-10-17 11:50:25] 172.20.0.1:0 - “GET /api/database/fields/table/326/ HTTP/1.1” 200
[BACKEND][2022-10-17 11:50:33] 172.20.0.1:0 - “GET /api/database/rows/table/326/?filter__field_2709__equal=26764393000101&page=1&size=100 HTTP/1.1” 200
[BACKEND][2022-10-17 11:50:37] 127.0.0.1:60488 - “GET /_health/ HTTP/1.1” 200
[BACKEND][2022-10-17 11:50:53] 127.0.0.1:60522 - “GET /_health/ HTTP/1.1” 200
[BACKEND][2022-10-17 11:50:54] 127.0.0.1:60586 - “GET /_health/ HTTP/1.1” 200
[BACKEND][2022-10-17 11:50:54] WARNING 2022-10-17 11:50:54,180 django.request.log_response:230- Bad Request: /api/user/token-refresh/
[BACKEND][2022-10-17 11:50:54] WARNING 2022-10-17 11:50:54,180 django.request.log_response:230- Bad Request: /api/user/token-refresh/
[BACKEND][2022-10-17 11:50:54] WARNING 2022-10-17 11:50:54,180 django.request.log_response:230- Bad Request: /api/user/token-refresh/
[BACKEND][2022-10-17 11:50:54] 127.0.0.1:60602 - “POST /api/user/token-refresh/ HTTP/1.1” 400
[BACKEND][2022-10-17 11:50:56] 127.0.0.1:60606 - “GET /api/settings/ HTTP/1.1” 200
[BACKEND][2022-10-17 11:50:57] 172.20.0.1:0 - “POST /api/user/token-auth/ HTTP/1.1” 201
[BACKEND][2022-10-17 11:50:57] 172.20.0.1:0 - “GET /api/groups/ HTTP/1.1” 200
[BACKEND][2022-10-17 11:50:57] 172.20.0.1:0 - “GET /api/applications/ HTTP/1.1” 200
[BACKEND][2022-10-17 11:50:58] 172.20.0.1:0 - “GET /api/user/dashboard/ HTTP/1.1” 200
[BACKEND][2022-10-17 11:50:58] [2022-10-17 11:50:58 +0000] [548] [INFO] (‘172.20.0.1’, 0) - “WebSocket /ws/core/” [accepted]
[BACKEND][2022-10-17 11:51:02] [2022-10-17 11:50:58 +0000] [548] [INFO] connection open
[BACKEND][2022-10-17 11:51:03] 172.20.0.1:0 - “GET /api/groups/users/group/60/ HTTP/1.1” 200
[BACKEND][2022-10-17 11:51:13] 172.20.0.1:0 - “GET /api/groups/invitations/group/60/ HTTP/1.1” 200
[BACKEND][2022-10-17 11:51:13] 127.0.0.1:60724 - “GET /_health/ HTTP/1.1” 200
[CELERY_WORKER][2022-10-17 11:51:13] [2022-10-17 04:00:00,183: INFO/ForkPoolWorker-1] Task celery.backend_cleanup[d3573c4b-0ce9-4ba3-98cc-20a124b8512e] succeeded in 0.042740988021250814s: None
[BACKEND][2022-10-17 11:51:33] 172.20.0.1:0 - “POST /api/groups/invitations/group/60/ HTTP/1.1” 200
[BACKEND][2022-10-17 11:51:37] 127.0.0.1:60842 - “GET /_health/ HTTP/1.1” 200
[BACKEND][2022-10-17 11:51:53] 127.0.0.1:60854 - “GET /_health/ HTTP/1.1” 200
[CELERY_WORKER][2022-10-17 11:52:00] [2022-10-17 11:51:13,744: INFO/MainProcess] Task djcelery_email_send_multiple[2a6c22d4-085f-43a4-a373-46566f8b16b2] received
[BACKEND][2022-10-17 11:52:00] 127.0.0.1:60932 - “GET /_health/ HTTP/1.1” 200
[BACKEND][2022-10-17 11:52:14] 172.20.0.1:0 - “POST /api/groups/invitations/group/60/ HTTP/1.1” 200
[BACKEND][2022-10-17 11:52:34] 127.0.0.1:32792 - “GET /_health/ HTTP/1.1” 200
[BACKEND][2022-10-17 11:52:37] 127.0.0.1:32964 - “GET /_health/ HTTP/1.1” 200
[BACKEND][2022-10-17 11:52:54] 127.0.0.1:32988 - “GET /_health/ HTTP/1.1” 200
[BACKEND][2022-10-17 11:53:14] 127.0.0.1:33090 - “GET /_health/ HTTP/1.1” 200
[BACKEND][2022-10-17 11:53:34] 127.0.0.1:33154 - “GET /_health/ HTTP/1.1” 200
[BACKEND][2022-10-17 11:53:38] 127.0.0.1:33256 - “GET /_health/ HTTP/1.1” 200
[BACKEND][2022-10-17 11:53:54] 127.0.0.1:33282 - “GET /_health/ HTTP/1.1” 200
[BACKEND][2022-10-17 11:54:15] 127.0.0.1:33346 - “GET /_health/ HTTP/1.1” 200
[BACKEND][2022-10-17 11:54:19] 127.0.0.1:33538 - “GET /_health/ HTTP/1.1” 200
[BACKEND][2022-10-17 11:54:19] 172.20.0.1:0 - “GET /api/groups/users/group/60/ HTTP/1.1” 200
[BACKEND][2022-10-17 11:54:35] 172.20.0.1:0 - “GET /api/groups/invitations/group/60/ HTTP/1.1” 200
[CELERY_WORKER][2022-10-17 11:54:36] [2022-10-17 11:52:00,205: INFO/MainProcess] Task djcelery_email_send_multiple[ee113aa9-e4a9-45da-8621-9851cfe78640] received
[BACKEND][2022-10-17 11:54:36] 127.0.0.1:33716 - “GET /_health/ HTTP/1.1” 200
[BACKEND][2022-10-17 11:54:38] 172.20.0.1:0 - “POST /api/groups/invitations/group/60/ HTTP/1.1” 200
[BEAT_WORKER][2022-10-17 11:54:41] [2022-10-17 11:49:41,270: INFO/MainProcess] Scheduler: Sending due task baserow.core.trash.tasks.permanently_delete_marked_trash() (baserow.core.trash.tasks.permanently_delete_marked_trash)
[BEAT_WORKER][2022-10-17 11:54:41] [2022-10-17 11:54:41,279: INFO/MainProcess] Scheduler: Sending due task baserow.contrib.database.export.tasks.clean_up_old_jobs() (baserow.contrib.database.export.tasks.clean_up_old_jobs)
[EXPORT_WORKER][2022-10-17 11:54:41] [2022-10-17 11:49:41,362: INFO/ForkPoolWorker-1] Task baserow.core.trash.tasks.permanently_delete_marked_trash[4ecfc064-2b75-4584-9398-e0ba01f968f9] succeeded in 0.015617499011568725s: None
[BEAT_WORKER][2022-10-17 11:54:41] [2022-10-17 11:54:41,284: INFO/MainProcess] Scheduler: Sending due task baserow.core.action.tasks.cleanup_old_actions() (baserow.core.action.tasks.cleanup_old_actions)
[EXPORT_WORKER][2022-10-17 11:54:41] [2022-10-17 11:54:41,285: INFO/MainProcess] Task baserow.contrib.database.export.tasks.clean_up_old_jobs[07cb006f-6708-4956-8e55-b02721c06177] received
[BEAT_WORKER][2022-10-17 11:54:41] [2022-10-17 11:54:41,286: INFO/MainProcess] Scheduler: Sending due task baserow.core.jobs.tasks.clean_up_jobs() (baserow.core.jobs.tasks.clean_up_jobs)
[EXPORT_WORKER][2022-10-17 11:54:41] [2022-10-17 11:54:41,288: INFO/MainProcess] Task baserow.core.action.tasks.cleanup_old_actions[af45d67f-9f5e-429f-904d-46e9e8a3a756] received
[BEAT_WORKER][2022-10-17 11:54:41] [2022-10-17 11:54:41,288: INFO/MainProcess] Scheduler: Sending due task baserow.core.trash.tasks.mark_old_trash_for_permanent_deletion() (baserow.core.trash.tasks.mark_old_trash_for_permanent_deletion)
[EXPORT_WORKER][2022-10-17 11:54:41] [2022-10-17 11:54:41,289: INFO/MainProcess] Task baserow.core.jobs.tasks.clean_up_jobs[50283a4e-e6f9-4b9a-8182-4cd00533bd7b] received
[EXPORT_WORKER][2022-10-17 11:54:41] [2022-10-17 11:54:41,291: INFO/MainProcess] Task baserow.core.trash.tasks.mark_old_trash_for_permanent_deletion[07782001-3a13-424a-b7c9-f92e653fecd3] received
[EXPORT_WORKER][2022-10-17 11:54:41] [2022-10-17 11:54:41,294: INFO/MainProcess] Task baserow.core.trash.tasks.permanently_delete_marked_trash[8d332907-15d5-4c03-b303-180976e73fb7] received
[EXPORT_WORKER][2022-10-17 11:54:41] [2022-10-17 11:54:41,308: INFO/ForkPoolWorker-1] Cleaning up 0 old jobs
[EXPORT_WORKER][2022-10-17 11:54:41] [2022-10-17 11:54:41,310: INFO/ForkPoolWorker-1] Task baserow.contrib.database.export.tasks.clean_up_old_jobs[07cb006f-6708-4956-8e55-b02721c06177] succeeded in 0.020825073996093124s: None
[EXPORT_WORKER][2022-10-17 11:54:41] [2022-10-17 11:54:41,335: INFO/ForkPoolWorker-1] Cleaned up 0 actions.
[EXPORT_WORKER][2022-10-17 11:54:41] [2022-10-17 11:54:41,335: INFO/ForkPoolWorker-1] Task baserow.core.action.tasks.cleanup_old_actions[af45d67f-9f5e-429f-904d-46e9e8a3a756] succeeded in 0.022551085974555463s: None
[EXPORT_WORKER][2022-10-17 11:54:41] [2022-10-17 11:54:41,359: INFO/ForkPoolWorker-1] Task baserow.core.jobs.tasks.clean_up_jobs[50283a4e-e6f9-4b9a-8182-4cd00533bd7b] succeeded in 0.02143884898396209s: None
[EXPORT_WORKER][2022-10-17 11:54:41] [2022-10-17 11:54:41,373: INFO/ForkPoolWorker-1] Successfully marked 0 old trash items for deletion as they were older than 72 hours.
[EXPORT_WORKER][2022-10-17 11:54:41] [2022-10-17 11:54:41,374: INFO/ForkPoolWorker-1] Task baserow.core.trash.tasks.mark_old_trash_for_permanent_deletion[07782001-3a13-424a-b7c9-f92e653fecd3] succeeded in 0.012480152014177293s: None
[EXPORT_WORKER][2022-10-17 11:54:41] [2022-10-17 11:54:41,388: INFO/ForkPoolWorker-1] Successfully deleted 0 trash entries and their associated trashed items.
[BACKEND][2022-10-17 11:54:55] 127.0.0.1:33756 - “GET /_health/ HTTP/1.1” 200
[BACKEND][2022-10-17 11:55:15] 127.0.0.1:33858 - “GET /_health/ HTTP/1.1” 200
[BACKEND][2022-10-17 11:55:35] 127.0.0.1:33984 - “GET /_health/ HTTP/1.1” 200
[BACKEND][2022-10-17 11:55:38] 127.0.0.1:34032 - “GET /_health/ HTTP/1.1” 200
[BACKEND][2022-10-17 11:55:56] 127.0.0.1:34058 - “GET /_health/ HTTP/1.1” 200

[CELERY_WORKER][2022-10-17 11:56:14] [2022-10-17 11:54:36,379: INFO/MainProcess] Task djcelery_email_send_multiple[8d99ab8d-fde4-4a94-9a22-3938f0586a43] received
[CELERY_WORKER][2022-10-17 11:56:14] [2022-10-17 11:56:14,148: ERROR/ForkPoolWorker-1] djcelery_email_send_multiple[2a6c22d4-085f-43a4-a373-46566f8b16b2]: Cannot reach CELERY_EMAIL_BACKEND django.core.mail.backends.smtp.EmailBackend
[CELERY_WORKER][2022-10-17 11:56:14] Traceback (most recent call last):
[CELERY_WORKER][2022-10-17 11:56:14] File “/baserow/venv/lib/python3.7/site-packages/djcelery_email/tasks.py”, line 40, in send_emails
[CELERY_WORKER][2022-10-17 11:56:14] conn.open()
[CELERY_WORKER][2022-10-17 11:56:14] File “/baserow/venv/lib/python3.7/site-packages/django/core/mail/backends/smtp.py”, line 62, in open
[CELERY_WORKER][2022-10-17 11:56:14] self.connection = self.connection_class(self.host, self.port, **connection_params)
[CELERY_WORKER][2022-10-17 11:56:14] File “/usr/lib/python3.7/smtplib.py”, line 251, in init
[CELERY_WORKER][2022-10-17 11:56:14] (code, msg) = self.connect(host, port)
[CELERY_WORKER][2022-10-17 11:56:14] File “/usr/lib/python3.7/smtplib.py”, line 338, in connect
[CELERY_WORKER][2022-10-17 11:56:14] (code, msg) = self.getreply()
[CELERY_WORKER][2022-10-17 11:56:14] File “/usr/lib/python3.7/smtplib.py”, line 394, in getreply

Are there more lines you could share? The problem is described here:

[CELERY_WORKER][2022-10-17 11:56:14] [2022-10-17 11:56:14,148: ERROR/ForkPoolWorker-1] djcelery_email_send_multiple[2a6c22d4-085f-43a4-a373-46566f8b16b2]: Cannot reach CELERY_EMAIL_BACKEND django.core.mail.backends.smtp.EmailBackend
[CELERY_WORKER][2022-10-17 11:56:14] Traceback (most recent call last):
[CELERY_WORKER][2022-10-17 11:56:14] File “/baserow/venv/lib/python3.7/site-packages/djcelery_email/tasks.py”, line 40, in send_emails
[CELERY_WORKER][2022-10-17 11:56:14] conn.open()
[CELERY_WORKER][2022-10-17 11:56:14] File “/baserow/venv/lib/python3.7/site-packages/django/core/mail/backends/smtp.py”, line 62, in open
[CELERY_WORKER][2022-10-17 11:56:14] self.connection = self.connection_class(self.host, self.port, **connection_params)
[CELERY_WORKER][2022-10-17 11:56:14] File “/usr/lib/python3.7/smtplib.py”, line 251, in init
[CELERY_WORKER][2022-10-17 11:56:14] (code, msg) = self.connect(host, port)
[CELERY_WORKER][2022-10-17 11:56:14] File “/usr/lib/python3.7/smtplib.py”, line 338, in connect
[CELERY_WORKER][2022-10-17 11:56:14] (code, msg) = self.getreply()
[CELERY_WORKER][2022-10-17 11:56:14] File “/usr/lib/python3.7/smtplib.py”, line 394, in getreply

But the exactly lines needed to identify the problem are missing here.

I re-uploaded the .env file and now it worked. It’s sending email normally. Problem solved. Thank you very much, Bram!

1 Like