mirror of
https://github.com/modoboa/modoboa.git
synced 2026-04-25 17:06:01 +03:00
[GH-ISSUE #2201] SASL Login not working #1542
Labels
No labels
bug
bug
dependencies
design
documentation
duplicate
enhancement
enhancement
enhancement
feedback-needed
help-needed
help-needed
installer
invalid
looking-for-sponsors
modoboa-contacts
new-ui
new-ui
pr
pull-request
pyconfr
python
question
security
stale
webmail
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/modoboa-modoboa#1542
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @danielsatanik on GitHub (Mar 20, 2021).
Original GitHub issue: https://github.com/modoboa/modoboa/issues/2201
Impacted versions
Steps to reproduce
I don't know
Current behavior
One of my users mentioned that they cannot send mails anymore. I confirmed that. When I look into /var/log/mail.log I can see the following errors:
Mar 20 23:41:39 satanik dovecot: postlogin: Error: Password:
Mar 20 23:41:39 satanik dovecot: postlogin: Error: psql: fe_sendauth: no password supplied
I first assumed the issue may be with the file specifying the SQL-statements, but rebuilding them with the manage.py command hasn't worked. Afterwards I tried (for the heck of it) to upgrade modoboa. The previous version was 1.14.0 and I upgraded straight to 1.17.0. I followed alle the upgrade guides and and had to upgrade python from 2 to 3.
The problem persisted and additionally uwsgi fails me now. Which means nginx cannot properly connect to the socket.
Regardless, I afterwards tried to follow the "Reinstall" instructions but that hasn't paid off either.
Weird as it is, I haven't changed anything on my system for a very long time. Periodically a bunch of cronjobs are running, but I don't think they actually did anything that could influence modoboa.
I actually don't even know anymore how to debug the issue. Google wasn't helpful at. all, maybe I was searching with the wrong terms.
Expected behavior
sending mails and login on the django website should work
Video/Screenshot link (optional)
@danielsatanik commented on GitHub (Mar 20, 2021):
BTW I wouldn't mind reinstalling everything as long as I don't loose the mails, users, amavis, spamassassin and stuff
@tonioo commented on GitHub (Mar 23, 2021):
@danielsatanik The error message you're showing is related to a postlogin script used by Modoboa. It's related to IMAP/POP connections so it has nothing to do with emails sending since it's using SMTP...
To be sure it's not the cause of your problems, you can comment out the use of this script in the /etc/dovecot/conf.d/10-master.conf file and reload dovecot.
@danielsatanik commented on GitHub (Mar 23, 2021):
Hi, you are right. I saw that the emails are sent. The postlogin script registers the last login time in the database and is from the official installation. But for some reason it does not work anymore. As a workaround I disabled it. But I tried the sql command manually and it worked. So I don't know exactly what fails here.
Unfortunately some of the cron.d/mdoboa commands also fail, which are
I disabled them as well, because I received many failure mails.
I did upgrade from Modoboa 14 to 17 and Python 2 to 3 and followed all the upgrade instructions, but maybe there were some specifics that did not work as intended.
It also lead to the webinterface not being loaded anymore, I think it may have something to do with uwsgi and the change from Python 2 to 3.
@tonioo commented on GitHub (Mar 23, 2021):
Do you have errors to show?
@danielsatanik commented on GitHub (Mar 23, 2021):
@tonioo I'll run them manually
The other two seemed to work when I ran them manually. For the postlogin script it says
and for the uwsgi:
@tonioo commented on GitHub (Mar 23, 2021):
The qcleanup one is known, there is an opened issue for this and it's actually an issue with psycopg2 (the postgres python connector).
The update_statistics one is strange, have you checked permissions of the folder used to store rrd files?
The postlogin error means there is a configuration in postgresql preventing to execute SQL queries without authentication. which is what the script does...
The error you see in nginx logs means the uwsgi instance is not running.
@danielsatanik commented on GitHub (Mar 23, 2021):
Hi,
I have checked the rrd directory, and even tried to give it unrestricted permissions with
chmod 0777but that didn't help. I found the settings inside the database somewhere in core_localconfig or smth.what settings for the postlogin may restrict the access? The psql instance was set up with modoboa and I haven't done any updates lately so there shouldn't have changed anything, but of course there must have. So is it an issue with the hba-file? Would you have the preferred settings available?
as for the uwsgi. The systemd service itself is running so what do you mean is not running? the emperor instance or smth? I'm not very familiar with uwsgi to debug the issue, without extensive research, could you give me a few pointers? As I said it may have to do with changing from Python 2 to 3. What I did was deleting the old venv and just creating a new one with Python3 inside, and then reinstalling all the pip packages needed for modoboa to work. But that certainly had no effects on the uwsgi settings. Do I need to change the emperor-app settings file?
@tonioo commented on GitHub (Mar 24, 2021):
What's the content of you pg_hba.conf file?
About uwsgi, make sure you installed the python3 plugin and that you've updated the modoboa configuration file accordingly. (/etc/uwsgi/)
@danielsatanik commented on GitHub (Mar 24, 2021):
I haven't change a single line in the pg_hba.conf since installing modoboa but this is the content:
for uwsgi, I could build the python36 plugin, thank you for the tip. I also replaced the plugin in the config accordingly. It still yields 500 Server Error and the resulting log message is the following:
When I googled it, some said that could happen when there are multiple instances so I tried setting processes in the config to 1, but that hasn't helped much. Was I missing a step, except for restarting the uwsgi.service?
@tonioo commented on GitHub (Mar 24, 2021):
For uwsgi, add the following to your configuration file:
And according to the postgres config, I think it should work...
@danielsatanik commented on GitHub (Mar 24, 2021):
@tonioo the single-interpreter option worked thank you.
For the pg_hba.conf. What would be the relevant line.
PS: I would like to suggest putting the tips you gave into the upgrade instructions somewhere. Especially those about what to watch out for when changing from version 1.14.0 to 1.15.0 which enforces using Python3 then.
@stale[bot] commented on GitHub (May 25, 2021):
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.