SOGo
SOGo on a qmail + vpopmail + Dovecot server
How SOGo was installed alongside an existing qmail mail server, and the traps found along the way. This page uses qmail.server.example for the host and example.com for a mail domain. Overview
SOGo adds webmail, calendar and contacts (CalDAV/CardDAV) and Exchange ActiveSync to an existing qmail + vpopmail + Dovecot server. ActiveSync is what gives an iPhone real push for mail, calendar and contacts, which plain IMAP cannot.
SOGo sits on top of the mail stack and changes none of it: qmail still delivers, vpopmail still owns the accounts, Dovecot still stores the mail.
How the pieces talk (same host, loopback only):
Browser or phone → Apache on 443 → sogod on 127.0.0.1:20000 sogod → Dovecot IMAP 127.0.0.1:143 for mail, qmail SMTP 127.0.0.1:25 to send, managesieve 127.0.0.1:4190 for filters sogod → MySQL database sogo for its own data (profiles, calendars, contacts, sessions), and a view over vpopmail.vpopmail for logins sogod → memcached 127.0.0.1:11211 for its session cache
URLs on https://qmail.server.example: Path What /SOGo/ Webmail, calendar, contacts /Microsoft-Server-ActiveSync Phones (Exchange account) /SOGo/dav CalDAV/CardDAV, also via /.well-known/caldav and /.well-known/carddav /webmail Roundcube, kept alongside Prerequisites
Rocky Linux / RHEL 9. SOGo publishes no EL10 packages, so an EL10 server cannot run it. EL9 is supported until 2032. A working qmail + vpopmail (MySQL backend) + Dovecot, with IMAP on 127.0.0.1:143 and, for filters, dovecot-pigeonhole with managesieve on 127.0.0.1:4190. MySQL 8 on the same host (vpopmail's database is reused for logins). Apache httpd with mod_proxy, mod_proxy_http, mod_headers and a valid TLS certificate for qmail.server.example. RAM. Each sogod worker is about 40 MB, and every phone using push holds one worker for as long as it is connected. Budget roughly 40 MB per device on top of the base install; 20 phones is about 800 MB. Check headroom first, especially if mysqld has ever been OOM-killed on the host.
Repositories
SOGo's stable EL9 repository is paywalled: packages.sogo.nu/release/... returns HTTP 401 without an Alinto support contract. The nightly repository is open, and is what this setup runs:
- /etc/yum.repos.d/sogo-nightly.repo
[sogo-nightly] name=SOGo nightly (EL9) baseurl=https://packages.sogo.nu/nightly/5/rhel/9/$basearch/ enabled=1 gpgcheck=0
Enable CRB as well. RHEL 9 dropped libmemcached; its replacement, libmemcached-awesome, lives in CRB, which is off by default:
dnf config-manager --set-enabled crb
Installation 1. Packages
Dry-run first and read the transaction. On a mail server the install must add packages only: zero upgrades or replacements of anything in the qmail, Dovecot, vpopmail or PHP stack. A clean install is about 25 new packages.
dnf install --assumeno sogo sogo-activesync sope49-gdl1-mysql memcached dnf install sogo sogo-activesync sope49-gdl1-mysql memcached systemctl enable --now memcached
sope49-gdl1-mysql is not optional, and sogo does not pull it in. Without it every SOGo child dies at startup with EOAdaptor: cannot find adaptor bundle: 'MySQL', while systemctl is-active sogod still says active. Only the log shows it.
libwbxml (needed by ActiveSync) arrives as an el8 RPM inside the el9 repository. That is expected and works. 2. Database and login view
SOGo cannot authenticate against IMAP alone; it needs SQL or LDAP. vpopmail's vpopmail.vpopmail table has everything it needs, but it also holds every password in cleartext in pw_clear_passwd. So the sogo account gets a view that leaves that column out, and no access at all to the base table.
CREATE DATABASE sogo CHARACTER SET utf8mb4; CREATE USER 'sogo'@'localhost' IDENTIFIED BY '<generated password>'; GRANT ALL PRIVILEGES ON sogo.* TO 'sogo'@'localhost';
CREATE SQL SECURITY DEFINER VIEW sogo.sogo_users AS SELECT CONCAT(pw_name,'@',pw_domain) AS c_uid,
CONCAT(pw_name,'@',pw_domain) AS c_name,
pw_passwd AS c_password,
COALESCE(NULLIF(pw_gecos,), pw_name) AS c_cn,
CONCAT(pw_name,'@',pw_domain) AS mail
FROM vpopmail.vpopmail WHERE pw_name NOT LIKE '%@%' AND pw_passwd <> ;
Check the isolation: logged in as sogo, SELECT * FROM vpopmail.vpopmail must be denied, while SELECT * FROM sogo.sogo_users works. SOGo creates its own tables in sogo on first start.
Keep the database password in /etc/sogo/.dbpw (mode 0600). It also ends up in the connection URLs in sogo.conf, so that file must stay 640 root:sogo. Never paste either into a ticket or chat. 3. /etc/sogo/sogo.conf
The working configuration, with the password replaced by <db password>:
{
SOGoProfileURL = "mysql://sogo:<db password>@127.0.0.1:3306/sogo/sogo_user_profile";
OCSFolderInfoURL = "mysql://sogo:<db password>@127.0.0.1:3306/sogo/sogo_folder_info";
OCSSessionsFolderURL = "mysql://sogo:<db password>@127.0.0.1:3306/sogo/sogo_sessions_folder";
OCSEMailAlarmsFolderURL = "mysql://sogo:<db password>@127.0.0.1:3306/sogo/sogo_alarms_folder";
SOGoUserSources = (
{
type = sql;
id = vpopmail;
viewURL = "mysql://sogo:<db password>@127.0.0.1:3306/sogo/sogo_users";
canAuthenticate = YES;
isAddressBook = NO;
userPasswordAlgorithm = md5-crypt;
}
);
SOGoIMAPServer = "imap://127.0.0.1:143/?tls=NO";
SOGoSMTPServer = "smtp://127.0.0.1:25";
SOGoMailingMechanism = smtp;
SOGoMailDomain = "example.com";
SOGoForceExternalLoginWithEmail = YES;
SOGoLanguage = English;
SOGoTimeZone = "America/Denver";
SOGoFirstDayOfWeek = 1;
SOGoMemcachedHost = "127.0.0.1";
SOGoMaximumPingInterval = 350;
SOGoMaximumSyncInterval = 350;
SOGoInternalSyncInterval = 30;
SOGoMaximumSyncWindowSize = 100;
SOGoSieveScriptsEnabled = YES;
SOGoSieveServer = "sieve://127.0.0.1:4190";
SOGoVacationEnabled = YES;
SOGoForwardEnabled = YES;
SOGoPageTitle = "qmail.server.example";
WOPidFile = "/var/run/sogo/sogo.pid";
SOGoLogFile = "/var/log/sogo/sogo.log";
}
Why some of these matter:
isAddressBook = NO keeps every account out of the shared address book. With many unrelated customers on one server, YES would let all of them look each other up. SOGoForceExternalLoginWithEmail = YES makes everyone log in with the full address; SOGoMailDomain is only the default for a bare name. IMAP and SMTP without TLS is deliberate: sogod opens those connections itself, over loopback. SOGoTimeZone is copied into each user's profile the first time they save settings. Changing it later moves nobody who has already logged in. Optional: SOGoMailAuxiliaryUserAccountsEnabled = YES lets one login carry several mailboxes (Preferences → Mail → IMAP Accounts). Point the extra accounts at 127.0.0.1:143, no encryption, same as SOGoIMAPServer. Optional: SOGoLanguage = Italian; plus SOGoSupportedLanguages = (Italian, English);. The login page still follows the browser's Accept-Language first.
4. Workers
/etc/sysconfig/sogo ships PREFORK commented out (# PREFORK=3), so a sed 's/^PREFORK=.../' silently changes nothing. Add an explicit line and check it took:
echo 'PREFORK=10' >> /etc/sysconfig/sogo grep '^PREFORK' /etc/sysconfig/sogo systemctl enable --now sogod
Size PREFORK to the number of push devices plus a few for webmail. Authentication and passwords
vpopmail stores passwords as MD5-crypt ($1$..., 34 characters) in pw_passwd, and Dovecot's SQL passdb checks the same column (default_pass_scheme = MD5-CRYPT). SOGo reads that column through the view, so a mailbox password is the SOGo password.
userPasswordAlgorithm must be md5-crypt, never crypt. crypt means classic DES: a 13-character hash that ignores everything after the 8th character. With crypt and password change enabled, the first password a user changed in SOGo was written as a DES hash Dovecot could not verify, and that user was locked out of IMAP and webmail alike. Changing a password: use Roundcube, not SOGo
If you enable password change in SOGo (SOGoPasswordChangeEnabled = YES): the new password works for login everywhere (SOGo, IMAP, POP3, SMTP AUTH, ActiveSync), but it is not written to vpopmail's cleartext copy. vuserinfo will keep showing the old password, which no longer works. Don't trust vuserinfo for any account that changed its password in SOGo.
vpopmail keeps a second copy of each password in pw_clear_passwd, which is what vuserinfo prints. SOGo has a single password field and writes only pw_passwd. After a SOGo-side change, logins work (Dovecot reads pw_passwd), but vuserinfo keeps showing the old password until someone runs vpasswd.
Roundcube's password plugin with the vpopmaild driver goes through vpopmail's own API and updates both columns. So the recommendation is:
Leave SOGoPasswordChangeEnabled off, and grant the sogo MySQL account SELECT only on the view. Let users change passwords in Roundcube at /webmail.
If you do enable it in SOGo, the sogo account needs UPDATE through the view, and you accept the stale vuserinfo. Traps around password resets
Dovecot caches failures for an hour (auth_cache_negative_ttl = 1 hours). After fixing a password, a user who failed recently keeps failing. Run doveadm auth cache flush. doveadm auth test bypasses the cache, so it can pass while real logins still fail. fail2ban. Phones keep retrying the old password. Three failures in an hour bans that IP, for everything from that address. Update the user's devices right after a reset. vadduser / vpasswd refuse passwords longer than 16 characters (pw_clear_passwd is char(16)). Under MySQL strict mode the update is rejected and the old password stays, sometimes with output that looks like success. Confirm the hash changed rather than trusting the command.
Apache
The package installs /etc/httpd/conf.d/SOGo.conf. Keep the stock file and change one line: give the ActiveSync proxy a long timeout.
ProxyPass /Microsoft-Server-ActiveSync \
http://127.0.0.1:20000/SOGo/Microsoft-Server-ActiveSync \ retry=60 connectiontimeout=5 timeout=360
ProxyPass /SOGo http://127.0.0.1:20000/SOGo retry=0 nocanon
Set the timeout on the ProxyPass worker, not with a global Timeout: SOGo.conf is loaded server-wide, so a global value would lengthen the timeout of every other site on the host.
The stock file also sets the x-webobjects-* headers SOGo uses to build its URLs, and the /.well-known/caldav and /.well-known/carddav redirects to /SOGo/dav. Leave those as shipped. Friendlier URLs
SOGo bakes /SOGo into every URL it generates, so it cannot be served under another path. A redirect is all you can do, in the site's own vhost:
RedirectMatch 302 ^/$ /SOGo/ RedirectMatch 302 ^/email/?$ /SOGo/
The root redirect is anchored (^/$) so /.well-known/acme-challenge keeps working for certificate renewal. TLS and firewall
SOGo uses the same certificate as the rest of the host on 443. For phones on cellular data, 443 must be reachable from anywhere, not only from whitelisted addresses.
Do not put ActiveSync behind a proxy with a short request limit, such as a Cloudflare proxied record or Tunnel. Cloudflare cuts proxied requests at about 100 seconds, below the 350-second ping, and push silently degrades to polling. Sieve filters
With the Sieve settings above, users get Filters, Vacation and Forward in SOGo's preferences. Requirements: dovecot-pigeonhole, managesieve on 127.0.0.1:4190, and delivery through dovecot-lda. A domain delivered by vdelivermail gets no Sieve at all, so its users see a Filters pane that does nothing.
SOGo overwrites ~/.dovecot.sieve. It generates the script from rules stored in its own database and never imports an existing script. The first filter a user saves in SOGo wipes any hand-written or Roundcube script. Before enabling, back up every user's script:
find /home/vpopmail/domains \( -name .dovecot.sieve -o -name sieve \) -print0 \
| tar --null -czf /root/sieve-backup-$(date +%Y%m%d).tgz -T -
(Adjust the path to where your vpopmail domains live.)
One owner per server. If Roundcube's managesieve plugin stays enabled and a user edits filters there, Roundcube takes the script back and SOGo's goes inactive. Pick one and disable filters in the other. Moving Roundcube filters into SOGo
SOGo stores filters as JSON in sogo_user_profile.c_defaults, key SOGoSieveFilters, so a migration is a database write. One rule looks like:
{"name": "Newsletters", "active": 1, "match": "all",
"rules": [{"field": "header", "custom_header": "from",
"operator": "contains", "value": "newsletter"}],
"actions": [{"method": "fileinto", "argument": "Junk"}]}
Use field: "header" with custom_header: "from", not field: "from". SOGo's from compiles to address :contains, which matches only the address. Roundcube writes header :contains, which also sees the display name. Rules matching words like a company name silently stop working with the wrong form. Roundcube disables a rule as if false # allof (...), keeping the test in a comment. That maps to "active": 0. A converter that ignores it drops disabled rules. fileinto takes the plain folder name (Junk, Trash, INBOX). Importing activates nothing. SOGo writes the Sieve script only when the user saves in its UI, so each user clicks Let SOGo handle everything once. Until then the old script stays live, and deleting the key undoes the import.
ActiveSync and iPhone push
Push works by the phone holding one request open for up to SOGoMaximumPingInterval seconds, waiting to be told something changed. The whole chain must allow it:
SOGoMaximumPingInterval = 350 < ProxyPass ... timeout=360
If any hop (Apache, a load balancer, a CDN) cuts the request first, the phone silently falls back to polling, with no error anywhere.
iPhone setup: Settings → Mail → Accounts → Add Account → Microsoft Exchange, enter the address, then choose Configure Manually. Tapping "Sign In" sends iOS to Microsoft's autodiscover and fails.
Server: qmail.server.example Username: full address, e.g. user@example.com Domain: blank
The endpoint must answer 401 with a WWW-Authenticate header; a 403 stops setup dead.
/Microsoft-Server-ActiveSync is hardcoded in iOS and Android and cannot be moved. "Push works but the phone never notifies"
Check these before suspecting the server:
An Apple Watch. With the Watch on the wrist and the phone locked, iOS sends alerts to the Watch, not the phone. iOS notifies only for INBOX. A Sieve rule filing the test sender into another folder means no alert, ever. Already-read messages don't alert. A desktop client or Roundcube open on the mailbox can mark mail \Seen first.
Dark theme (optional)
SOGo 5 ships no dark mode. A theme can be added without touching the package, and survives upgrades:
Put the CSS somewhere no RPM owns, e.g. /usr/local/share/sogo-theme/. Not under /etc/sogo, which Apache cannot read (that gives a 403). Alias it in /etc/httpd/conf.d/00-sogo-theme.conf. The 00- prefix matters: mod_alias uses the first matching Alias, and SOGo.conf aliases the whole WebServerResources directory. Revert = delete that file and reload httpd.
Things that bite:
Cache-buster. The page requests theme-default.css?lm=<mtime of the packaged file>. Replacing the file behind an Alias doesn't change that mtime, so browsers keep the old theme and it looks like nothing happened. After each change: touch /usr/lib64/GNUstep/SOGo/WebServerResources/css/theme-default.css and restart sogod. SOGo injects its green palette at runtime as inline <style> rules that win over the stylesheet. Prefix selectors with html to beat them. Generated dark themes leave input text transparent, including on the login page. Override color and -webkit-text-fill-color with !important. HTML mail renders inline, not in an iframe, so the reading pane's colour leaks into messages. Stop the inheritance at the message container and let each message look as its sender built it.
Troubleshooting Symptom Cause sogod "active" but every page fails; log shows EOAdaptor: cannot find adaptor bundle: 'MySQL' sope49-gdl1-mysql missing dnf cannot find libmemcached CRB not enabled User locked out after changing password in SOGo userPasswordAlgorithm = crypt; must be md5-crypt. Reset with vpasswd vuserinfo shows a password that doesn't work Password was changed in SOGo, which writes only pw_passwd Fixed password still fails for up to an hour Dovecot negative auth cache: doveadm auth cache flush Phone syncs but no push A proxy timeout below 350 s somewhere in the chain PREFORK change had no effect The stock line is commented out; add a real one Theme change "did nothing" Cache-buster: touch the packaged theme-default.css, restart sogod Users' old Sieve filters vanished SOGo overwrote .dovecot.sieve; restore from the backup
Restarting sogod while someone uses webmail gives them a few seconds of Apache "Proxy Error ... Error reading from remote server". Harmless; warn first.
Benign log lines, not faults:
WOWatchDogChild ... has been hanging in the same request for N minutes: a phone's held-open ping. One per pushing device per minute. NGImap4ResponseParser ... got no body content: a message with an empty body part.
Verification checklist
dnf history info last shows only new packages, no upgrades
systemctl is-active sogod memcached → both active, and /var/log/sogo/sogo.log has no EOAdaptor errors
grep ^PREFORK /etc/sysconfig/sogo shows your value; pgrep -c sogod matches it (plus the watchdog)
As MySQL user sogo: vpopmail.vpopmail denied, sogo.sogo_users readable
Web login at https://qmail.server.example/SOGo/ with a full address
Send and receive a test message from SOGo
curl -sI https://qmail.server.example/Microsoft-Server-ActiveSync → 401 with WWW-Authenticate
iPhone Exchange account added; a new message alerts within seconds
A Sieve filter saved in SOGo appears in the user's .dovecot.sieve
Where things live What Where SOGo config /etc/sogo/sogo.conf (640 root:sogo) DB password /etc/sogo/.dbpw (0600) Worker count /etc/sysconfig/sogo Apache proxy /etc/httpd/conf.d/SOGo.conf Theme alias (optional) /etc/httpd/conf.d/00-sogo-theme.conf Theme CSS (optional) /usr/local/share/sogo-theme/ Log /var/log/sogo/sogo.log Static files /usr/lib64/GNUstep/SOGo/WebServerResources/ Repo file /etc/yum.repos.d/sogo-nightly.repo
> On Nov 4, 2026, at 15:21, Eric Broch <ebroch@whitehorsetc.com> wrote:
>
> Hi Remo,
>
> Can you do a write up on your implementation of SOGo? I'd put it on the Wiki.
>
> Eric
> On 10/26/2026 12:08 AM, Remo Mattei wrote:
>>
>> Hello
>>
>> I just moved my webmail from SquirrelMail to SOGo across our toasters, and built a dark theme for it along the way. Both may be useful to others here.
>>
>> Why SOGo rather than staying on SquirrelMail or Roundcube
>>
>> SquirrelMail’s last release was 2013. Beyond the security position, it couldn’t do what users kept asking for: calendars and contacts that sync, and push mail to a phone.
>>
>> SOGo gives you CalDAV, CardDAV and — the one that matters most in practice — ActiveSync, so iPhones and Androids get push mail, calendar and contacts with no third-party connector. It’s the current answer to the Z-Push wiki page, which is long out of date.
>>
>>
>> I kept Roundcube alongside it. They share the same mailbox, so users can pick.
>>
>> Notes from the install, for anyone following:
>>
>> libmemcached on EL9 is in CRB as libmemcached-awesome
>> sope49-gdl1-mysql is not pulled in automatically. Without it the sogod children die with EOAdaptor: cannot find adaptor bundle: 'MySQL' while systemd still reports the service active
>> ActiveSync Ping must be shorter than the proxy timeout, or the phone’s long poll is cut by Apache rather than by SOGo
>> Sieve filters, vacation and password change are all off by default — four lines in sogo.conf each, and nothing tells you they’re missing
>>
>> The theme
>>
>> SOGo ships no dark mode. Verified against 5.12.12: no prefers-color-scheme rules, no md-*-theme-dark classes, no config key.
>>
>> https://github.com/itlinux/sogo-theme
>>
>> It installs in front of the packaged files through Apache aliases, so a package upgrade can’t undo it and deleting one config file reverts it — nothing inside the RPM tree is touched. The README documents the parts that cost me time: the alias ordering that decides whether your config is consulted at all, the cache-buster that makes a change look like it did nothing, SOGo’s runtime palette injection (which is why the login page stays green while everything else has gone dark), and how to rebuild the stylesheet without SOGo’s source tree or npm. I selected the colors of my terminal I like so much!
>>
>> MIT, and the palette is a one-file change if grey and orange isn’t to your taste.
>>
>> Remo