Next: Bulletins, Previous: Login delay, Up: pop3d
Automatic expiration of messages allows you to limit the period of time users are permitted to keep their messages on the server. It is enabled by --expire command line option:
$ pop3d --expire=days
Here, days specifies the minimum server retention period, in days, for retrieved messages on the server.
Current implementation works as follows. When a message is
downloaded by RETR or TOP command, it is marked with
‘X-Expire-Timestamp: n’ header, where n is current
value of UNIX timestamp. The exact expiration mechanism
depends on you. Mailutils allows you two options:
require "timestamp";
# Replace "5" with the desired expiration period
if timestamp :before "X-Expire-Timestamp" "now - 5 days"
{
discard;
}
This script will remove expired messages 5 days after the retrieval. Replace ‘5’ with the desired expiration period and make sure it equals the argument to --expire command.
The option --expire=0 means the client is not permitted to leave mail on the server. It always implies --delete-expired.