popserv - POP3 server |
popserv [ -i ] [ -C file ] [ -b [address][:port] ] [ -V ] [ -h ] |
popserv is a POP3 server that accpet foreign connection, do the AUTHORIZATION stats (USER, PASS, or APOP commands) and launch another program for TRANSACTION and UPDATE states. The APOP command is avaiable only when compiled with this option. It needs the passwords to be not crypted. |
The server is able to be run in standalone mode (binding itself on a IP and a port) or within inetd, in wait mode. |
-i |
run in inetd(8) wait mode. |
-C file |
use file as configuration file instead of default. |
-b [address][:port] |
bind to specified address/port (override bindto configuration file directive. |
-h |
give syntax then exits. |
-V |
give compile options then exits. |
The configuration file contains a list of directive, one by line. lines with only blanks and lines begining by "#" are discarded. Default configuration file is usr/local/etc/popserv.conf |
bindto [address][:port] |
If the server run in standalone mode, the IP and the port from where the server will accept connections. Default is to bind on all IP of the host on port pop3(110). |
hostname host |
set the host name for the APOP challenge. Default is local host name. |
uid number |
gid number |
run under a specified Unix user or group ID. |
crypt [0|1] |
Tell the passwords are crypted (default 1). |
apop [0|1] |
Enable APOP (default 0). |
accepts number |
Accepts the incoming connection by pack of accepts. Default is 1. |
timelimit seconds |
set the timeout between commands send in a connection. If the time is greater than the limit, the connection is silently closed. Default is no limit. |
autoclose seconds |
close the accept socket after this time. |
sameaddrmax number |
set the maximum of simultaneous connection from one IP address. Default is no limit. |
popit program |
the path of the program to be executed when the authorization state succeed. This program should be in charge of transaction and update states. Default is /usr/local/libexec/popit |
popitargs args |
a space separated list of arguments for the popit program. The first argument should be the popit program itself (this is the default) |
folder regexp |
a extended regular expression to determine the folder from the user name name. The folder is the first matching parenthesis. This works only if folders are in Maildir++ format. Example: |
folder +([^%@/]*)the folder is the strings after the first "+" character in the user name. When this directive is not set, folders are not used. |
useropt regexp |
a extended regular expression to determine arguments sent to popit as argument. If username match, popit argument list will finish by '--' and the first matching parenthesis. Example : |
useropt /([^%@+]*)the argument will be the characters following a '/'. When this directive is not set, no additional argument is added to popit. |
whoson.allow expression |
whoson.deny expression |
List of rules to check if an mailbox name should be send to whoson server. Each rule is a extended case insensitive regular expression. This lines may appear multiple times, they are checked in the order they are found in the configuration file. Default is deny. |
loginfo.host hostname |
loginfo.user username |
loginfo.password password |
loginfo.database database |
loginfo.query MySQL query |
Sets the host, username, password, database where MySQL connection loging is done. loginfo.query is a SQL query done when a succefull authorization occurs. If this is empty, no MySQL logging is done. |
logudp.dst address:port |
logudp.secret word |
logudp.multicast.ttl number |
If logudp.dst option is set, a UDP packet will be send to this destination on each successfull authentication. The packet has the following format (the order of the lines may change) : |
md5 [space] digest [space] challenge time [space] seconds-since-1970 service [space] pop user [space] username ip [space] ip-address source [space] pop-server-name .(notice the packet is finished by a line containing a dot). The md5 line is send only if logudp.secret is set. The digest is then the MD5 sum of the concatenation of the challegenge and the secret. It the destination address is a multicast IP address, one can set the IP TTL with logudp.multicast.ttl option. |
home.tag [tag] |
If compiled with libhome, use the argument as libhome tag configuration. |
Before serveur launch transation child, it goes into the user's Maildir (or in a folder) and it pass the following environment variables : |
SHELL |
user's shell. |
HOME |
user's home directory. |
USER |
user name. |
EXTENSION |
extension as guessed by folder directive. |
LOGNAME |
user name typed for authentication. |
REMOTE_ADDR |
connection's remote IP address. |
When the server recieve un TERM signal, it closes the accept socket, forks and the parent exits. Its child waits the remaining connection finish then exits. |
On reception of signal HUP, the server, reload configuration file and reopen the accepting socket. |
The server logs the requests in syslog using local0 facility. |
Pipeline mode is not supported. |
/usr/local/etc/popserv.conf -- default configuration file |
re_format(7), inetd(8), RFC 1939 |
Laurent Wacrenier -- <lwa@teaser.fr> |