Gumdrop provides a complete POP3 server implementation following RFC 1939 with modern extensions. POP3 (Post Office Protocol version 3) provides simple, download-oriented mailbox access—clients retrieve messages and optionally delete them from the server. Like all Gumdrop protocol implementations, the POP3 server uses the event-driven, non-blocking architecture.
The POP3 server implements the base protocol as defined in RFC 1939 with extensions from RFC 2449 (POP3 Extension Mechanism) and RFC 5034 (SASL Authentication).
POP3 sessions progress through three states:
The CAPA command allows clients to discover server capabilities. The server responds with a list of supported extensions:
C: CAPA S: +OK Capability list follows S: USER S: STLS S: UIDL S: TOP S: SASL PLAIN LOGIN CRAM-MD5 SCRAM-SHA-256 S: UTF8 S: PIPELINING S: RESP-CODES S: AUTH-RESP-CODE S: EXPIRE NEVER S: LOGIN-DELAY 5 S: IMPLEMENTATION gumdrop S: .
Upgrades a cleartext connection to TLS. After successful STLS, the client should re-issue CAPA to discover post-TLS capabilities (authentication mechanisms may change).
C: STLS S: +OK Begin TLS negotiation (TLS handshake) C: CAPA ...
SASL authentication mechanism support. The server advertises available mechanisms in CAPA response. See Authentication for supported mechanisms.
Enables UTF-8 mode for international mailbox content. When enabled, message headers and bodies may contain UTF-8 encoded text.
C: UTF8 S: +OK UTF-8 mode enabled
When enabled, clients can send multiple commands without waiting for responses. This reduces round-trip latency for batch operations.
The server includes extended response codes in -ERR replies to help
clients provide meaningful error messages. Supported codes:
[AUTH] — authentication failures (wrong password, bad
credentials, unsupported mechanism)[SYS/TEMP] — temporary server errors (mailbox I/O,
timeouts, connection issues)[SYS/PERM] — permanent configuration errors (auth or
mailbox not configured)
Extends RESP-CODES with authentication-specific [AUTH] response
codes. All authentication failure -ERR replies include the
[AUTH] code, allowing clients to distinguish credential errors
from server-side failures.
Declares the message retention policy. Configured via
setExpireDays(int) on POP3Listener:
0 means messages may be expired immediately, a positive value is
the minimum retention in days, and Integer.MAX_VALUE advertises
EXPIRE NEVER. Set to -1 to suppress the capability.
Advertises the minimum delay between authentication attempts. When
loginDelayMs is greater than zero, the server advertises
LOGIN-DELAY <seconds> so clients can avoid premature retries.
Authentication uses Gumdrop's centralised Realm interface, shared
with IMAP, SMTP, and other servers. Multiple authentication methods are
supported.
The simplest method—client sends username and password in cleartext. Should only be used over TLS.
C: USER alice S: +OK User accepted C: PASS secret S: +OK Mailbox locked and ready
Challenge-response authentication using MD5. The server includes a unique timestamp in its greeting; the client responds with MD5(timestamp + password). The password is never transmitted.
S: +OK POP3 server ready <1896.697170952@example.com> C: APOP alice c4c9334bac560ecc979e58001b3e22fb S: +OK Mailbox locked and ready
The AUTH command supports multiple SASL mechanisms:
| Mechanism | RFC | Description |
|---|---|---|
| PLAIN | RFC 4616 | Simple username/password; requires TLS |
| LOGIN | - | Legacy base64 username/password; requires TLS |
| CRAM-MD5 | RFC 2195 | HMAC-MD5 challenge-response |
| DIGEST-MD5 | RFC 2831 | HTTP Digest-style authentication |
| SCRAM-SHA-256 | RFC 7677 | Salted challenge-response; recommended |
| OAUTHBEARER | RFC 7628 | OAuth 2.0 bearer tokens |
| GSSAPI | RFC 4752 | Kerberos/enterprise SSO |
| EXTERNAL | RFC 4422 | TLS client certificate |
SCRAM-SHA-256 is recommended as it provides mutual authentication and never transmits the password. The realm can store only derived keys without keeping plaintext passwords.
C: AUTH SCRAM-SHA-256 S: + (server first message, base64) C: (client first message, base64) S: + (server final message, base64) C: (client final message, base64) S: +OK Authentication successful
The POP3 server accesses mail storage through the Mailbox
API. A MailboxFactory provides MailboxStore
instances for authenticated users.
mailboxFactory.createStore()store.open(username)mailbox.expunge() to commit deletionsPOP3 requires exclusive access to the mailbox during a session. The server acquires a lock when entering TRANSACTION state and releases it in UPDATE state. Concurrent POP3 connections to the same mailbox are rejected.
The UIDL command returns unique identifiers for each message. These identifiers are persistent across sessions, allowing clients to track which messages have been downloaded.
org.bluezoo.gumdrop.pop3.POP3Listener (transport configuration):
port - listening port (default: 110, or 995 for secure)secure - enable implicit TLS (POP3S)keystore-file - keystore for TLS/STLSkeystore-pass - keystore password
org.bluezoo.gumdrop.pop3.DefaultPOP3Service (service logic):
realm - reference to a Realm for authenticationmailbox-factory - reference to a MailboxFactoryenable-apop - enable APOP authentication (default: true)enable-utf8 - enable UTF-8 support (default: true)enable-pipelining - enable command pipelining (default: false)login-delay - delay after failed authentication in milliseconds
(default: 0); helps mitigate brute-force attackstransaction-timeout - session timeout in milliseconds
(default: 600000 / 10 minutes); RFC 1939 recommends at least 10 minutesexpire-days - message retention policy advertised in CAPA:
0+ for days, Integer.MAX_VALUE for NEVER, -1 to suppress
(default: -1)
<!-- Authentication realm -->
<realm id="mailRealm" class="org.bluezoo.gumdrop.auth.BasicRealm">
<property name="href">mail-users.xml</property>
</realm>
<!-- Mbox storage -->
<mailbox-factory id="mbox"
class="org.bluezoo.gumdrop.mailbox.mbox.MboxMailboxFactory">
<property name="base-directory">/var/mail</property>
</mailbox-factory>
<!-- POP3 service (port 110 with STLS) -->
<service id="pop3" class="org.bluezoo.gumdrop.pop3.DefaultPOP3Service">
<property name="realm" ref="#mailRealm"/>
<property name="mailbox-factory" ref="#mbox"/>
<property name="enable-apop">true</property>
<property name="login-delay">3000</property>
<listener class="org.bluezoo.gumdrop.pop3.POP3Listener">
<property name="port">110</property>
<property name="keystore-file">keystore.p12</property>
<property name="keystore-pass">secret</property>
</listener>
</service>
<!-- POP3S service (port 995 with implicit TLS) -->
<service id="pop3s" class="org.bluezoo.gumdrop.pop3.DefaultPOP3Service">
<property name="realm" ref="#mailRealm"/>
<property name="mailbox-factory" ref="#mbox"/>
<listener class="org.bluezoo.gumdrop.pop3.POP3Listener">
<property name="port">995</property>
<property name="secure">true</property>
<property name="keystore-file">keystore.p12</property>
<property name="keystore-pass">secret</property>
</listener>
</service>
RFC 8314 recommends implicit TLS (port 995) over STLS for new deployments. STLS remains available for compatibility with older clients.
USER/PASS and AUTH PLAIN transmit credentials in cleartext and should only be used over TLS. The server can be configured to reject these mechanisms without TLS.
The loginDelay setting introduces a delay after failed
authentication attempts:
The transactionTimeout setting closes idle connections:
Exclusive mailbox access prevents data corruption from concurrent modifications. If a mailbox is already locked by another session, authentication fails with an appropriate error.
← Back to Main Page | IMAP Server | SMTP Server & Client | DNS Server | Telemetry
Gumdrop POP3 Server