Back to the main page

cmail-popd

Provide mailbox access via POP3

The Post Office Protocol Version 3 (POP3) allows users to access their mailboxes from remote computers. POP3 does itself only provide basic message download options, message status handling must be done client-side and can usually not be synchronized between multiple clients.

Building & Prerequisites

The following packages are required for building this module (Debian packages are listed) A build of only this specific module can be initiated by running make in cmail-popd/

Setup information

This module needs read and write access to the master database AS WELL AS the folder containing it. Recommended practice is creating a dedicated user and specifying that in the configuration in order to have the module drop its privileges after binding the ports.

Run the module without specifying a logfile in the configuration at first, in order to test its operation and track down any misconfigurations. Specifying a logfile allows the module to daemonize itself and detach from the starting shell.

Configuration

The configuration file contains multiple lines, each specifying one of the following configuration directives. Lines are read from this file consecutively. Most directives become active the moment they are read. An example configuration file with sane defaults (save for the banner announce) can be found in the example-configs/ folder in the main repo.
Directive Parameters
Comments Verbatim
Description
verbosity Integer between 0 and 4 Set log output verbosity. Higher values include messages for lower values.
  • 0 - Errors & Warnings only (Default)
  • 1 - Informational messages
  • 2 - Currently not specified
  • 3 - Debug messages
  • 4 - All input and output
logfile Path to log file If not specified, cmail-popd will log to stderr and will not be able to detach from the calling shell
pidfile Path to pid file Write the PID of the daemonized process to the specified file. If not specified, no file is created. PID files are used by daemon supervisors such as systemd for stopping services.
user Username to switch to The module will change its executing user to the one specified. Only works when started as root. This is one of the few options not immediately taking effect.
group Group name to switch to The module will change its executing group to the on specified. Only works when started as root. This is one of the few options not immediately taking effect.
database Path to master database The executing user needs read AND write access to the master database file as well as the folder containing it
bind Address to bind to :: and * bind all interfaces for IPv6 and IPv4 respectively
Port to listen on The widely-known ports for POP are
  • 110 - POP3
  • 995 - POP3S (tls-only)
Privileged ports (Numbers smaller than 1024) usually need root privileges to bind to
(optional)
announce= Server name to announce to clients in the banner
The announced name should preferrably have a valid DNS record pointing to the machine
(optional, not available when compiled with CMAIL_NO_TLS)
cert= TLS certificate file location
Specifying both cert and key automatically enables opportunistic encryption via STARTTLS
(optional, not available when compiled with CMAIL_NO_TLS)
key= TLS key file location
Specifying both cert and key automatically enables opportunistic encryption via STARTTLS
(optional, not available when compiled with CMAIL_NO_TLS)
ciphers= GnuTLS cipher priority listing
This parameter can be used to disable or force specific ciphers or protocol versions
(optional, not available when compiled with CMAIL_NO_TLS)
dhparams= Diffie-Hellman parameter file location
Use this parameter to read the Diffie-Hellman parameters from a file instead of generating new parameters upon starting (which is time consuming). The file is expected to be in PEM format.
(optional, not available when compiled with CMAIL_NO_TLS)
tlsonly
Connections on this port are expected to immediately negotiate a TLS session, never exchanging plain text data
(optional, not available when compiled with CMAIL_NO_TLS)
tlsrequire
Clients will be denied authentication unless communication is secured by TLS

Database configuration

Access to the POP3 daemon can be configured on a per-user basis using cmail-admin-popd

Debugging

Resources & Further reading