h-moogii
If you are using SOGo in the Japanese locale (ja), this issue is caused by a date parsing mismatch in AngularJS’s md-datepicker within the Vacation settings (vacationStartDate / vacationEndDate).
When initializing the settings form, the date format mismatch triggers an $invalid validation status, which locks the entire preferencesForm, disables the Save button, and grays out the sidebar navigation when clicking on “Mail”.
Since SOGo serves bundled JavaScript (Preferences.js), editing individual source files often gets ignored or overwritten after container updates.
Here is a automated bash script that patches the bundled JS directly on the host side. It persists across container restarts and can be re-run easily after Mailcow updates (./update.sh).
Automated Fix Script (sogo_fix.sh)
Run the following commands on your Mailcow host:
cat << 'EOF' > /opt/mailcow-dockerized/sogo_fix.sh
#!/bin/bash
set -e
echo "=== Applying SOGo Japanese Date Validation Patch ==="
SOGO_CONTAINER=$(docker ps -q -f name=sogo-mailcow)
if [ -z "$SOGO_CONTAINER" ]; then
echo "Error: sogo-mailcow container is not running."
exit 1
fi
TMP_DIR=$(mktemp -d)
trap "rm -rf $TMP_DIR" EXIT
cd $TMP_DIR
PREF_JS_PATH=$(docker exec $SOGO_CONTAINER find / -name "Preferences.js" 2>/dev/null | head -n 1)
if [ -z "$PREF_JS_PATH" ]; then
echo "Error: Preferences.js not found inside the container."
exit 1
fi
echo "Target asset path: ${PREF_JS_PATH}"
docker cp ${SOGO_CONTAINER}:${PREF_JS_PATH} ./Preferences.js
python3 -c '
filename = "Preferences.js"
with open(filename, "r", encoding="utf-8") as f:
content = f.read()
auto_fix_script = """
/* SOGo Vacation Datepicker Validation Permanent Fix */
(function autoFixVacation() {
setInterval(function() {
var formEl = document.querySelector(\x27form[name="preferencesForm"]\x27);
if (!formEl) return;
var form = angular.element(formEl).controller(\x27form\x27);
if (form) {
var touched = false;
[\x27vacationStartDate\x27, \x27vacationEndDate\x27].forEach(function(name) {
var ctrl = form[name];
if (ctrl && !ctrl.$valid) {
ctrl.$setValidity("parse", true);
ctrl.$setValidity("valid", true);
touched = true;
}
});
if (touched) {
try {
angular.element(document.body).injector().get(\x27$rootScope\x27).$digest();
} catch(e) {}
}
}
}, 150);
})();
"""
if "SOGo Vacation Datepicker Validation Permanent Fix" not in content:
new_content = auto_fix_script + "\n" + content
with open(filename, "w", encoding="utf-8") as f:
f.write(new_content)
print("Successfully patched Preferences.js")
else:
print("Patch already applied.")
'
docker cp ./Preferences.js ${SOGO_CONTAINER}:${PREF_JS_PATH}
echo "Restarting SOGo and Memcached containers to flush asset cache..."
cd /opt/mailcow-dockerized
docker compose restart memcached-mailcow sogo-mailcow
echo "=== Patch successfully applied! ==="
EOF
chmod +x /opt/mailcow-dockerized/sogo_fix.sh
/opt/mailcow-dockerized/sogo_fix.sh
How to verify
Run the script above.
Open SOGo in your browser and perform a Hard Refresh (Ctrl + F5 or Cmd + Shift + R).
Go to Preferences -> Mail. The sidebar will remain active and the Save button will function normally when changing options.
Hope this helps anyone experiencing the same locale-specific freeze!