Hi everyone,
SOGo still has no built-in dark mode, and the existing CSS themes tend to break after SOGo updates. So I built a different approach and would like to share it:
Sub-7/mailcow-sogo-darkmode



What it does
Dark mode for mail, calendar, contacts and preferences: Auto (follows the system), Dark or Off
Toggle button in SOGo’s toolbar, shortcut Alt+Shift+D
Color sliders and presets, custom header color
Resize folder pane, message list, header and user area by dragging the borders
Text size per area (folder pane, message list, reading pane, header, user area)
English and German UI, following the SOGo language
Settings per browser, every user chooses their own
Why it survives updates It’s one JavaScript file, mounted via docker-compose.override.yml onto the js/theme.js that SOGo already loads on every page. It doesn’t replace SOGo’s stylesheets, so SOGo updates don’t break it. It doesn’t modify any mailcow file (git diff stays empty), so update.sh doesn’t touch it. An optional post_update_hook.sh keeps the mount path in sync if mailcow ever changes it.
Safe to try
You can test it first without touching the server: paste the file into the browser console on your SOGo page. It only affects that tab until you reload.
Installing only restarts the SOGo container for a few seconds. Mail delivery, IMAP and SMTP are not affected.
If the script fails, SOGo simply looks like before. Removal takes three steps, and a checksum confirms that SOGo serves mailcow’s original file again. Everything is in the README.
No network access at all (no fetch/XHR/WebSocket, no external resources, no eval, no cookies). It only stores its settings in localStorage. It’s a single readable file, please review it before installing.
Known limitations
It works with a color filter, so HTML emails with their own colors are shown inverted too (images keep their normal colors).
If you customized custom-theme.js for your own SOGo colors, those won’t load while this is installed.
Text size needs CSS zoom (current Chrome/Edge/Safari, Firefox 126+).
Tested with SOGo 5.12 on my own mailcow server. Built with the help of an AI assistant (Claude) and tested in daily use.
Feedback, bug reports and translations (it’s one block per language in the script) are very welcome!