Kopano Dagent Cannot Reach Storage? Check the Server Socket

When Kopano dagent reports “Failed to Connect to Storage Server,” first verify that kopano-server is running and that dagent’s server_socket points to the server’s actual endpoint. On a single-host installation, a stopped server, mismatched Unix socket path, or missing socket access is more relevant to this message than changing Postfix routing or mailbox data.

The commands below target conventional Linux deployments using Kopano Core and systemd. Service names, package paths, process identities, and connection methods can differ; check the settings on your host before changing them. The Kopano dagent manual describes a storage-server outage as a temporary delivery failure, with exit code 75 (or 111 in qmail-style mode), rather than proof that a message is permanently lost.

1. Check whether the Kopano storage server is running

Run these checks on the host providing mailbox storage, not automatically on the Postfix host if those roles are separated:

sudo systemctl status kopano-server
sudo journalctl -u kopano-server -n 50 --no-pager

If the service is inactive or repeatedly restarting, use the journal to identify why it failed. The server needs a working database connection to start normally; its configuration includes mysql_host, mysql_socket, and mysql_database. On systems using MariaDB, you can also inspect systemctl status mariadb. Check storage capacity and the database service if the logs point to those dependencies, but do not alter database tables or attachment directories merely because dagent cannot connect.

After fixing the underlying service failure, start or restart kopano-server using your distribution’s normal service manager, then check its status again. A server reported as “active” is a useful first sign, not yet proof that dagent can reach it.

Linux terminal showing systemctl status kopano-server and journalctl commands prepared for diagnosis.
Check the server service and its journal before modifying mail routing or mailbox files.

2. Compare dagent’s storage endpoint with the server configuration

On the machine running kopano-dagent, inspect its configured connection:

sudo grep -nE '^[[:space:]]*server_socket[[:space:]]*=' /etc/kopano/dagent.cfg

For a conventional local installation, the documented value is:

server_socket = file:///var/run/kopano/server.sock

Next inspect the server side, including the socket pathname and whether Unix pipe connections are enabled:

sudo grep -nE '^[[:space:]]*(server_pipe_name|server_pipe_enabled|server_listen)[[:space:]]*=' /etc/kopano/server.cfg

In the Kopano server configuration reference, server_pipe_name identifies the Unix socket, with /var/run/kopano/server.sock as the documented default, while server_pipe_enabled controls Unix pipe connections. A commented-out setting may mean a default is in effect; configuration files can also include other files. Match dagent to the endpoint the server is actually configured to provide, rather than copying a sample path without checking.

Do not confuse server_socket with lmtp_listen: the first connects dagent to Kopano storage; the second controls where dagent accepts mail from the mail transport agent. Changing an LMTP port or Postfix transport will not repair a broken local storage socket. The dagent configuration manual documents both options separately.

Text editor showing the server_socket parameter in Kopano dagent.cfg pointing to a local Unix socket.
Compare the dagent server_socket setting with the Unix socket name configured on the storage server.

3. Confirm that the Unix socket exists and is reachable

If the selected endpoint begins with file:///, use its filesystem portion for these checks. For the documented example:

sudo test -S /var/run/kopano/server.sock && echo 'Socket exists'
sudo ls -l /var/run/kopano/server.sock
sudo ss -xl | grep -F 'kopano/server.sock'
namei -l /var/run/kopano/server.sock

If test -S fails, verify that the server has started and that its configured socket path matches the one you tested. On many Linux systems, /var/run resolves to /run; that difference alone need not be an error. If the socket exists but dagent logs “Permission denied,” inspect the service account and execute/search permissions on each parent directory. A socket listing does not establish that every process is authorized to connect.

Correct ownership or access rules based on your package’s intended service identity. Avoid chmod 777, weakening the entire runtime directory, or adding broad privileged users as a shortcut. Kopano’s allow_local_users setting grants significant authority to listed local users, so it should not be expanded without reviewing the security implications.

Linux terminal displaying ls -l for the Kopano server socket and the ss -xl command.
Inspect the local socket path and listening Unix sockets before making permission changes.

4. For a remote storage server, check transport and certificates

Skip the local socket test when dagent connects to another host using HTTP or HTTPS. In a multi-server deployment, the endpoint must name a reachable listener on the correct storage node. For example, Kopano’s multi-server documentation shows an HTTPS endpoint such as https://127.0.0.1:237/kopano for its local certificate test; this is an example, not a universal production URL.

Check the hostname, port, firewall path, and the remote server’s server_listen or server_listen_tls setting. An optional TCP reachability check is nc -vz server.example.com 237, if netcat is installed. A successful TCP connection does not establish a valid Kopano login. For HTTPS, verify that sslkey_file, sslkey_pass, the certificate chain, and server-side trust configuration match the deployment; do not disable certificate validation simply to suppress an error.

The Kopano Core Administrator Manual, section 6 covers multi-server client certificates and a sample dagent delivery test. Use that procedure only when your deployment genuinely uses remote TLS connections.

5. Apply the focused fix and verify mail delivery

Back up any configuration file before editing it. If you corrected dagent.cfg and dagent runs persistently in LMTP mode, restart that component so it loads the new value:

sudo systemctl restart kopano-dagent
sudo journalctl -u kopano-dagent -n 50 --no-pager

On installations that invoke dagent per message instead of maintaining an LMTP service, the next invocation may pick up the configuration without a daemon restart. Also inspect dagent’s configured log_method and log_file, because logs may go to a file or syslog instead of the systemd journal. A service journal with no entries does not necessarily mean nothing happened.

For a controlled check, send one new message to a test mailbox through the normal mail route. Alternatively, if you understand the effects of direct delivery, the official dagent manual supports reading an RFC 5322 message from standard input:

printf 'From: sender@example.net\nTo: test@example.com\nSubject: Kopano connection check\n\nTest delivery.\n' | sudo kopano-dagent -v -c /etc/kopano/dagent.cfg test@example.com

Replace the example recipient with a real test account. Run the direct test under an identity that reflects your configured delivery model; success as root can conceal permissions that still affect the running service. Do not inject the same queued message manually and through Postfix, since that can cause duplicate delivery.

Linux terminal showing commands to inspect Kopano dagent journal entries and the Postfix mail queue.
After the configuration change, review dagent logs and the Postfix queue for continuing connection failures.

Verify that the fix worked

Confirm that the new test message appears once in the target mailbox, then check dagent’s configured logs for fresh storage-connection errors. If you use Postfix, inspect deferred items with postqueue -p and allow normal retry handling once the server is healthy. The queue should stop accumulating new failures attributable to the storage connection.

If connection errors persist, record the precise error, the active server_socket value, whether it is a Unix or remote endpoint, and relevant kopano-server logs. “Connection refused,” “No such file,” “Permission denied,” and a TLS authentication failure require different remedies. The steps above reflect documented Kopano Core 8-era settings, including Debian manual-page sources last updated in December 2020; validate option names and service behavior against the version installed on your system.

Leave a Comment

How to