.TH TPOP3D.CONF 5 .\" .\" tpop3d.conf.5: .\" Manual page for tpop3d configuration file. .\" .\" Copyright (c) 2001-2 Chris Lightfoot. All rights reserved. .\" .\" $Id: tpop3d.conf.5,v 1.48 2003/11/24 20:26:07 chris Exp $ .\" .\" Text begins .SH NAME tpop3d.conf \- configuration file for \fBtpop3d\fP(8) .SH SYNOPSIS .nf \fB#\fP \fIcomment\fP \fIkey\fP\fB:\fP \fIvalue\fP \fIkey\fP\fB:\fP \fIvalue\fP \fB\\\fP \fIcontinuation of value\fP ... .fi .Sp .SH DESCRIPTION The \fBtpop3d\fP configuration file, \fBtpop3d.conf\fP, consists of a number of \fIkey\fP:\ \fIvalue\fP pairs. Blank lines and comments introduced by `#' are ignored. It is legal for \fIvalue\fP to be blank. Presently-recognised configuration directives are: .SS Global options .TP .nf \fBlisten-address\fP: \fIaddress\fP[\fB:\fP\fIport\fP][\fB(\fP\fIdomain\fP\fB)\fP|\fB/\fP\fIregex\fP\fB/\fP][\fB;\fP\fItls-options\fP] ... .fi .Sp Specify an \fIaddress\fP and optional \fIport\fP on which incoming connections are accepted. \fIdomain\fP is the domain name for which the service is operated; alternatively, if mass virtual hosting support is compiled in (the default), then you can specify \fIregex\fP, a POSIX extended regular expression containing a single bracketed subexpression, instead of \fIdomain\fP; in this case, the regular expression is applied (in a case-insensitive sense) to the name of the host to which the client has connected, and the matching subexpression is used as the domain name. This only really makes sense if \fIaddress\fP is \fB0.0.0.0\fP (INADDR_ANY). If neither \fIdomain\fP nor \fIregex\fP are given, the portion of the name associated with the given \fIaddress\fP following the first `.' is used, or, if no such name can be established, the nodename of the system determined by \fBuname\fP(2). If any \fIport\fP is not specified, it is assumed to be \fB110\fP (pop-3), or \fB995\fP (pop-3s) if in `immediate' TLS mode. If \fBtpop3d\fP has been compiled with support for TLS (`SSL'), then you may specify additional \fItls-options\fP for each address, in the following form: .nf \fBtls=\fP(\fBimmediate\fP|\fBstls\fP)\fB,\fP\fIcertificate\fP[\fB,\fP\fIprivate-key\fP] .Sp .fi The first token after \fBtls=\fP specifies the mode of TLS operation in use on this address. There are two widely-supported modes of POP-3-over-TLS operation. In the first case, which we call \fBimmediate\fP mode, TLS negotiation is initiated immediately after a connection is received. In this mode, only TLS connections can be made to a particular address. In the other mode, the client establishes an unencrypted TCP connection, then issues the POP-3 command \fBSTLS\fP to initiate TLS negotiation. We call this \fBstls\fP mode. This mode permits unencrypted and TLS operation on the same address. The cryptographic identity to use for this address is read from the files named by \fIcertificate\fP and \fIprivate-key\fP. If only \fIcertificate\fP is given, then both the certificate and the private key should be contained in the one file. If a pass-phrase is required to make use of the certificate or private key, then \fBtpop3d\fP must be started with the \fB-P\fP option (see \fBtpop3d\fP(8)) to read the pass phrase from the terminal. To listen for connections on any interface and the default port, the directive .nf listen-address: 0.0.0.0 .Sp .fi is sufficient. To specify a specific domain, use this syntax: .nf listen-address: 12.34.56.78(example.com) 0.0.0.0(example.org) .Sp .fi If, alternatively, the machine has numerous interfaces with names \fBpop3.example.com\fP, \fBpop3.example.org\fP, etc., you could specify .nf listen-address: 0.0.0.0/^pop3\\.(.*)$/ .Sp .fi to accept incoming connections and associate them with the proper domains. Note that for this to work, all interfaces on which connections are to be accepted must have functioning inverse name resolution; also, in this case, \fBtpop3d\fP will do a name lookup for each incoming connection, which may block in the event of a DNS failure. You may wish to create some other mapping -- perhaps in /etc/hosts -- to ensure that this does not occur. .TP \fBmax-children\fP: \fInumber\fP The maximum number of child processes which may be actively serving connections at any given time. Consists of a single number. By default, this is set to 100. .TP \fBappend-domain\fP: (\fByes\fP|\fBtrue\fP) If authentication does not succeed for a given \fIusername\fP, retry with \fIusername\fP@\fIdomain\fP, where \fIdomain\fP is the domain name associated with the address on which the connection was received. This is intended to be used where multiple virtual domains are served from multiple IP addresses. This option only takes effect when \fIusername\fP does not contain a separator, which may be `@', `%', `:' or `!'. See below for a more detailed description. .TP \fBstrip-domain\fP: (\fByes\fP|\fBtrue\fP) If authentication does not succeed for a given \fIusername\fP, and the \fIusername\fP supplied is in the form \fIusername\fP@\fIdomain\fP, try the authentication again with a bare \fIusername\fP. \fIdomain\fP need not be the domain name associated with the address on which the connection was received. This is intended to be used where multiple domains are served by a single authenticator with the same username, such as when \fIusername\fP@\fIdomain.com\fP and \fIusername\fP@\fIdomain.net\fP are equivalent and served from the same machine. This option only takes effect when \fIusername\fP contains a separator, which may be `@', `%' or `!'. .TP \fBapop-only\fP: (\fByes\fP|\fBtrue\fP) Disconnect any client which attempts plaintext USER/PASS authentication. The intention of this option is to discourage users from sending plaintext passwords over the network, so it has no effect when a user is connected over a TLS-secured connection. .TP \fBtimeout-seconds\fP: \fInumber\fP This is the number of seconds for which a connection may be idle for before it is closed. If it is set to 0, then timeouts are disabled. The default value is 30 seconds (see the section on BUGS in \fBtpop3d\fP(8)). If you wish to have \fBtpop3d\fP comply explicitly with the RFC (which demands a ten-minute timeout), then specify 600 seconds. This may be necessary with some clients which pause randomly whilst downloading messages. .TP \fBlog-facility\fP: \fIfacility\fP This selects the `facility' as which \fBtpop3d\fP emits system log messages. Possible values for \fIfacility\fP are: \fBmail\fP, \fBauthpriv\fP, \fBdaemon\fP, \fBuser\fP, and \fBlocal0\fP through \fBlocal7\fP inclusive. (Although other possibilities are mentioned in \fBopenlog\fP(3), they don't make much sense for a POP3 server.) .TP \fBlog-stderr\fP: (\fByes\fP|\fBtrue\fP) Send log messages to standard error as well as the system log. This makes sense only when \fBtpop3d\fP is running with a controlling terminal. .TP \fBno-detach\fP: (\fByes\fP|\fBtrue\fP) Do not detach from controlling terminal. The \fB-d\fP command-line option to \fBtpop3d\fP is equivalent to combining this and the \fBlog-stderr\fP directives. .TP .nf \fBmailbox\fP: [\fImailbox-driver\fP:]\fIpath-spec\fP ... .fi .Sp This selects the location, and optionally the type, of the mailbox to use when a user is authenticated. \fIMailbox-driver\fP should be one of the names listed when you execute \fBtpop3d -h\fP; if left blank the default (first available) one is used, but this is discouraged as it may vary between builds of tpop3d. \fIPath-spec\fP should give a path name in the file system; you can use the substitution strings \fB$(user)\fP, the username supplied to the POP server by the client; \fB$(local_part)\fP, the local part of a client's email address in a virtual-domain authentication, \fB$(domain)\fP, the domain, and \fB$(home)\fP for the user's home directory. In addition, the syntax \fB$(foo[\fP\fIindex\fP\fB])\fP may be used to select a given letter of the string. 0 is the first character, and -1 the last. This allows the used of `hashed' spool directories; for example, .nf mailbox: bsd:/var/spool/mail/$(user[0])/$(user) .Sp .fi If several mailbox locations and types are specified, \fBtpop3d\fP will try each in turn, stopping when it opens a mailbox or encounters an error other than the mailbox not being present. This means that if your users have both maildir and bsd mailboxes, you can use something like .nf mailbox: maildir:$(home)/Maildir bsd:/var/spool/mail/$(user) .Sp .fi to support both. Some authentication drivers will set the mailbox explicitly, overriding this option. Those that do not also have a specific option, of the form \fBauth-foo-mailbox:\fP which overrides the global setting. .TP .nf \fBmailspool-index:\fP \fIpath-spec\fP .fi .Sp This selects the location of metadata cache files for BSD mailspools, based on their file names. This option is only available when \fBtpop3d\fP is compiled with metadata caching enabled, and it is only switched on when this option is specified. \fIPath-spec\fP gives the location of the metadata cache file, using substitution strings similar to those for the \fBmailbox\fP option above. In particular, you can use \fB$(name)\fP, the full name of the mailspool; \fB$(path)\fP, the directory containing the mailspool; \fB$(file)\fP, the file name of the mailspool (the part after the final `/'); and \fB$(escaped_name)\fP, which is the full name of the mailspool escaped using the HTTP-style \fB%..\fP convention so that it does not contain any slashes. Examples include: .nf mailspool-index: $(name).tpop3d-index mailspool-index: /var/spool/tpop3d/$(escaped_name) .fi .Sp In order to use this facility, \fBtpop3d\fP must be able to write the metadata cache files to the locations specified. If you choose to use a specific directory for this (for instance, /var/spool/mail or /var/spool/tpop3d), you will need to set appropriate permissions. 1777 (as for /tmp) is probably the best choice. \fBtpop3d\fP will overwrite any file whose name is the same as the specified cache file for a given mailspool; therefore, it is recommended that the mailspool index files be stored in a directory to which users would not customarily have access, for instance /var/spool/tpop3d. .TP \fBmaildir-exclusive-lock\fP: (\fByes\fP|\fBtrue\fP) Indicates that \fBtpop3d\fP should attempt to lock maildir mailboxes for exclusive access, so that it more closely follows the behaviour described in RFC1939. Even if not specified, \fBtpop3d\fP behaves intelligently when a message in a maildir is moved or deleted, so this option is not necessary. .TP .nf \fBtcp-wrappers-name\fP: \fIname\fP .fi .Sp This selects the `daemon name' used by \fBtpop3d\fP when it tests connections against the TCP Wrappers access-control-mechanism. This corresponds to the part of an entry before the first colon in hosts.allow or hosts.deny. If not specified, this will default to `tpop3d'. This feature is only available if \fBtpop3d\fP has been compiled with support for TCP Wrappers. .TP \fBdrac-server\fP: \fIhostname\fP If specified, gives the name of a server to which \fBtpop3d\fP should send DRAC notifications about successful logins. .TP \fBwhoson-enable\fP: (\fByes\fP|\fBtrue\fP) Enable notification of successful logins to a WHOSON server as defined in /etc/whoson.conf. .TP \fBtls-no-bug-workarounds\fP: (\fByes\fP|\fBtrue\fP) Disable workarounds for various bugs in client TLS implementations, as described in \fBSSL_ctx_set_options\fP(3). Only available if \fBtpop3d\fP has been built with TLS support. .SS Options relating to authentication \fBtpop3d\fP supports a number of authentication methods, each of which has a number of configurable options, which are given below. Authentication is supported using the conventional USER/PASS method, or the challenge-response APOP method. When a client connects to \fBtpop3d\fP and attempts authentication, a request is passed to each of a number of configured authenticators in turn, until the client is successfully authenticated or all authenticators have been tried. The information supplied with each request consists of \fIuser\fP, the user name as supplied by the client; \fIlocal-part\fP, the local-part of a virtual-domain email address, and \fIdomain\fP, the domain in which authentication is taking place. By default, \fIdomain\fP is the domain associated with the address to which the client has connected. If the client's supplied username contains one of the characters `@', `%', `:' or `!', it is interpreted as a \fIlocal-part\fP\fB@\fP\fIdomain\fP combination, and the given \fIlocal-part\fP is used while the given \fIdomain\fP replaces the domain derived from the address to which the client connected. If there is no separator, authentication is first attempted with no \fIlocal-part\fP and the default \fIdomain\fP; if this does not succeed, and the \fBappend-domain\fP global option is set, then authentication will also be attempted with the \fIlocal-part\fP the same as the supplied \fIuser\fP and the default domain. For example, if the client sends the command .nf USER foo .fi .Sp to the listener for domain `dom', \fBtpop3d\fP will try authentication with the parameters: .nf \fIuser\fP = foo \fIlocal-part\fP not set \fIdomain\fP = dom .fi .Sp If this fails, and \fBappend-domain\fP is set, then a second attempt will be made with: .nf \fIuser\fP = foo \fIlocal-part\fP = foo \fIdomain\fP = dom .fi .Sp Otherwise no second attempt is made. If instead the client says: .nf USER foo@bar .fi .Sp then authentication will be attempted using: .nf \fIuser\fP = foo@bar \fIlocal-part\fP = foo \fIdomain\fP = bar .fi .Sp In this case, no alternative attempt will be made if authentication fails. These global options apply to all authenticators: .TP \fBpermit-empty-password\fP: (\fByes\fP|\fBtrue\fP) If enabled, users may log in with an empty password. (Note that their client \fImust\fP send a space after the PASS command in this case.) .TP \fBonlogin-child-wait\fP: (\fByes\fP|\fBtrue\fP) If enabled, and the authenticator offers an `onlogin' action to be taken when a user logs in, the user's mailbox won't be opened until \fIafter\fP the onlogin action completes (otherwise, the child does not block in this way). This is intended to allow you to use the onlogin feature to implement server bulletins and similar features. .TP \fBlog-bad-passwords\fP: (\fByes\fP|\fBtrue\fP) Log incorrect passwords supplied by users who fail to log in. Use of this option is an invasion of privacy, but may be useful for debugging client configuration problems. .PP \fBtpop3d\fP can cache the results of successful login attempts, and re-use them when the same user logs in again. This is probably not useful except for servers which run under very heavy load. Authentication cacheing can only be used for USER/PASS authentication; it has no effect on APOP authentications. The following options control the authentication cache: .TP \fBauthcache-enable\fP: (\fByes\fP|\fBtrue\fP) Enable the cache. It is off by default. .TP \fBauthcache-entry-lifetime\fP: \fInumber\fP The number of seconds for which the results of a successful authentication are cached. The default value is 1 hour (3600 seconds). In order to be useful, this value must be much larger than the mean interval between POP sessions by a given client. For instance, if clients check mail every five minutes, then setting the lifetime to ten minutes will mean that, on average, half of authentications come from the cache and are fast. Setting it to one hour means that eleven out of twelve authentications come from the cache, and so forth. \fIBut note that this value also controls how long it takes for password changes to take effect!\fP .TP \fBauthcache-use-client-host\fP: (\fByes\fP|\fBtrue\fP) Some authenticators allow you to control authentication based on the IP address of the connected client. By default, the authentication cache ignores this information, so that a client which connects from more than one IP address (for instance, if their DHCP lease changes) can still be authenticated from the cache. But if you have authenticators whose behaviour varies based on client IP address, you must switch this option on, since otherwise the cache will give incorrect results in some cases. .SS PAM authentication options \fBauth-pam\fP uses Pluggable Authentication Modules to authenticate conventional (non-virtual-domains) users. .TP \fBauth-pam-enable\fP: (\fByes\fP|\fBtrue\fP) Enable authentication using Pluggable Authentication Modules. .TP \fBauth-pam-facility\fP: \fIfacility\fP Sets the PAM facility name used by \fBtpop3d\fP to \fIfacility\fP. Defaults to \fBtpop3d\fP. .TP \fBauth-pam-mail-group\fP: (\fIgroup-name\fP | \fIgid\fP) The group name or gid under which access to the mailspool will take place. The default for this option is the primary group of the authenticated user, which may not work. You will normally want to set this to `mail'. .TP \fBauth-pam-mail-user\fP: (\fIuser-name\fP | \fIuid\fP) In normal operation, \fBauth-pam\fP will only authenticate users who have local accounts (i.e., for whom there exists a passwd entry and a distinct user ID). It is also possible to use PAM to authenticate arbitrary user names. This option names a local user whose credentials are used for users without local accounts who are authenticated by PAM. This option will not be useful in a typical configuration. .SS Password authentication options These are only available if you compiled \fBtpop3d\fP with \fBauth-passwd\fP support. \fBauth-passwd\fP authenticates Unix users by direct lookups in /etc/passwd and, if configured at compile time, /etc/shadow. .TP \fBauth-passwd-enable\fP: (\fByes\fP|\fBtrue\fP) Enable authentication using /etc/passwd. .TP \fBauth-passwd-mail-group\fP: (\fIgroup-name\fP | \fIgid\fP) The group name or gid under which access to the mailspool will take place. The default for this option is the primary group of the authenticated user, which will probably not work. You will normally want to set this to `mail'. .SS MySQL authentication options These are only available if you compiled tpop3d with \fBauth-mysql\fP support. .TP \fBauth-mysql-enable\fP: (\fByes\fP | \fBtrue\fP) Enable MySQL authentication. .TP \fBauth-mysql-mail-group\fP: (\fIgroup-name\fP | \fIgid\fP) The group name or gid under which access to the mailspool will take place. The default for this option is the primary group of the UNIX user associated with the virtual domain. .TP \fBauth-mysql-hostname\fI: \fIhostname\fP Host on which to connect to MySQL, by default \fBlocalhost\fP. You may specify several hosts, separated by spaces or tabs. These hosts are tried in order until one is found working. The same database name, username and password are tried on each host. .TP \fBauth-mysql-database\fP: \fIdatabase\fP MySQL database to use for authentication. .TP \fBauth-mysql-username\fP: \fIusername\fP MySQL username used to access the database. .TP \fBauth-mysql-password\fP: \fIpassword\fP Password of MySQL user. .TP \fBauth-mysql-pass-query\fP: \fIsubstitution string\fP Query template to use for USER/PASS authentication. .TP \fBauth-mysql-apop-query\fP: \fIsubstitution string\fP Query template to use for APOP authentication. .TP \fBauth-mysql-onlogin-query\fP: \fIsubstitution string\fP Query template to use for POP-before-SMTP operation. .PP Since mailbox names are stored in the database, the \fBauth-mysql-mailbox:\fP setting is ignored. .SS A note on MySQL authentication The MySQL authentication scheme is intended to be used with the vmail-sql virtual domains configuration described at \fIhttp://www.ex-parrot.com/~chris/vmail-sql/\fP, and by default the queries it uses work with that schema. However, it is also possible to use the \fBauth-mysql-pass-query\fP and \fBauth-mysql-apop-query\fP directives to specify the SQL syntax for a query to use against any database schema. These should specify queries which return the mailbox file location, password hash, Unix user and mailbox type, in that order. The variables \fB$(user)\fP, \fB$(local_part)\fP and \fB$(domain)\fP are escaped and substituted into the string, in the same way as for the mailbox path specifications described above. In addition, the numerical IP address to which the client connected is substituted for \fB$(serverhost)\fP. The nature of password hashes is described more fully in README.auth_mysql in the distribution. If you do not wish to use either of USER/PASS or APOP authentication, specify the value \fBnone\fP for the relevant configuration directive; otherwise, the default (vmail-sql) query will be used. As an example, if you have a table called users which contains fields login, domain, cryptpw and the Maildir mailboxes for the users are under /path/to/$(domain)/$(local_part), then you could use .nf auth-mysql-pass-query: \\ SELECT CONCAT('/path/to/', '$(domain)', \\ '/', '$(local_part)'), \\ CONCAT('{crypt}', cryptpw), \\ 'mail', 'maildir' \\ FROM users \\ WHERE login = '$(local_part)' \\ AND domain = '$(domain)' .fi .Sp The \fBauth-mysql-onlogin-query\fP specifies an SQL statement (most likely an INSERT or UPDATE) which is executed after a successful login. This is intended to allow you to insert a record into a database table used to permit relaying in a `POP-before-SMTP' scheme. For this query, the additional value \fB$(clienthost)\fP indicates the connected client host, as a numeric IP address. This statement will be executed for any successful login, not only \fBauth-mysql\fP logins. Note that \fB$(local_part)\fP may not be supplied for a given login, so you should only use it if you are sure that all relevant logins will specify it. See the description of authentication, above, for more information. If more flexibility is required, consider using \fBauth-other\fP or \fBauth-perl\fP instead. Note that the username and password supplied in the configuration file are privileged information, in the sense that they would allow an arbitrary person to obtain information from the database if they have access to the machine on which it resides. The corollary to this is that the \fBtpop3d.conf\fP file should not be readable by arbitrary users. .SS Postgres authentication options These are only available if you compiled \fBtpop3d\fP with \fBauth-pgsql\fP support. .TP \fBauth-pgsql-enable\fP: (\fByes\fP | \fBtrue\fP) Enable Postgres authentication. .TP \fBauth-pgsql-username\fP .TP \fBauth-pgsql-password\fP .TP \fBauth-pgsql-database\fP .TP \fBauth-pgsql-hostname\fP .TP \fBauth-pgsql-pass-query\fP .TP \fBauth-pgsql-apop-query\fP .TP \fBauth-pgsql-onlogin-query\fP .TP \fBauth-pgsql-mail-group\fP Behave like the equivalent \fBauth-mysql\fP options. .SS LDAP authentication options These are only available if you compiled \fBtpop3d\fP with support for \fBauth-ldap\fP. .TP \fBauth-ldap-enable\fP: (\fByes\fP | \fBtrue\fP) Enable LDAP authentication. .TP \fBauth-ldap-url\fP: \fIsubstitution string\fP Template giving an LDAP URL indicating the server against which to make authentication requests. Note that the variables \fB$(user)\fP, \fB$(local_part)\fP and \fB$(domain)\fP may appear \fIonly\fP in the DN part of the URL. .TP \fBauth-ldap-tls\fP: (\fByes\fP | \fBtrue\fP) Use an encrypted connection to contact the LDAP server. .TP \fBauth-ldap-searchdn\fP: \fILDAP server username\fP DN to use when binding to LDAP server to search for a user. .TP \fBauth-ldap-password\fP: \fILDAP server password\fP Password of search user. .TP \fBauth-ldap-filter\fP: \fIsubstitution string\fP Filter template to use when searching for a user's account. .TP \fBauth-ldap-scope\fP: (\fBsubtree\fP|\fBbase\fP|\fBonelevel\fP) Scope of LDAP searches. If not specified, the default is `subtree'. .TP \fBauth-ldap-mailbox\fP: [\fImailbox-driver\fP:]\fIpath-spec\fP ... User mailbox location, as described above. or .TP \fBauth-ldap-mailbox-attr\fP: \fIattribute name\fP .TP \fBauth-ldap-mboxtype-attr\fP: \fIattribute name\fP LDAP attributes which contains the name of a user's mailbox, and its type. If the type is not specified, or if the attribute is not present for a given user, the driver will guess that mailbox names which end `/' are of type maildir, otherwise of type bsd. .TP \fBauth-ldap-mail-user\fP: (\fIuser-name\fP | \fIuid\fP) .TP \fBauth-ldap-mail-group\fP: (\fIgroup-name\fP | \fIgid\fP) User and group under which access to the mailbox will take place. or .TP \fBauth-ldap-mail-user-attr\fP: \fIattribute name\fP .TP \fBauth-ldap-mail-group-attr\fP: \fIattribute name\fP LDAP attributes which specify the user and group under which access to the mailbox will take place. .SS A note on LDAP authentication \fBtpop3d\fP uses a search-bind model for authenticating users against an LDAP server. When a user attempts to log in by supplying a username and password, \fBtpop3d\fP will attempt to locate an LDAP record for the user by substituting for \fB$(user)\fP, \fB$(local_part)\fP and \fB$(domain)\fP in the base DN given by \fBauth-ldap-url\fP and in the \fBauth-ldap-filter\fP filter template, binding to the LDAP server as the search user, and querying the LDAP server with this filter. If the search yields exactly one result, then an attempt is made to bind to the server using the credentials supplied by the client. If the bind is successful, then the user is authenticated. Information about the user's account, in particular, the user and group id to use for mailbox access, and the location and type of the mailbox, may be obtained either from the directory, or from values in the configuration file. .SS Flat file authentication options These are only available if you compiled \fBtpop3d\fP with support for \fBauth-flatfile\fP. .TP \fBauth-flatfile-enable\fP: (\fByes\fP | \fBtrue\fP) Enable flat file authentication. .TP \fBauth-flatfile-passwd-file\fP: \fIsubstitution string\fP Specify the file in which \fBtpop3d\fP will search for a user's password. .TP \fBauth-flatfile-mail-user\fP: (\fIuser-name\fP | \fIuid\fP) .TP \fBauth-flatfile-mail-group\fP: (\fIgroup-name\fP | \fIgid\fP) User and group under which access to the mailbox will take place. .SS A note on flat file authentication Flat files used for authentication consist of lines of \fIuser\fP\fB:\fP\fIpassword-hash\fP; any other fields following a subsequent colon are ignored, so that \fB/etc/passwd\fP-style files may be used. The specified password hash is interpreted as a hash produced using \fBcrypt\fP(3), unless it is preceded by a hashing scheme in \fB{}\fP. \fBauth-flatfile\fP may be used for APOP authentication if the password field consists of plaintext passwords preceded by \fB{plaintext}\fP. The user and group under which access to the mailbox takes place with \fBauth-flatfile\fP are always as specified in the configuration file. The file to be used is located by substituting for \fB$(domain)\fP in the \fBauth-flatfile-passwd-file\fP filename template. .SS External program (`other') authentication options These are only available if you compiled \fBtpop3d\fP with support for \fBauth-other\fP. .TP \fBauth-other-enable\fP: (\fByes\fP | \fBtrue\fP) Enable external program authentication. .TP \fBauth-other-program\fP: \fIpath\fP Program to use for external authentication; this must be an absolute path and should process requests as described below. .TP \fBauth-other-user\fP: (\fIuser-name\fP | \fIuid\fP) .TP \fBauth-other-group\fP: (\fIgroup-name\fP | \fIgid\fP) The user and group under which to run the authentication program. .TP \fBauth-other-timeout\fP: \fItime\fP The timeout in seconds for authentication; may be a fractional value, by default 0.75. .SS A note on external program authentication The intention of \fBauth-other\fP is to allow administrators to implement custom virtual-domains or other authentication schemes, without having to write C code to implement them. The distribution contains a perl module, \fBTPOP3D::AuthDriver\fP, which makes it extremely easy to implement a new authentication scheme, and various example scripts. One of the advantages of this is that if you want to implement an authenticator which uses a relational database other than MySQL, then you can use the support in perl's \fBDBI\fP library. An external authentication program reads data `packets' structured in the following format on its standard input: .nf \fIkey\fP\\0\fIvalue\fP\\0 ... \\0 .Sp .fi Defined \fIkey\fPs are: .TP \fBmethod\fP = (\fBAPOP\fP | \fBPASS\fP) Authentication mechanism being attempted. .TP \fBuser\fP = \fIusername\fP The username being sent with an APOP or USER command. .TP \fBlocal_part\fP = \fIlocal-part\fP (Sent only for virtual-domain authentication.) The local-part of the client's email address. .TP \fBdomain\fP = \fIdomain\fP (Sent only for virtual-domain authentication.) The domain of the client's email address. .TP \fBclienthost\fP = \fIIP number\fP The host from which the client is connected to the POP server. .TP \fBserverhost\fP = \fIIP number\fP The address to which the client connected on the POP server. .TP \fBtimestamp\fP = \fItimestamp string\fP (APOP only.) The `timestamp' string sent by the server to this client. .TP \fBdigest\fP = \fIhex digest\fP (APOP only.) Hex representation of the MD5 digest sent by the client with an APOP command. .TP \fBpass\fP = \fIpassword\fP (PASS only.) The password sent with a PASS command. .PP In response to an \fBAPOP\fP or \fBPASS\fP request, the program should write to standard output `packets' in the format described above. Defined \fIkey\fPs are: .TP \fBresult\fP = (\fBYES\fP | \fBNO\fP) Was authentication successful? .TP \fBlogmsg\fP = \fIstring\fP (Optional.) Specifies a message to be written to the system log. .PP The following apply only if authentication is successful; all but \fBuid\fP and \fBgid\fP are optional: .TP \fBuid\fP = (\fIuser-name\fP | \fIuid\fP) .TP \fBgid\fP = (\fIgroup-name\fP | \fIgid\fP) The user and group with which to access the mailspool. Note that the user must have a valid home directory. .TP \fBdomain\fP = \fIdomain\fP The domain in which the user has been authenticated. .TP \fBmailbox\fP = \fIpath\fP Path of this user's mailbox. .TP \fBmboxtype\fP = \fImailbox driver\fP The type of the mailbox. .PP If the mailbox is not specified, then the normal mechanism (via configuration directives \fBmailbox:\fP and \fBauth-other-mailbox:\fP) is used. Your authentication program will also receive packets describing any successful login. These may be used to implement POP-before-SMTP relaying. Such packets have the form .TP \fBmethod\fP = \fBONLOGIN\fP Indicating that the packet describes a login. .TP \fBuser\fP = \fIusername\fP The username as supplied by the client. .TP \fBlocal_part\fP = \fIlocal-part\fP .TP \fBdomain\fP = \fIdomain\fP The local-part and domain of the authenticated user. .TP \fBclienthost\fP = \fIIP number\fP The host from which the client is connected to the POP server. .PP The only valid responses to an \fBONLOGIN\fP request are an empty packet or one containing only a \fBlogmsg\fP directive. Note that \fBtpop3d\fP requires external authentication programs to respond in a timely fashion, since authentication blocks the main daemon; if no response is received within the timeout period specified, then the program will be killed with \fBSIGTERM\fP; if it fails to expire, \fBSIGKILL\fP will then be sent. An authentication program should catch \fBSIGTERM\fP to do any essential cleaning up. Your authentication program must not leak memory or file descriptors; if this is a problem, have it exit after some number of transactions; \fBtpop3d\fP will restart it automatically. .SS Perl authentication options These are only available if you compiled \fBtpop3d\fP with support for \fBauth-perl\fP. .TP \fBauth-perl-enable\fP: (\fByes\fP | \fBtrue\fP) Enable authentication via an embedded perl interpreter. .TP \fBauth-perl-start\fP: \fIperl code\fP Specify a line of perl code to be executed at startup; in most cases, this should be something like .nf auth-perl-start: do '/etc/tpop3d/tpop3d.pl'; .Sp .fi .TP \fBauth-perl-finish\fP: \fIperl code\fP Specify a line of perl code to be executed when the authentication driver is shut down. .TP \fBauth-perl-apop\fP: \fIsubroutine name\fP Specify the name of a perl subroutine which will be called when a request for APOP authentication is received. .TP \fBauth-perl-pass\fP: \fIsubroutine name\fP Specify the name of a perl subroutine which will be called when a request for USER/PASS authentication is received. .TP \fBauth-perl-onlogin\fP: \fIsubroutine name\fP Specify the name of a perl subroutine which will be called after a successful login for POP-before-SMTP operation. .SS A note on perl authentication The perl authentication subroutines named in the configuration file should take as their single argument a reference to a hash; this will contain keys and values as listed for \fBauth-other\fP above. The subroutines should also return a reference to a hash, indicating results as for \fBauth-other\fP. In addition, they may call \fBTPOP3D::print_log\fP with a single scalar argument to write a message via \fBtpop3d\fP's logging facility. The \fBauth-perl-onlogin\fP subroutine is called after any successful login (not just logins mediated by \fBauth-perl\fP) and is intended to be used to implement POP-before-SMTP relaying; the return value from this subroutine is ignored, except for any \fBlogmsg\fP hash element, which is logged in the normal way. Your perl routines must not leak memory (normally not a problem because of perl's garbage collector) or other system resources. If this is a problem, you could consider forcing \fBtpop3d\fP to restart every so often by calling \fBkill(1, $$)\fP, but it would probably be preferable to use \fBauth-other\fP in this case. .SH FILES .B /etc/tpop3d.conf .SH SEE ALSO .BR tpop3d (8), .BR mysql (1), .BR hosts.allow (5), .BR hosts.deny (5), .BR TPOP3D::AuthDriver (1), .BR regex (7), .BR whosond (8), .BR whoson.conf (5), .BR RFC1939, .br .IR http://www.ex-parrot.com/~chris/tpop3d/ , .br .IR http://www.ex-parrot.com/~chris/vmail-sql/ , .br .IR http://www.mysql.com/ , .br .IR http://lists.beasts.org/pipermail/tpop3d-discuss/ . .SH AUTHOR Chris Lightfoot . Portions by Mark Longair and Paul Makepeace. If you have a query about \fBtpop3d\fP, \fIplease do not send me personal email\fP. Instead, please send it to the \fBtpop3d\fP mailing list, to which you can subscribe by sending an email with the subject `subscribe' to .br . There is a mailing list archive at .br .IR http://lists.beasts.org/pipermail/tpop3d-discuss/ . .SH VERSION $Id: tpop3d.conf.5,v 1.48 2003/11/24 20:26:07 chris Exp $ .SH COPYING This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.