Taiga is not sending out e-mails

1,870 views
Skip to first unread message

László Nagy

unread,
Dec 2, 2017, 5:49:37 AM12/2/17
to taigaio
Hi! I have just installed Taiga.io on a server, and I'm not able to invite new users, because the emails won't be sent.

On the server where taiga.io is installed, I have this backend config:

from .common import *

MEDIA_URL = "https://taiga.not_telling.com/media/"
STATIC_URL = "https://taiga.not_telling.com/static/"
SITES["front"]["scheme"] = "https"
SITES["front"]["domain"] = "taiga.not_telling.com"

SECRET_KEY = "(my key is here)"

DEBUG = True
PUBLIC_REGISTER_ENABLED = False

DEFAULT_FROM_EMAIL = "taiga@not_telling.com"
SERVER_EMAIL = DEFAULT_FROM_EMAIL

#CELERY_ENABLED = True

EVENTS_PUSH_BACKEND = "taiga.events.backends.rabbitmq.EventsPushBackend"
EVENTS_PUSH_BACKEND_OPTIONS = {"url": "amqp://taiga:another_not_telling@localhost:5672/taiga"}

# Uncomment and populate with proper connection parameters
# for enable email sending. EMAIL_HOST_USER should end by @domain.tld
EMAIL_BACKEND = "django.core.mail.backends.smtp.EmailBackend"
EMAIL_USE_TLS = False
EMAIL_HOST = "not_telling.com"
EMAIL_HOST_USER = "taiga@not_telling.com"
EMAIL_HOST_PASSWORD = "guess_what_not_telling this either"
EMAIL_PORT = 465

The mail server is located elsewhere (e.g. taiga.not_telling.com and not_telling.com are different). When I try to invite a new user by pressing the "invite" button the following happens:

* on the front end, a progress spinner appears on the button and it spins almost forever
* in gunicorn.stderr.log, nothing is visible (even though DEBUG is turned on)
* on the mail server (smtp/postfix) log I see this:


Dec  2 05:02:49 not_telling postfix/smtps/smtpd[25239]: connect from taiga.not_telling.com[111.111.111.111]

and then nothing happens for exactly one minute, then:


Dec  2 05:03:49 not_telling postfix postfix/smtps/smtpd[25239]: lost connection after CONNECT from taiga.not_telling.com[111.111.111.111]
Dec  2 05:03:49 not_telling postfix postfix/smtps/smtpd[25239]: disconnect from taiga.not_telling.com[111.111.111.111]

In other words: the taiga backend actually connects the smtp server, but then it does nothing. The strangest thing is that there is absolutely nothing in gunicorn.stderr.log, so I have no idea how to identify the problem.

Any ideas please?

Thank you,

    Laszlo



László Nagy

unread,
Dec 6, 2017, 1:34:05 PM12/6/17
to taigaio
Nobody knows the answer? Where should I look? It took me several hours to choose from the available project management tools, and it took 2 hours to install it. I would hate to delete the whole thing just because it cannot send out notification emails.

David Barragán

unread,
Dec 7, 2017, 8:12:55 AM12/7/17
to László Nagy, taigaio
Try this in the taiga machine:

cd taiga-back
workon taiga
./manage.py shell

from django.core import mail
mail.send_mail("Subject", "Body", "FR...@mail.com", ["T...@mail.com"], fail_silently=False)

With this commands you can test the connection between Taiga and your smtp server. I think Taiga can connect with your smtp server, maybe the credentials or maybe because yoyu have to enable TLS and set to True.

On Wed, Dec 6, 2017 at 7:34 PM, László Nagy <nag...@gmail.com> wrote:
Nobody knows the answer? Where should I look? It took me several hours to choose from the available project management tools, and it took 2 hours to install it. I would hate to delete the whole thing just because it cannot send out notification emails.

--
Please help us keep the Taiga.io Community open and inclusive, follow our Code of Conduct:
https://github.com/taigaio/code-of-conduct/blob/master/CODE_OF_CONDUCT.md
---
You received this message because you are subscribed to the Google Groups "taigaio" group.
To unsubscribe from this group and stop receiving emails from it, send an email to taigaio+unsubscribe@googlegroups.com.
To post to this group, send email to tai...@googlegroups.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/taigaio/ca37088a-25cf-472c-9f8c-cdc616173fb9%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.



--

 
David Barragán Merino  
Engineer

www.kaleidos.net/FFF8E7

László Nagy

unread,
Dec 8, 2017, 3:15:10 AM12/8/17
to taigaio


2017. december 7., csütörtök 14:12:55 UTC+1 időpontban David Barragán a következőt írta:
Try this in the taiga machine:

cd taiga-back
workon taiga
./manage.py shell

from django.core import mail
mail.send_mail("Subject", "Body", "FR...@mail.com", ["T...@mail.com"], fail_silently=False)

With this commands you can test the connection between Taiga and your smtp server. I think Taiga can connect with your smtp server, maybe the credentials or maybe because yoyu have to enable TLS and set to True.

I guess you were expecting a traceback. The method call above just blocks, and it never returns.

On the SMTP server side, I can see that the client is connected, and after exactly one minute it is disconnected.

If I press Ctrl+C then I get this:

