Postorius confirmation mails shown in uwsgi-error.log but not sent
I have struggled for hours but cannot seem to figure it out. After registering new user accounts in Postorius, the "confirm your address" emails don't get sent via SMTP (my MTA does not even log connection attempts), but their content is displayed in uwsgi-error.log.
I think I disabled developer mode in Core and Postorius:
$ mailman conf | grep devmode [devmode] enabled: no [devmode] recipient: [devmode] testing: no [devmode] wait: 60s
$ grep ^DEBUG settings.py DEBUG = False
Users can subscribe via list-join@domain.tld, including confirmations. Account registration using the WebUI works as well, it's just the emails that don't get sent. What am I missing, I wonder?
-Ralph
On Sat, Mar 28, 2020, at 1:59 PM, Ralph Seichter wrote:
I have struggled for hours but cannot seem to figure it out. After registering new user accounts in Postorius, the "confirm your address" emails don't get sent via SMTP (my MTA does not even log connection attempts), but their content is displayed in uwsgi-error.log.
I think I disabled developer mode in Core and Postorius:
$ mailman conf | grep devmode [devmode] enabled: no [devmode] recipient: [devmode] testing: no [devmode] wait: 60s
$ grep ^DEBUG settings.py DEBUG = False
Users can subscribe via list-join@domain.tld, including confirmations. Account registration using the WebUI works as well, it's just the emails that don't get sent. What am I missing, I wonder?
Have you setup email settings for Postorius separately?
https://docs.mailman3.org/en/latest/config-web.html#setting-up-email-require...
Core and Django unfortunately need to be configured separately to send out emails.
Abhilash
-Ralph
Mailman-users mailing list -- mailman-users@mailman3.org To unsubscribe send an email to mailman-users-leave@mailman3.org https://lists.mailman3.org/mailman3/lists/mailman-users.mailman3.org/
-- thanks, Abhilash Raj (maxking)
- Abhilash Raj:
Have you setup email settings for Postorius separately?
Yes, I forgot to include that information:
$ grep ^EMAIL settings.py EMAIL_BACKEND = 'django.core.mail.backends.smtp.EmailBackend' EMAIL_HOST = 'localhost' EMAIL_PORT = 25
As I said, the MTA does not log connection attempts from the Suite, nor do I find evidence that Django actually tries to send out email. Weird.
-Ralph
On 3/28/20 3:53 PM, Ralph Seichter wrote:
As I said, the MTA does not log connection attempts from the Suite, nor do I find evidence that Django actually tries to send out email. Weird.
What is the complete log message from uwsgi-error.log?
-- Mark Sapiro <mark@msapiro.net> The highway is for gamblers, San Francisco Bay Area, California better use your sense - B. Dylan
- Mark Sapiro:
What is the complete log message from uwsgi-error.log?
I'll attach a typical log file to this message. It shows startup messages followed by a recorded confirmation email. User name and domain are obfuscated, but other than that the log is unchanged.
-Ralph
*** Starting uWSGI 2.0.18 (64bit) on [Sat Mar 28 20:55:36 2020] *** compiled with version: 9.3.0 on 26 March 2020 13:58:28 os: Linux-5.5.13-gentoo #1 SMP Thu Mar 26 10:24:38 CET 2020 nodename: wedjat machine: x86_64 clock source: unix pcre jit disabled detected number of CPU cores: 8 current working directory: /var/lib/mailman detected binary path: /var/lib/mailman/venv/bin/uwsgi chdir() to /var/lib/mailman/suite/ your processes number limit is 256427 your memory page size is 4096 bytes detected max file descriptor number: 1024 lock engine: pthread robust mutexes thunder lock: disabled (you can enable it with --thunder-lock) uwsgi socket 0 bound to TCP address 127.0.0.1:8002 fd 8 Python version: 3.8.2 (default, Feb 26 2020, 08:14:41) [GCC 9.2.0] Python main interpreter initialized at 0x56443febc210 python threads support enabled your server socket listen backlog is limited to 100 connections your mercy for graceful operations on workers is 60 seconds mapped 166752 bytes (162 KB) for 2 cores *** Operational MODE: threaded *** WSGI app 0 (mountpoint='') ready in 1 seconds on interpreter 0x56443febc210 pid: 21912 (default app) *** uWSGI is running in multiple interpreter mode *** spawned uWSGI master process (pid: 21912) spawned uWSGI worker 1 (pid: 21916, cores: 2) 19:55:38 [Q] INFO Q Cluster pizza-illinois-golf-magnesium starting. 19:55:38 [Q] INFO Process-1:1 ready for work at 21921 19:55:38 [Q] INFO Process-1:2 ready for work at 21922 19:55:38 [Q] INFO Process-1:3 ready for work at 21923 19:55:38 [Q] INFO Process-1:4 ready for work at 21924 19:55:38 [Q] INFO Process-1:5 ready for work at 21925 19:55:38 [Q] INFO Process-1:6 ready for work at 21926 19:55:38 [Q] INFO Process-1:7 ready for work at 21927 19:55:38 [Q] INFO Process-1:8 ready for work at 21928 19:55:38 [Q] INFO Process-1:9 monitoring at 21929 19:55:38 [Q] INFO Process-1 guarding cluster pizza-illinois-golf-magnesium 19:55:38 [Q] INFO Process-1:10 pushing tasks at 21930 19:55:38 [Q] INFO Q Cluster pizza-illinois-golf-magnesium running. Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: [lists.domain.tld] Please Confirm Your E-mail Address From: postmaster@domain.tld To: OBFUSCATED@gmail.com Date: Sat, 28 Mar 2020 20:08:15 -0000 Message-ID: <158542609570.21916.15168402908994348907@wedjat.domain.tld>
Hello from lists.domain.tld!
You're receiving this e-mail because user OBFUSCATED has given yours as an e-mail address to connect their account.
To confirm this is correct, go to https://lists.domain.tld/accounts/confirm-email/Mg:1jIHkd:x8NSjzCkP5ifX6V39x...
Thank you from lists.domain.tld! lists.domain.tld
Do you have something like this1 in your settings.py file?
EMAIL_BACKEND = 'django.core.mail.backends.console.EmailBackend'
This is a dummy email backend which will basically only print the email to stdout, which seems to happen in your uwsgi-error.log. If you do, please comment it out and see if that solves your issue.
Abhilash
On Sat, Mar 28, 2020, at 5:38 PM, Ralph Seichter wrote:
- Mark Sapiro:
What is the complete log message from uwsgi-error.log?
I'll attach a typical log file to this message. It shows startup messages followed by a recorded confirmation email. User name and domain are obfuscated, but other than that the log is unchanged.
-Ralph
Mailman-users mailing list -- mailman-users@mailman3.org To unsubscribe send an email to mailman-users-leave@mailman3.org https://lists.mailman3.org/mailman3/lists/mailman-users.mailman3.org/
*Attachments:*
- uwsgi-error.log
-- thanks, Abhilash Raj (maxking)
On 3/29/20 6:46 PM, Abhilash Raj wrote:
Do you have something like this1 in your settings.py file?
EMAIL_BACKEND = 'django.core.mail.backends.console.EmailBackend'
This is a dummy email backend which will basically only print the email to stdout, which seems to happen in your uwsgi-error.log. If you do, please comment it out and see if that solves your issue.
I know Ralph previously posted
$ grep ^EMAIL settings.py EMAIL_BACKEND = 'django.core.mail.backends.smtp.EmailBackend' EMAIL_HOST = 'localhost' EMAIL_PORT = 25
but is this perhaps overridden in a settings_local.py file?
-- Mark Sapiro <mark@msapiro.net> The highway is for gamblers, San Francisco Bay Area, California better use your sense - B. Dylan
- Mark Sapiro:
$ grep ^EMAIL settings.py EMAIL_BACKEND = 'django.core.mail.backends.smtp.EmailBackend' EMAIL_HOST = 'localhost' EMAIL_PORT = 25
but is this perhaps overridden in a settings_local.py file?
I don't have a local settings file. I cloned the suite from GitLab[1] master branch and modified the existing settings.py, based on Mailman's documentation.
[1] https://gitlab.com/mailman/mailman-suite.git
I just verified that EMAIL_BACKEND is not redefined anywhere:
$ grep -r 'mail\.backends' . Binary file ./__pycache__/settings.cpython-38.pyc matches ./settings.py:EMAIL_BACKEND = 'django.core.mail.backends.smtp.EmailBackend' ./settings.py:# EMAIL_BACKEND = 'django.core.mail.backends.filebased.EmailBackend'
I commented out the "if DEBUG == True" lines, which explains match number three. As far as I can see, the mail backed definition for Django is as it should be.
I could provide the differences between my settings.py and the Git HEAD version if you think that might help.
-Ralph
On Mon, Mar 30, 2020, at 5:33 AM, Ralph Seichter wrote:
- Mark Sapiro:
$ grep ^EMAIL settings.py EMAIL_BACKEND = 'django.core.mail.backends.smtp.EmailBackend' EMAIL_HOST = 'localhost' EMAIL_PORT = 25
but is this perhaps overridden in a settings_local.py file?
I don't have a local settings file. I cloned the suite from GitLab[1] master branch and modified the existing settings.py, based on Mailman's documentation.
[1] https://gitlab.com/mailman/mailman-suite.git
I just verified that EMAIL_BACKEND is not redefined anywhere:
$ grep -r 'mail\.backends' . Binary file ./__pycache__/settings.cpython-38.pyc matches ./settings.py:EMAIL_BACKEND = 'django.core.mail.backends.smtp.EmailBackend' ./settings.py:# EMAIL_BACKEND = 'django.core.mail.backends.filebased.EmailBackend'
I commented out the "if DEBUG == True" lines, which explains match number three. As far as I can see, the mail backed definition for Django is as it should be.
I could provide the differences between my settings.py and the Git HEAD version if you think that might help.
It definitely would help if you paste the diff of the settings required.
Also, can you jump into a django shell and see if you can get any exceptions trying to send emails:
$ python manage.py shell
from django.core.mail import send_mail send_mail( 'Subject here', 'Here is the message.', 'from@example.com', ['to@example.com'], fail_silently=False, )
I picked it up from the Django's docs and perhaps fail_silently=False would give some exceptions. Please make sure you tail the logs for any connections.
Abhilash
-Ralph
Mailman-users mailing list -- mailman-users@mailman3.org To unsubscribe send an email to mailman-users-leave@mailman3.org https://lists.mailman3.org/mailman3/lists/mailman-users.mailman3.org/
-- thanks, Abhilash Raj (maxking)
- Abhilash Raj:
It definitely would help if you paste the diff of the settings required.
See attached diff file.
Also, can you jump into a django shell and see if you can get any exceptions trying to send emails [...]
Sending email from the Django shell in the manner you described works.
-Ralph
- Ralph Seichter:
See attached diff file.
Also, can you jump into a django shell and see if you can get any exceptions trying to send emails [...]
Sending email from the Django shell in the manner you described works.
Is there anything else I can provide? I have let this lie for a bit, hoping that coming back with a fresh perspective might help me figure out what I missed (I still hope it's me and not Mailman). Alas, I am still stuck.
-Ralph
participants (3)
-
Abhilash Raj
-
Mark Sapiro
-
Ralph Seichter