Postfix "Not Allowed in State 1" / DNS Resolution Failure
Symptom
- SOGo webmail shows a red/orange full-screen error: "not allowed in state 1" when trying to send, receive, or otherwise interact with mail.
- Sending and receiving both fail.
docker compose psshowspostfix-mailcowwith an unusually low uptime compared to other containers (e.g. "Up 28 seconds" while everything else is "Up 10 days"), or shows it repeatedly restarting.
This SOGo error is generic — it just means the webmail frontend lost its connection to the backend. It does not point directly at the cause; you have to look at the container stack.
Diagnosis Steps
1. Check container health/uptime
Look for any container with a much shorter uptime than the rest, or one stuck in a restart loop.
2. Check the flaky container's logs
If you see repeated:
Waiting for DNS...
REDIS server error during connection; ... error='Temporary failure in name resolution'
— the container cannot resolve other containers' hostnames (e.g. redis-mailcow, unbound-mailcow) on the internal Docker network. This is a networking problem, not a mail config problem.
3. Check watchdog logs
Watchdog will report declining health levels for postfix / postfix-tlspol when the container can't be reached properly — this is a symptom of the same root cause, not a separate issue.
Root Cause Chain (what actually happened)
- A host-level Postfix (preinstalled by the VPS provider, e.g. Contabo) was bound to port 25, blocking the mailcow
postfix-mailcowcontainer from rebinding after a restart: - Next, the conflicting host Postfix was stopped and disabled. But the mailcow
postfix-mailcowcontainer still did not start correctly. This time, it was fully disconnected from the mailcow Docker network.docker inspectshowed this:"NetworkSettings.Networks": {}(empty). - Without a network, it could not reach
unbound-mailcow(the internal DNS resolver of mailcow, usually at a fixed IP like172.22.1.254). Thus, each internal hostname lookup (redis-mailcow, and others) failed, and postfix could not fully start.
Fix
Check for a conflicting host-level mail service:
If it shows a process other than the mailcow postfix container (e.g. master — Postfix's own daemon name) holding port 25:
Check whether the mailcow postfix container is actually attached to the network:
docker inspect mailcowdockerized-postfix-mailcow-1 --format '{{json .NetworkSettings.Networks}}' | python3 -m json.tool
{}(empty) = not attached to any network — this is the bug.- Compare against a known-good container, e.g.:
Manually reattach it (non-disruptive, worth trying first):
This can get things working temporarily, but in practice the cleanest and most reliable fix is a full stack cycle:
Full fix — recreate the whole stack:
This forces Docker to rebuild the mailcow network and reattach every container correctly, rather than trying to patch one container's network membership by hand.
Verification
- Uptime should climb steadily without resetting (check again after a few minutes).
- Ports
0.0.0.0:25,0.0.0.0:465,0.0.0.0:587should be listed and bound.
- Should show
starting the Postfix mail system/daemon startedwith no repeatedWaiting for DNS...lines afterward.
Then confirm actual mail flow: send a test email from SOGo to an external address (e.g. Gmail), and send one back in to confirm inbound delivery too — send and receive exercise different paths (submission vs. inbound SMTP) and can fail independently.
Notes / Lessons Learned
- The SOGo "not allowed in state 1" screen does not help you by itself. Always go directly to
docker compose psand the container logs. Do not troubleshoot from the SOGo side. - VPS providers (Contabo included) sometimes ship a host-level Postfix preinstalled for system mail (cron notices, etc.). This silently conflicts with mailcow's own postfix container on port 25 and won't show up unless you specifically check
ss -tulnp. - If a container shows an empty
NetworkSettings.Networksafter adocker network connector restart, you must remove and create the Docker network again (docker compose down && up -d). Do not repair one container at a time. - The server ran mailcow version 2026-03b at that time (four releases behind 2026-07). Read the changelog between versions, because updates often repair network-attachment bugs like this.