CTraceback (most recent call last):
  File "<console>", line 1, in <module>
  File "/home/taiga/.virtualenvs/taiga/lib/python3.6/site-packages/django/core/mail/__init__.py", line 62, in send_mail
    return mail.send()
  File "/home/taiga/.virtualenvs/taiga/lib/python3.6/site-packages/django/core/mail/message.py", line 342, in send
    return self.get_connection(fail_silently).send_messages([self])
  File "/home/taiga/.virtualenvs/taiga/lib/python3.6/site-packages/django/core/mail/backends/smtp.py", line 100, in send_messages
    new_conn_created = self.open()
  File "/home/taiga/.virtualenvs/taiga/lib/python3.6/site-packages/django/core/mail/backends/smtp.py", line 58, in open
    self.connection = connection_class(self.host, self.port, **connection_params)
  File "/usr/lib/python3.6/smtplib.py", line 251, in __init__
    (code, msg) = self.connect(host, port)
  File "/usr/lib/python3.6/smtplib.py", line 338, in connect
    (code, msg) = self.getreply()
  File "/usr/lib/python3.6/smtplib.py", line 387, in getreply
    line = self.file.readline(_MAXLINE + 1)
  File "/usr/lib/python3.6/socket.py", line 586, in readinto
    return self._sock.recv_into(b)
KeyboardInterrupt

The same thing happens with both EMAIL_USE_TLS=True and EMAIL_USE_TLS=False. The SMTP server is good for sure, I'm sending out emails through that every day.



David Barragán

unread,
Dec 8, 2017, 5:13:05 AM12/8/17
to László Nagy, taigaio
The traceback say that you've pressed ctrl-c during the server is trying to connect with the smtp server. So it seems the problem is that the server can't communicate with the smtp server.


Regards

--
Please help us keep the Taiga.io Community open and inclusive, follow our Code of Conduct:
https://github.com/taigaio/code-of-conduct/blob/master/CODE_OF_CONDUCT.md
---
You received this message because you are subscribed to the Google Groups "taigaio" group.
To unsubscribe from this group and stop receiving emails from it, send an email to taigaio+unsubscribe@googlegroups.com.
To post to this group, send email to tai...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

László Nagy

unread,
Dec 8, 2017, 6:14:48 AM12/8/17
to taigaio


2017. december 8., péntek 11:13:05 UTC+1 időpontban David Barragán a következőt írta:
The traceback say that you've pressed ctrl-c during the server is trying to connect with the smtp server. So it seems the problem is that the server can't communicate with the smtp server.


You mean, the taiga-backend server (acting as an SMTP client) cannot communicate with the smtp server.

Here is what I did. I setup an ssh tunnel to simulate email sending from the taiga backend server through the selected smtp server. Then I used my thunderbird to send out a test email. The SMTP server shows this log:

Dec  8 05:46:21 not_telling postfix/smtps/smtpd[11275]: connect from unknown[111.111.111.111]
Dec  8 05:46:21 not_telling postfix/smtps/smtpd[11275]: Anonymous TLS connection established from unknown[111.111.111.111]: TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)
Dec  8 05:46:21 not_telling postfix/smtps/smtpd[11275]: AF715A7057BB: client=unknown[111.111.111.111], sasl_method=PLAIN, sasl_username=not_telling@not_telling.com
Dec  8 05:46:21 not_telling postfix/cleanup[11279]: AF715A7057BB: not_tellingage-id=<108675ea-2c22-0a70-e478-d939d1c28be6@not_telling.com>
Dec  8 05:46:21 not_telling opendkim[760]: AF715A7057BB: DKIM-Signature field added (s=not_telling, d=not_telling)
Dec  8 05:46:21 not_telling postfix/qmgr[1009]: AF715A7057BB: from=<not_telling@not_telling.com>, size=363, nrcpt=1 (queue active)
Dec  8 05:46:21 not_telling postfix/smtps/smtpd[11275]: disconnect from unknown[111.111.111.111]

In other words, I was able to send out an email from the same source ip address, to the same smtp server, using thunderbird. This prooves that the network setup is good, and the smtp server setup is good.

What else could I do? Any idea? :-(

László Nagy

unread,
Dec 9, 2017, 2:34:45 AM12/9/17
to taigaio
Here is the solution!

The SMTP server was using SSL instead of TLS (I mean, port 465 instead of 587). When I was setting up the server, I already wondered why we don't have SSL?

After reading through multiple forums, a very important piece of code catched my attention. You can actually use EMAIL_USE_SSL=True instead of EMAIL_USE_TLS=True in the local.py file.

I think that the default local.py MUST include this option! Because this is a hidden option in the config file, and any system admin who opens the local.py file will think that the given (commented out) options are the only ones. The worst part is that if you use TLS instead of SSL, then there will be no error message and no traceback at all, because the client wants to talk with TLS, and the server wants to talk with SSL, and the result is that the client waits for extra data from the server forever. It was very hard (at least for me) to figure out this.

David, are you a developer at Tagia.io? Can you please submit a PR? Just these two extra lines in the default config file:

# You cannot use both at the same time!
# EMAIL_USE_TLS = False
# EMAIL_USE_SSL = False

Thanks!

   Laszlo

David Barragán

unread,
Dec 9, 2017, 10:51:53 AM12/9/17
to László Nagy, taigaio
Done, https://github.com/taigaio/taiga-back/commit/b798846c5c28b802fcf70c1b39bee568b95134ea

Thank you very much László and sorry for thew inconvenience

--
Please help us keep the Taiga.io Community open and inclusive, follow our Code of Conduct:
https://github.com/taigaio/code-of-conduct/blob/master/CODE_OF_CONDUCT.md
---
You received this message because you are subscribed to the Google Groups "taigaio" group.
To unsubscribe from this group and stop receiving emails from it, send an email to taigaio+unsubscribe@googlegroups.com.
To post to this group, send email to tai...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

László Nagy

unread,
Dec 10, 2017, 6:05:59 AM12/10/17
to taigaio


2017. december 9., szombat 16:51:53 UTC+1 időpontban David Barragán a következőt írta:
 

Thank you very much László and sorry for thew inconvenience
 
I'm glad that I could improve taiga. :-)
 
Reply all
Reply to author
Forward
0 new messages