Contact Blocking¶
Block specific sender addresses from delivering messages to a mailbox. Blocked senders receive status 61 (Unauthorized Sender) and their messages are not stored.
How It Works¶
Each mailbox can have a .blocked file containing one sender address per line. When a message arrives, the server checks both the client certificate identity and the gemmail metadata senders against the block list. If any sender address matches, the message is rejected before storage.
Block a Sender via CLI¶
This creates or appends to the .blocked file in the current user's mailbox directory (mailbox name derived from $USER).
To specify a non-default mailbox directory:
Unblock a Sender¶
If the address was the only entry, the .blocked file is removed entirely.
View Blocked Addresses¶
The .blocked file is a plain text file you can inspect directly:
Matching Rules¶
- Addresses are compared case-insensitively — blocking
Spam@Evil.comalso blocksspam@evil.com - Both the TLS client certificate identity and all senders listed in the gemmail metadata are checked
- Empty lines and whitespace are ignored
- If the
.blockedfile is missing or empty, all senders are allowed
Manual Editing¶
You can edit the .blocked file directly. One address per line, mailbox@hostname format:
Changes take effect on the next incoming message — no server restart needed.
Server Behavior¶
When a blocked sender attempts delivery:
- The server parses the sender identity from the client certificate and gemmail metadata
- Each sender address is checked against the recipient's
.blockedfile - On match, the server returns status 61 with meta
"Sender blocked"and logs asender_blockedevent - The message is never stored
Note
Blocking happens before message storage and encryption. Blocked messages consume no disk space.