Activating SOGo Later: Unauthorized until Auto-Redirect Happened
Contribution guidelines
- [x] I've read the contribution guidelines and wholeheartedly agree
I've found a bug and checked that ...
- [x] ... I understand that not following the below instructions will result in immediate closure and/or deletion of my issue.
- [x] ... I have understood that this bug report is dedicated for bugs, and not for support-related inquiries.
- [x] ... I have understood that answers are voluntary and community-driven, and not commercial support.
- [x] ... I have verified that my issue has not been already answered in the past. I also checked previous issues.
Description
Hi,
until `2025-03a`, I disabled SOGo using `SKIP_SOGO=y` due to resource constraints.
With `2025-03a`, I enabled SOGo but disabled automated redirects for the users.
Clicking the `Webmail` button in the user dashboard opens SOGo with the error message `Unauthorized`. The SOGo container's logs do not contain any helpful information.
Now, I've figured out that SOGo works by enabling the automated redirect (`Direct forwarding to SOGo`) for the user and logging the user in once.
SOGo still works if I disable the redirect and now click the `Webmail` button.
Other users will not work until I enable this option and let them log in at least once.
The auto-redirect does something that authorizes the user for SOGo, and this action must run through once.
Ideally, users should be able to log in to SOGo even if the redirect was never enabled/happening.
(Note: this report comes from https://community.mailcow.email/d/4758-activating-sogo-later-unauthorized after finding out that I must enable the option at least once with a login happening.)
Logs:
sogo-mailcow-1 | 2025-03-31 16:40:34,517 INFO Set uid to user 0 succeeded
sogo-mailcow-1 | 2025-03-31 16:40:34,519 INFO supervisord started with pid 1
sogo-mailcow-1 | 2025-03-31 16:40:35,524 INFO spawned: 'processes' with pid 7
sogo-mailcow-1 | 2025-03-31 16:40:35,531 INFO spawned: 'syslog-ng' with pid 8
sogo-mailcow-1 | 2025-03-31 16:40:35,537 INFO spawned: 'bootstrap-sogo' with pid 9
sogo-mailcow-1 | Uptime: 0 Threads: 2 Questions: 1 Slow queries: 0 Opens: 17 Open tables: 10 Queries per second avg: 0.000
sogo-mailcow-1 | DB schema is 27012025_1555
sogo-mailcow-1 | [2025-03-31T16:40:35.592046] WARNING: With use-dns(no), dns-cache() will be forced to 'no' too!;
sogo-mailcow-1 | Mar 31 16:40:35 85469bed8ef8 syslog-ng[8]: syslog-ng starting up; version='3.38.1'
sogo-mailcow-1 | patching file /usr/lib/GNUstep/SOGo/Templates/UIxTopnavToolbar.wox
sogo-mailcow-1 | Syncing web content with named volume
sogo-mailcow-1 | Mar 31 16:40:35 85469bed8ef8 sogod [9]: version 5.11.2 (build @2bb892454cf4 202503240145) -- starting
sogo-mailcow-1 | Mar 31 16:40:35 85469bed8ef8 sogod [9]: vmem size check enabled: shutting down app when vmem > 384 MB. Currently at 88 MB
sogo-mailcow-1 | Mar 31 16:40:35 85469bed8ef8 sogod [9]: <0x0x56aa6525fa30[SOGoProductLoader]> SOGo products loaded from '/usr/lib/GNUstep/SOGo':
sogo-mailcow-1 | Mar 31 16:40:35 85469bed8ef8 sogod [9]: <0x0x56aa6525fa30[SOGoProductLoader]> Contacts.SOGo, MailerUI.SOGo, Appointments.SOGo, AdministrationUI.SOGo, MainUI.SOGo, ActiveSync.SOGo, CommonUI.SOGo, Mailer.SOGo, ContactsUI.SOGo, MailPartViewers.SOGo, SchedulerUI.SOGo, PreferencesUI.SOGo
sogo-mailcow-1 | Mar 31 16:40:35 85469bed8ef8 sogod [9]: All products loaded - current memory usage at 95 MB
sogo-mailcow-1 | Mar 31 16:40:35 85469bed8ef8 sogod [9]: <0x0x56aa6528f040[WOWatchDog]> listening on 0.0.0.0:20000
sogo-mailcow-1 | Mar 31 16:40:35 85469bed8ef8 sogod [9]: <0x0x56aa6528f040[WOWatchDog]> watchdog process pid: 9
sogo-mailcow-1 | Mar 31 16:40:35 85469bed8ef8 sogod [9]: <0x0x79bcefa1f460[WOWatchDogChild]> watchdog request timeout set to 30 minutes
sogo-mailcow-1 | Mar 31 16:40:35 85469bed8ef8 sogod [9]: <0x0x56aa6528f040[WOWatchDog]> preparing 20 children
sogo-mailcow-1 | Mar 31 16:40:35 85469bed8ef8 sogod [9]: <0x0x56aa6528f040[WOWatchDog]> child spawned with pid 48
sogo-mailcow-1 | Mar 31 16:40:35 85469bed8ef8 sogod [9]: <0x0x56aa6528f040[WOWatchDog]> child spawned with pid 49
sogo-mailcow-1 | Mar 31 16:40:35 85469bed8ef8 sogod [9]: <0x0x56aa6528f040[WOWatchDog]> child spawned with pid 50
sogo-mailcow-1 | Mar 31 16:40:35 85469bed8ef8 sogod [9]: <0x0x56aa6528f040[WOWatchDog]> child spawned with pid 51
sogo-mailcow-1 | Mar 31 16:40:35 85469bed8ef8 sogod [9]: <0x0x56aa6528f040[WOWatchDog]> child spawned with pid 52
sogo-mailcow-1 | Mar 31 16:40:35 85469bed8ef8 sogod [9]: <0x0x56aa6528f040[WOWatchDog]> child spawned with pid 53
sogo-mailcow-1 | Mar 31 16:40:35 85469bed8ef8 sogod [9]: <0x0x56aa6528f040[WOWatchDog]> child spawned with pid 54
sogo-mailcow-1 | Mar 31 16:40:35 85469bed8ef8 sogod [9]: <0x0x56aa6528f040[WOWatchDog]> child spawned with pid 55
sogo-mailcow-1 | Mar 31 16:40:35 85469bed8ef8 sogod [9]: <0x0x56aa6528f040[WOWatchDog]> child spawned with pid 56
sogo-mailcow-1 | Mar 31 16:40:35 85469bed8ef8 sogod [9]: <0x0x56aa6528f040[WOWatchDog]> child spawned with pid 57
sogo-mailcow-1 | Mar 31 16:40:35 85469bed8ef8 sogod [9]: <0x0x56aa6528f040[WOWatchDog]> child spawned with pid 58
sogo-mailcow-1 | Mar 31 16:40:35 85469bed8ef8 sogod [51]: <0x0x56aa6525ce90[WOHttpAdaptor]> notified the watchdog that we are ready
sogo-mailcow-1 | Mar 31 16:40:35 85469bed8ef8 sogod [9]: <0x0x56aa6528f040[WOWatchDog]> child spawned with pid 59
sogo-mailcow-1 | Mar 31 16:40:35 85469bed8ef8 sogod [9]: <0x0x56aa6528f040[WOWatchDog]> child spawned with pid 60
sogo-mailcow-1 | Mar 31 16:40:35 85469bed8ef8 sogod [9]: <0x0x56aa6528f040[WOWatchDog]> child spawned with pid 61
sogo-mailcow-1 | Mar 31 16:40:36 85469bed8ef8 sogod [9]: <0x0x56aa6528f040[WOWatchDog]> child spawned with pid 62
sogo-mailcow-1 | Mar 31 16:40:36 85469bed8ef8 sogod [52]: <0x0x56aa654b1fb0[WOHttpAdaptor]> notified the watchdog that we are ready
sogo-mailcow-1 | Mar 31 16:40:36 85469bed8ef8 sogod [9]: <0x0x56aa6528f040[WOWatchDog]> child spawned with pid 63Mar 31 16:40:36 sogod [56]: <0x0x56aa6525cdc0[WOHttpAdaptor]> notified the watchdog that we are ready
sogo-mailcow-1 | Mar 31 16:40:36 85469bed8ef8 sogod [9]: <0x0x56aa6528f040[WOWatchDog]> child spawned with pid 64
sogo-mailcow-1 | Mar 31 16:40:36 85469bed8ef8 sogod [50]: <0x0x56aa6525ce90[WOHttpAdaptor]> notified the watchdog that we are ready
sogo-mailcow-1 | Mar 31 16:40:36 85469bed8ef8 sogod [48]: <0x0x56aa6525ce90[WOHttpAdaptor]> notified the watchdog that we are ready
sogo-mailcow-1 | Mar 31 16:40:36 85469bed8ef8 sogod [55]: <0x0x56aa6525cdc0[WOHttpAdaptor]> notified the watchdog that we are ready
sogo-mailcow-1 | Mar 31 16:40:36 85469bed8ef8 sogod [9]: <0x0x56aa6528f040[WOWatchDog]> child spawned with pid 65
sogo-mailcow-1 | Mar 31 16:40:36 85469bed8ef8 sogod [9]: <0x0x56aa6528f040[WOWatchDog]> child spawned with pid 66
sogo-mailcow-1 | Mar 31 16:40:36 85469bed8ef8 sogod [54]: <0x0x56aa6525ce90[WOHttpAdaptor]> notified the watchdog that we are ready
sogo-mailcow-1 | Mar 31 16:40:36 85469bed8ef8 sogod [59]: <0x0x56aa653c01d0[WOHttpAdaptor]> notified the watchdog that we are ready
sogo-mailcow-1 | Mar 31 16:40:36 85469bed8ef8 sogod [57]: <0x0x56aa6525ce90[WOHttpAdaptor]> notified the watchdog that we are ready
sogo-mailcow-1 | Mar 31 16:40:36 85469bed8ef8 sogod [53]: <0x0x56aa653a3f10[WOHttpAdaptor]> notified the watchdog that we are ready
sogo-mailcow-1 | Mar 31 16:40:36 85469bed8ef8 sogod [9]: <0x0x56aa6528f040[WOWatchDog]> child spawned with pid 67
sogo-mailcow-1 | Mar 31 16:40:36 85469bed8ef8 sogod [49]: <0x0x56aa65286500[WOHttpAdaptor]> notified the watchdog that we are ready
sogo-mailcow-1 | Mar 31 16:40:36 85469bed8ef8 sogod [58]: <0x0x56aa653c01d0[WOHttpAdaptor]> notified the watchdog that we are ready
sogo-mailcow-1 | Mar 31 16:40:36 85469bed8ef8 sogod [60]: <0x0x56aa6525ce90[WOHttpAdaptor]> notified the watchdog that we are ready
sogo-mailcow-1 | Mar 31 16:40:36 85469bed8ef8 sogod [63]: <0x0x56aa6525ce00[WOHttpAdaptor]> notified the watchdog that we are ready
sogo-mailcow-1 | Mar 31 16:40:36 85469bed8ef8 sogod [61]: <0x0x56aa654b1fb0[WOHttpAdaptor]> notified the watchdog that we are ready
sogo-mailcow-1 | Mar 31 16:40:36 85469bed8ef8 sogod [64]: <0x0x56aa6525ce90[WOHttpAdaptor]> notified the watchdog that we are ready
sogo-mailcow-1 | Mar 31 16:40:36 85469bed8ef8 sogod [62]: <0x0x56aa65247c40[WOHttpAdaptor]> notified the watchdog that we are ready
sogo-mailcow-1 | Mar 31 16:40:36 85469bed8ef8 sogod [65]: <0x0x56aa6525ce90[WOHttpAdaptor]> notified the watchdog that we are ready
sogo-mailcow-1 | Mar 31 16:40:36 85469bed8ef8 sogod [66]: <0x0x56aa653c01d0[WOHttpAdaptor]> notified the watchdog that we are ready
sogo-mailcow-1 | Mar 31 16:40:36 85469bed8ef8 sogod [67]: <0x0x56aa6525ce90[WOHttpAdaptor]> notified the watchdog that we are ready
sogo-mailcow-1 | 2025-03-31 16:40:37,272 INFO success: processes entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
sogo-mailcow-1 | 2025-03-31 16:40:37,272 INFO success: syslog-ng entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
sogo-mailcow-1 | 2025-03-31 16:40:37,272 INFO success: bootstrap-sogo entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
sogo-mailcow-1 | Mar 31 16:41:37 85469bed8ef8 sogod [67]: <0x0x56aa65230670[SOGoCache]> Cache cleanup interval set every 900.000000 seconds
sogo-mailcow-1 | Mar 31 16:41:37 85469bed8ef8 sogod [67]: <0x0x56aa65230670[SOGoCache]> Using host(s) 'memcached' as server(s)
sogo-mailcow-1 | Mar 31 16:41:37 85469bed8ef8 sogod [67]: [WARN] <0x0x79bcefa40bc0[WOxElemBuilder]> could not locate builders: WOxExtElemBuilder,WOxExtElemBuilder
sogo-mailcow-1 | Mar 31 16:41:37 85469bed8ef8 sogod [67]: mailcow-watchdog-mailcow-1.mailcow_mailcow-network "GET /SOGo.index/ HTTP/1.1" 200 2581/0 0.116 - - 4M - 11
sogo-mailcow-1 | Mar 31 16:41:38 85469bed8ef8 sogod [67]: 172.18.0.4 "GET /SOGo/so HTTP/1.0" 302 0/0 0.027 - - 384K - 11
sogo-mailcow-1 | Mar 31 16:41:38 85469bed8ef8 sogod [67]: 172.18.0.4 "GET /SOGo/so/ HTTP/1.0" 403 12/0 0.003 - - 0 - 12
sogo-mailcow-1 | Mar 31 16:41:39 85469bed8ef8 sogod [67]: 172.18.0.4 "GET /SOGo/so/ HTTP/1.0" 403 12/0 0.002 - - 0 - 12
sogo-mailcow-1 | Mar 31 16:41:39 85469bed8ef8 sogod [67]: 172.18.0.4 "GET /SOGo/so/ HTTP/1.0" 403 12/0 0.002 - - 0 - 12
Steps to reproduce:
1. Enable SOGo after it was disabled. (This was my case, but maybe it also happens in general?)
2. Create a user without enabling the auto-redirect to SOGo.
3. Let the user login and click the `Webmail` button.
4. SOGo opens and shows `Unauthorized`.
5. Enable the auto-redirect for this user.
6. Let the user login, and SOGo successfully loads.
7. Disable the option again.
8. Let the user login and click the `Webmail` button.
9. SOGo opens and works successfully.
Which branch are you using?
master
Which architecture are you using?
x86
Operating System:
Ubuntu 24.04
Server/VM specifications:
4 CPU, 8GB memory
Is Apparmor, SELinux or similar active?
no
Virtualization technology:
KVM
Docker version:
latest
docker-compose version or docker compose version:
latest
mailcow version:
2025-03a
Reverse proxy:
traefik
Logs of git diff:
No changes.
Logs of iptables -L -vn:
Not relevant.
Logs of ip6tables -L -vn:
Not relevant.
Logs of iptables -L -vn -t nat:
Not relevant.
Logs of ip6tables -L -vn -t nat:
Not relevant.
DNS check:
Not relevant.
i got the same error, after frech install
my user can't connect :/
what i can do please ?
did you enable the automated redirect in the e-mail user's settings?
as mentioned, i had to enable this once and login with the user to get it permanently to work (even without an automated redirect)...
OMG i just restart my serveur and now that's works :/
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.
i have this probleme
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.
i have this same problem
I had the problem after adding a new domain. I restarted mailcow to fix the issue.