From 863f2bc9983c33221f5936421fc9c06caf21639a Mon Sep 17 00:00:00 2001 From: Timo Sirainen Date: Mon, 31 Aug 2009 16:35:43 -0400 Subject: [PATCH] Split dovecot-example.conf to multiple files. Also it's now installed under docdir. --HG-- branch : HEAD --- Makefile.am | 3 - configure.in | 2 + doc/Makefile.am | 12 +- doc/example-config/Makefile.am | 12 + doc/example-config/conf.d/Makefile.am | 16 + doc/example-config/conf.d/auth.conf | 309 +++++ doc/example-config/conf.d/imap.conf | 60 + doc/example-config/conf.d/lda.conf | 32 + doc/example-config/conf.d/logging.conf | 83 ++ doc/example-config/conf.d/mail.conf | 320 +++++ .../example-config/conf.d/master.conf | 12 +- doc/example-config/conf.d/plugin.conf | 55 + doc/example-config/conf.d/pop3.conf | 75 ++ doc/example-config/conf.d/ssl.conf | 41 + .../dovecot-db.conf} | 0 .../dovecot-dict-sql.conf} | 0 .../dovecot-ldap.conf} | 0 .../dovecot-sql.conf} | 0 doc/example-config/dovecot.conf | 60 + dovecot-example.conf | 1085 ----------------- src/config/Makefile.am | 3 +- src/config/config-connection.c | 2 +- src/config/config-parser.c | 4 +- src/config/doveconf.c | 7 +- src/config/main.c | 2 +- src/lib-master/Makefile.am | 4 +- 26 files changed, 1089 insertions(+), 1110 deletions(-) create mode 100644 doc/example-config/Makefile.am create mode 100644 doc/example-config/conf.d/Makefile.am create mode 100644 doc/example-config/conf.d/auth.conf create mode 100644 doc/example-config/conf.d/imap.conf create mode 100644 doc/example-config/conf.d/lda.conf create mode 100644 doc/example-config/conf.d/logging.conf create mode 100644 doc/example-config/conf.d/mail.conf rename dovecot-master-example.conf => doc/example-config/conf.d/master.conf (85%) create mode 100644 doc/example-config/conf.d/plugin.conf create mode 100644 doc/example-config/conf.d/pop3.conf create mode 100644 doc/example-config/conf.d/ssl.conf rename doc/{dovecot-db-example.conf => example-config/dovecot-db.conf} (100%) rename doc/{dovecot-dict-sql-example.conf => example-config/dovecot-dict-sql.conf} (100%) rename doc/{dovecot-ldap-example.conf => example-config/dovecot-ldap.conf} (100%) rename doc/{dovecot-sql-example.conf => example-config/dovecot-sql.conf} (100%) create mode 100644 doc/example-config/dovecot.conf delete mode 100644 dovecot-example.conf diff --git a/Makefile.am b/Makefile.am index 78e3acd411..c1936ce8eb 100644 --- a/Makefile.am +++ b/Makefile.am @@ -6,9 +6,6 @@ SUBDIRS = \ src \ $(DOCS) -confdir = $(sysconfdir) -conf_DATA = dovecot-example.conf - EXTRA_DIST = \ COPYING.LGPL \ COPYING.MIT \ diff --git a/configure.in b/configure.in index 2330800e04..cedc15f53a 100644 --- a/configure.in +++ b/configure.in @@ -2451,6 +2451,8 @@ AC_CONFIG_FILES([ Makefile doc/Makefile doc/wiki/Makefile +doc/example-config/Makefile +doc/example-config/conf.d/Makefile src/Makefile src/lib/Makefile src/lib-sql/Makefile diff --git a/doc/Makefile.am b/doc/Makefile.am index 0d5465f213..6d08cc55cf 100644 --- a/doc/Makefile.am +++ b/doc/Makefile.am @@ -1,11 +1,4 @@ -SUBDIRS = wiki - -confdir = $(sysconfdir) -conf_DATA = \ - dovecot-db-example.conf \ - dovecot-dict-sql-example.conf \ - dovecot-ldap-example.conf \ - dovecot-sql-example.conf +SUBDIRS = wiki example-config doc_DATA = \ auth-protocol.txt \ @@ -18,5 +11,4 @@ EXTRA_DIST = \ mkcert.sh \ dovecot-openssl.cnf \ solr-schema.xml \ - $(doc_DATA) \ - $(conf_DATA) + $(doc_DATA) diff --git a/doc/example-config/Makefile.am b/doc/example-config/Makefile.am new file mode 100644 index 0000000000..57109586fc --- /dev/null +++ b/doc/example-config/Makefile.am @@ -0,0 +1,12 @@ +SUBDIRS = conf.d + +exampledir = $(docdir)/example-config +example_DATA = \ + dovecot.conf \ + dovecot-db.conf \ + dovecot-dict-sql.conf \ + dovecot-ldap.conf \ + dovecot-sql.conf + +EXTRA_DIST = \ + $(example_DATA) diff --git a/doc/example-config/conf.d/Makefile.am b/doc/example-config/conf.d/Makefile.am new file mode 100644 index 0000000000..14a4e180d5 --- /dev/null +++ b/doc/example-config/conf.d/Makefile.am @@ -0,0 +1,16 @@ +pkgsysconfdir = $(sysconfdir)/dovecot + +exampledir = $(docdir)/example-config/conf.d +example_DATA = \ + auth.conf \ + imap.conf \ + lda.conf \ + logging.conf \ + mail.conf \ + master.conf \ + plugin.conf \ + pop3.conf \ + ssl.conf + +EXTRA_DIST = \ + $(example_DATA) diff --git a/doc/example-config/conf.d/auth.conf b/doc/example-config/conf.d/auth.conf new file mode 100644 index 0000000000..0fae446d53 --- /dev/null +++ b/doc/example-config/conf.d/auth.conf @@ -0,0 +1,309 @@ +## +## Authentication processes +## + +# Authentication cache size in kilobytes. 0 means it's disabled. +# Note that bsdauth, PAM and vpopmail require cache_key to be set for caching +# to be used. +#auth_cache_size = 0 +# Time to live in seconds for cached data. After this many seconds the cached +# record is no longer used, *except* if the main database lookup returns +# internal failure. We also try to handle password changes automatically: If +# user's previous authentication was successful, but this one wasn't, the +# cache isn't used. For now this works only with plaintext authentication. +#auth_cache_ttl = 3600 +# TTL for negative hits (user not found). 0 disables caching them completely. +#auth_cache_negative_ttl = 3600 + +# Space separated list of realms for SASL authentication mechanisms that need +# them. You can leave it empty if you don't want to support multiple realms. +# Many clients simply use the first one listed here, so keep the default realm +# first. +#auth_realms = + +# Default realm/domain to use if none was specified. This is used for both +# SASL realms and appending @domain to username in plaintext logins. +#auth_default_realm = + +# List of allowed characters in username. If the user-given username contains +# a character not listed in here, the login automatically fails. This is just +# an extra check to make sure user can't exploit any potential quote escaping +# vulnerabilities with SQL/LDAP databases. If you want to allow all characters, +# set this value to empty. +#auth_username_chars = abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ01234567890.-_@ + +# Username character translations before it's looked up from databases. The +# value contains series of from -> to characters. For example "#@/@" means +# that '#' and '/' characters are translated to '@'. +#auth_username_translation = + +# Username formatting before it's looked up from databases. You can use +# the standard variables here, eg. %Lu would lowercase the username, %n would +# drop away the domain if it was given, or "%n-AT-%d" would change the '@' into +# "-AT-". This translation is done after auth_username_translation changes. +#auth_username_format = + +# If you want to allow master users to log in by specifying the master +# username within the normal username string (ie. not using SASL mechanism's +# support for it), you can specify the separator character here. The format +# is then . UW-IMAP uses "*" as the +# separator, so that could be a good choice. +#auth_master_user_separator = + +# Username to use for users logging in with ANONYMOUS SASL mechanism +#auth_anonymous_username = anonymous + +# Maximum number of dovecot-auth worker processes. They're used to execute +# blocking passdb and userdb queries (eg. MySQL and PAM). They're +# automatically created and destroyed as needed. +#auth_worker_max_count = 30 + +# Host name to use in GSSAPI principal names. The default is to use the +# name returned by gethostname(). Use "$ALL" to allow all keytab entries. +#auth_gssapi_hostname = + +# Kerberos keytab to use for the GSSAPI mechanism. Will use the system +# default (usually /etc/krb5.keytab) if not specified. +#auth_krb5_keytab = + +# Do NTLM and GSS-SPNEGO authentication using Samba's winbind daemon and +# ntlm_auth helper. +#auth_use_winbind = no + +# Path for Samba's ntlm_auth helper binary. +#auth_winbind_helper_path = /usr/bin/ntlm_auth + +# Number of seconds to delay before replying to failed authentications. +#auth_failure_delay = 2 + +# UNIX socket path to master authentication server to find users. +# This is used by imap (for shared users) and lda. +#auth_socket_path = /var/run/dovecot/auth-userdb + +auth default { + # Space separated list of wanted authentication mechanisms: + # plain login digest-md5 cram-md5 ntlm rpa apop anonymous gssapi otp skey + # gss-spnego + # NOTE: See also disable_plaintext_auth setting. + auth_mechanisms = plain + + # + # Password database is used to verify user's password (and nothing more). + # You can have multiple passdbs and userdbs. This is useful if you want to + # allow both system users (/etc/passwd) and virtual users to login without + # duplicating the system users into virtual database. + # + # + # + # By adding master=yes setting inside a passdb you make the passdb a list + # of "master users", who can log in as anyone else. Unless you're using PAM, + # you probably still want the destination user to be looked up from passdb + # that it really exists. This can be done by adding pass=yes setting to the + # master passdb. + + # Users can be temporarily disabled by adding a passdb with deny=yes. + # If the user is found from that database, authentication will fail. + # The deny passdb should always be specified before others, so it gets + # checked first. Here's an example: + + #passdb passwd-file { + # File contains a list of usernames, one per line + #args = /etc/dovecot.deny + #deny = yes + #} + + # PAM authentication. Preferred nowadays by most systems. + # Note that PAM can only be used to verify if user's password is correct, + # so it can't be used as userdb. If you don't want to use a separate user + # database (passwd usually), you can use static userdb. + # REMEMBER: You'll need /etc/pam.d/dovecot file created for PAM + # authentication to actually work. + passdb pam { + # [session=yes] [setcred=yes] [failure_show_msg=yes] [max_requests=] + # [cache_key=] [] + # + # session=yes makes Dovecot open and immediately close PAM session. Some + # PAM plugins need this to work, such as pam_mkhomedir. + # + # setcred=yes makes Dovecot establish PAM credentials if some PAM plugins + # need that. They aren't ever deleted though, so this isn't enabled by + # default. + # + # max_requests specifies how many PAM lookups to do in one process before + # recreating the process. The default is 100, because many PAM plugins + # leak memory. + # + # cache_key can be used to enable authentication caching for PAM + # (auth_cache_size also needs to be set). It isn't enabled by default + # because PAM modules can do all kinds of checks besides checking password, + # such as checking IP address. Dovecot can't know about these checks + # without some help. cache_key is simply a list of variables (see + # doc/wiki/Variables.txt) which must match for the cached data to be used. + # Here are some examples: + # %u - Username must match. Probably sufficient for most uses. + # %u%r - Username and remote IP address must match. + # %u%s - Username and service (ie. IMAP, POP3) must match. + # + # The service name can contain variables, for example %Ls expands to + # pop3 or imap. + # + # Some examples: + # args = session=yes %Ls + # args = cache_key=%u dovecot + #args = dovecot + } + + # System users (NSS, /etc/passwd, or similiar) + # In many systems nowadays this uses Name Service Switch, which is + # configured in /etc/nsswitch.conf. + #passdb passwd { + # [blocking=yes] - See userdb passwd for explanation + #args = + #} + + # Shadow passwords for system users (NSS, /etc/shadow or similiar). + # Deprecated by PAM nowadays. + # + #passdb shadow { + # [blocking=yes] - See userdb passwd for explanation + #args = + #} + + # PAM-like authentication for OpenBSD. + # + #passdb bsdauth { + # [cache_key=] - See cache_key in PAM for explanation. + #args = + #} + + # passwd-like file with specified location + # + #passdb passwd-file { + # [scheme=] [username_format=] + # + #args = + #} + + # checkpassword executable authentication + # NOTE: You will probably want to use "userdb prefetch" with this. + # + #passdb checkpassword { + # Path for checkpassword binary + #args = + #} + + # SQL database + #passdb sql { + # Path for SQL configuration file, see doc/dovecot-sql-example.conf + #args = + #} + + # LDAP database + #passdb ldap { + # Path for LDAP configuration file, see doc/dovecot-ldap-example.conf + #args = + #} + + # vpopmail authentication + #passdb vpopmail { + # [cache_key=] - See cache_key in PAM for explanation. + # [quota_template=