diff options
Diffstat (limited to 'net-mail/dovecot')
-rw-r--r-- | net-mail/dovecot/ChangeLog | 9 | ||||
-rw-r--r-- | net-mail/dovecot/Manifest | 7 | ||||
-rw-r--r-- | net-mail/dovecot/dovecot-1.2.12.ebuild | 261 | ||||
-rw-r--r-- | net-mail/dovecot/files/dovecot-1.2.init | 61 |
4 files changed, 336 insertions, 2 deletions
diff --git a/net-mail/dovecot/ChangeLog b/net-mail/dovecot/ChangeLog index 0c7345d1fada..9971a9959513 100644 --- a/net-mail/dovecot/ChangeLog +++ b/net-mail/dovecot/ChangeLog @@ -1,6 +1,13 @@ # ChangeLog for net-mail/dovecot # Copyright 1999-2010 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/net-mail/dovecot/ChangeLog,v 1.243 2010/06/17 20:52:06 patrick Exp $ +# $Header: /var/cvsroot/gentoo-x86/net-mail/dovecot/ChangeLog,v 1.244 2010/06/20 10:29:06 patrick Exp $ + +*dovecot-1.2.12 (20 Jun 2010) + + 20 Jun 2010; Patrick Lauer <patrick@gentoo.org> +dovecot-1.2.12.ebuild, + +files/dovecot-1.2.init: + Bump, fix for #324767. Small fix for init script to create needed dir if + absent. Thanks to Eray Aslan 17 Jun 2010; Patrick Lauer <patrick@gentoo.org> dovecot-1.1.7-r1.ebuild, dovecot-1.1.16.ebuild, dovecot-1.1.19.ebuild, dovecot-1.2.6.ebuild, diff --git a/net-mail/dovecot/Manifest b/net-mail/dovecot/Manifest index 916f3db94770..8b6055010d3c 100644 --- a/net-mail/dovecot/Manifest +++ b/net-mail/dovecot/Manifest @@ -2,6 +2,7 @@ AUX dovecot-1.1.11-11112baa8592.patch 1094 RMD160 8732151dcbbc2dccce5184d53f8913 AUX dovecot-1.1.11-4736327a8740.patch 861 RMD160 801e2df279a74a57ff5b697520a382663df486d3 SHA1 6da20773ac964e9f76b551cd3c0f20d30038b515 SHA256 39823922738cf6b37238472da5068b1e02d73cefe224b15ef9abcff457eb2291 AUX dovecot-1.1.11-bdc5391e52df.patch 1610 RMD160 eaf49900f1473781618e5401f36d0390be3035e5 SHA1 c7becfb34fc497cec2c6c3d8a4cdc98a1203a231 SHA256 75f583dc2d90cd2256da978f8a620b6af9c07a220faf7575430ed648a45dd2ad AUX dovecot-1.1.11-c08c602ca0dc.patch 1110 RMD160 dbb1908ce6959c6efe1bb43e3155736448f0b754 SHA1 f35724cc45159cc8b7faa5f850f06cd1b3100407 SHA256 07b5b10e8a105e2ca962f37fa425699a42b9fa6d565167191f3b55f1703eb912 +AUX dovecot-1.2.init 1720 RMD160 0f641929fd2c58878f6d69e6ba454b9110603031 SHA1 c498c5208f0504f2eadc460d515f563f907d05ef SHA256 9c7ef516324cd5a17c5f28f6af272d8d06106420c747ff5c4da6fa14a3ac316c AUX dovecot.init 874 RMD160 aa899b69d42946dcf2262c38731319474e759041 SHA1 4f0a95cf6ba9e86bd9008694ea927dc97703b24d SHA256 145d68382d757110aa86f58b2567fb25648fa0ca62788e3461f2b45fc5999c80 AUX dovecot.init-r2 1618 RMD160 5b5c88847c096282f5ab94b82db7fab5c9e42aa3 SHA1 d9f61ac897a6e377dc8cf2c6da4952a4ff7918e9 SHA256 6ad0d1fc09c41ba390e717667e4dad3838f669ef7b227e3cbdb60c499758a901 DIST 2cb08c188b6a.tar.gz 659713 RMD160 62af3e681e6383c7dd4f7fb260ee0d621a20ffdd SHA1 114b28098fdbdd16c34e331173d580e699703b2d SHA256 73173159e1ddef016fa178ebd91bdf938597ae8c4c33bef7294f37599401fdcd @@ -23,10 +24,13 @@ DIST dovecot-1.2-sieve-0.1.12.tar.gz 964938 RMD160 92ed585f098ebaa37bececa56bdd9 DIST dovecot-1.2-sieve-0.1.14.tar.gz 992724 RMD160 b61c9448c876062f2b1fd3d1cf72cbc430c5a82e SHA1 2ba2b4208fa9ed341c38ec8e918b4a87e46b8367 SHA256 880ee3857150f6154ca2ee4d2a9b1fcb3a42f04184b92a62987d0af1d826a72c DIST dovecot-1.2-sieve-0.1.15.tar.gz 1051262 RMD160 7fd3d23d5ef93d443cdedc8512dab649b2a99694 SHA1 2827df60028639ec15422a86f48a1c9b2a78431a SHA256 edddc49237d5cb07a7938de9850b475b071e9350b2035f99a15db7a56882295c DIST dovecot-1.2-sieve-0.1.16.tar.gz 1049918 RMD160 1609c33226946e403bcb00d97d7df3bea74a78f5 SHA1 88ac215356bb9e3e08adc54195c99d1317fd5a67 SHA256 fbe7f49244e05ca2c8fccfd3ac199723e9dfa0fd3608dce83ceaed923ffac974 +DIST dovecot-1.2-sieve-0.1.17.tar.gz 1029070 RMD160 7b53742c7388bf27521a46b8e1121f45a764df87 SHA1 420142a8438d76e3849727c3ab4bde5a5b7fb7e4 SHA256 e02a4a1b5958bbe1c8e216f11d00166e33c31b304cbd4180de29b1a1dd5e7d0b DIST dovecot-1.2.10-managesieve-0.11.11.diff.gz 6415 RMD160 875011115ac4050a57f1c96725628ca531ccb61f SHA1 11ff602015221300f291001daa09965e3e199428 SHA256 ef95762d0788869435c6a8d2bf9c416770e50b0f12267897a11d1a5331ac727e DIST dovecot-1.2.10.tar.gz 2864295 RMD160 0b508502b7c2e9aecd274bf15f1ec5adbb1843a7 SHA1 b717de1ab63f3d521c93385cbd20c49293921079 SHA256 a5d609e9e21aa0c727be2c48db662f0a5ff0824e28167a8d7779f5ccbbaa6ad2 DIST dovecot-1.2.11-managesieve-0.11.11.diff.gz 6454 RMD160 bfd7593b8ffa36ac6062e0ff147c9759447d6352 SHA1 f27d32144e6db35715ac9de3acd7a7d8948f3323 SHA256 fc024e9f68c6ab82f811af3155c94f1609670d85c7240dfbd34aa045e6fc8a8b DIST dovecot-1.2.11.tar.gz 2878057 RMD160 cb2090a21e99cfaf98d7cbfdc98adbf42df6e2cc SHA1 97e63377be3641d4c7aa5a0c6d4e2bd602d45972 SHA256 2971691d4f8307b7014ca6671f44151cb53379f80746aa4a95cdeb0b846e0474 +DIST dovecot-1.2.12-managesieve-0.11.11.diff.gz 6455 RMD160 8f55a97e9a68e53faafa78a5f725969403f1f295 SHA1 f3719fc5427c97c65416658d73ff3234eaa204c9 SHA256 ea6549ed32cb1968971ef00725b43c8154023b4ed67ae1eb272485a0cf90a64f +DIST dovecot-1.2.12.tar.gz 2882517 RMD160 9a2ecf836607905acebee57d082b0b4c36108260 SHA1 72fedd20c00eb3763012555c3622f84286cb8e65 SHA256 1ef0c40822cf64f20af1e65b4402da75296489aba25df8b13e2386df6952c281 DIST dovecot-1.2.6-managesieve-0.11.9.diff.gz 6443 RMD160 43408c4090e7c384a30bacfd207453e50583271d SHA1 c2710e09c9b71ce3607e5614683de4748dac6d85 SHA256 4928fea010f3d993d2fc2bb624cf7586680f42aad2f7548f515773ed244a0164 DIST dovecot-1.2.6.tar.gz 2668219 RMD160 e6086e1a57dd3cf75614823916b509fedfc5283d SHA1 02ede3936123252d542da90488a2d189fa39979c SHA256 b8511688a631bbf1ec35e87c685cf4252085404a931ca20e470ace2a28d4c225 DIST dovecot-1.2.7-managesieve-0.11.9.diff.gz 6458 RMD160 32fe5f253b352063f21166596efe66684df1d251 SHA1 636976c8302fc1f45085b4bc5a6970104fe0dce7 SHA256 bce916dd22493cbc0eaf918f75da1e2bef48d5d9fc5ce0bfec8d950754af4659 @@ -46,6 +50,7 @@ EBUILD dovecot-1.2.10-r1.ebuild 7754 RMD160 e72ff73862166b30e838064916ca86045317 EBUILD dovecot-1.2.11-r1.ebuild 8541 RMD160 f31a3cff9606f0254ba14d5bd5f60962daf99dba SHA1 874ee918a521b1995da49d9e7bb9d7d28d78fd36 SHA256 0e75be8e0338a01c54e72b507d8fe3c17ef1aa31a19ece769a5e3311897ca0ed EBUILD dovecot-1.2.11-r2.ebuild 8545 RMD160 791057381b7e4162d80db05672a17d293088c86c SHA1 ac09851b1488badf7d06d0a3b4c335ce7df67835 SHA256 5d3657d28e49d52a14b62b8c6f071a08bb8d2adcb43c82d8fd44abf46c2ea5ca EBUILD dovecot-1.2.11.ebuild 7751 RMD160 cc476b3a9bfe68f0686328f3f8392abea154f621 SHA1 ce7cffd095b48791bab4e79d4a5dd4f6ff881549 SHA256 4b6d62503b66a5a42ed9015e2faf9531aa1cae5b26b8f5133a5f0544f8d360d3 +EBUILD dovecot-1.2.12.ebuild 8543 RMD160 6eff4f84419429dda14e690fdfd24b1a78c35a7a SHA1 4954856d55e12cc0180de46c565e0c663eb7da12 SHA256 b2c92a18575cec2f1e339227629084ebcf948aee6451f05358c694195c762390 EBUILD dovecot-1.2.6.ebuild 7452 RMD160 379f7e92e2884dd2a5519ec35e14a7836a5b65e4 SHA1 f69958768853de1bdb6bb1b17c91180bb495064f SHA256 6303f3d40a38120b2be7ed36cd8b4d295850b50bc9fbbf75aff63abf8448facf EBUILD dovecot-1.2.7.ebuild 7460 RMD160 27f0834d2f57a5c70c8a49d3e24fe0b5fd4957f9 SHA1 0768fad638f1064c62f16eabb08d61c3e9a54424 SHA256 b219cd33667019ef7dae6f57b5f8f56a4b76736b1a0ec164028592f52b47f82f EBUILD dovecot-1.2.8.ebuild 7747 RMD160 4d47f9bbac6c6756c30b9eec848748457c0f5aaf SHA1 ec7d18b4f24694343beb53859adc3bdb6144ef87 SHA256 a9917c67aa30c605d63c6966bdea227012eeae4ce281de2dfa6e6aea7dfcff9d @@ -53,5 +58,5 @@ EBUILD dovecot-1.2.9-r1.ebuild 7746 RMD160 1cf4f8188b63ad635cd0adb111fb9f4636ec1 EBUILD dovecot-2.0_beta4.ebuild 9976 RMD160 de77edd5ac19941b93277068411d7beb1dc17668 SHA1 cc6e4ef99193a6d7fb7664a6402cc281edcffc2f SHA256 922f6b04ab1a04d7349add869e0fa4e8fa268168a8c1b82e310ccde2ec3f11c8 EBUILD dovecot-2.0_beta5.ebuild 10400 RMD160 c126b8fa233e9bd74aad9211ad5fd958effa137e SHA1 365d32edf1218a77453d7fecfdcfd1218c3c6ade SHA256 7914a01e7d958aea5b170d8883ae2f8b984c7a92a9d589313140ad4cab7b47a6 EBUILD dovecot-2.0_beta6.ebuild 8769 RMD160 6304fd5f4fcc2a3cf3a1a43e9d4e7738fe8af86c SHA1 e7d4c00304faef54181c0a2fe95495ad0f1b23cf SHA256 3783d420d1c5f1c826fa5babb1b632c38fde5652fb224b457bdefc0767cdd6fa -MISC ChangeLog 39114 RMD160 727b377f3fe64b1aff56b7b2bf359c38df1510b9 SHA1 919bd40acd2f2b8fabc1ca29bba4439a1e9dc81f SHA256 5beb98accc132cfb5f91502db7cd707b2c6b2f9e92e12bfe6f3994f62a958838 +MISC ChangeLog 39353 RMD160 b3eb1e3c163c28347ac0f5f503cf192c29368bb7 SHA1 255a28e9533a82b222c591a21c115ea1a8fb70bd SHA256 80755ec1b29e9e16f4d149b63466cb0ff5a895d27a0030fb454dadd9fab717a0 MISC metadata.xml 805 RMD160 5463fdc136060ba785d5d1394774f7bb6c76bdb5 SHA1 a309cf7dcbd283d70f7d418ca1a198400023dabe SHA256 f4edba91969b56d55fed13f18f0f49b81325377e1786a3d129feeb8de6086ee2 diff --git a/net-mail/dovecot/dovecot-1.2.12.ebuild b/net-mail/dovecot/dovecot-1.2.12.ebuild new file mode 100644 index 000000000000..b2eae4cceca7 --- /dev/null +++ b/net-mail/dovecot/dovecot-1.2.12.ebuild @@ -0,0 +1,261 @@ +# Copyright 1999-2010 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/net-mail/dovecot/dovecot-1.2.12.ebuild,v 1.1 2010/06/20 10:29:06 patrick Exp $ + +EAPI="2" + +inherit eutils versionator ssl-cert + +major_minor="$( get_version_component_range 1-2 )" +sieve_version="0.1.17" +managesieve_version="0.11.11" +SRC_URI="http://dovecot.org/releases/${major_minor}/${P}.tar.gz + sieve? ( http://www.rename-it.nl/dovecot/${major_minor}/dovecot-${major_minor}-sieve-${sieve_version}.tar.gz ) + managesieve? ( + http://www.rename-it.nl/dovecot/${major_minor}/dovecot-${PV}-managesieve-${managesieve_version}.diff.gz + http://www.rename-it.nl/dovecot/${major_minor}/dovecot-${major_minor}-managesieve-${managesieve_version}.tar.gz + )" +DESCRIPTION="An IMAP and POP3 server written with security primarily in mind" +HOMEPAGE="http://www.dovecot.org/" + +SLOT="0" +LICENSE="LGPL-2.1" # MIT too? +KEYWORDS="~alpha ~amd64 ~arm ~sparc ~x86" + +IUSE="berkdb bzip2 caps cydir dbox doc ipv6 kerberos ldap +maildir managesieve mbox mysql pam postgres sieve sqlite +ssl suid vpopmail zlib" + +DEPEND="berkdb? ( sys-libs/db ) + caps? ( sys-libs/libcap ) + kerberos? ( virtual/krb5 ) + ldap? ( net-nds/openldap ) + mysql? ( virtual/mysql ) + pam? ( virtual/pam ) + postgres? ( dev-db/postgresql-base ) + sqlite? ( dev-db/sqlite ) + ssl? ( dev-libs/openssl ) + vpopmail? ( net-mail/vpopmail )" + +RDEPEND="${DEPEND} + >=net-mail/mailbase-0.00-r8" + +pkg_setup() { + if use managesieve && ! use sieve; then + eerror "managesieve USE flag selected but sieve USE flag unselected" + die "USE flag problem" + fi + + if use dbox && ! use maildir; then + eerror "dbox USE flag needs maildir USE flag enabled" + die "USE flag problem" + fi + + # Add user and group for login process (same as for fedora/redhat) + enewgroup dovecot 97 + enewuser dovecot 97 -1 /dev/null dovecot + # add "mail" group for suid'ing. Better security isolation. + if use suid; then + enewgroup mail + fi +} + +src_prepare() { + use managesieve && epatch "${WORKDIR}"/dovecot-${PV}-managesieve-${managesieve_version}.diff +} + +src_configure() { + local conf="" + + if use postgres || use mysql || use sqlite; then + conf="${conf} --with-sql" + fi + + local storages="" + for storage in cydir dbox maildir mbox; do + use ${storage} && storages="${storage} ${storages}" + done + [ "${storages}" ] || storages="maildir" + + econf \ + --sysconfdir=/etc/dovecot \ + --localstatedir=/var \ + --with-moduledir="/usr/$( get_libdir )/dovecot" \ + $( use_with berkdb db ) \ + $( use_with bzip2 bzlib ) \ + $( use_with caps libcap ) \ + $( use_with kerberos gssapi ) \ + $( use_with ldap ) \ + $( use_with mysql ) \ + $( use_with pam ) \ + $( use_with postgres pgsql ) \ + $( use_with sqlite ) \ + $( use_with ssl ) \ + $( use_with vpopmail ) \ + $( use_with zlib ) \ + $( use_with ldap) \ + --with-storages="${storages}" \ + --with-pic \ + --enable-header-install \ + ${conf} + + if use sieve; then + # The sieve plugin needs this file to be build to determine the plugin + # directory and the list of libraries to link to. + emake dovecot-config || die "emake dovecot-config failed" + cd "../dovecot-${major_minor}-sieve-${sieve_version}" + econf --with-dovecot="${S}" + + if use managesieve; then + cd "../dovecot-${major_minor}-managesieve-${managesieve_version}" + econf --with-dovecot="${S}" --with-dovecot-sieve="../dovecot-${major_minor}-sieve-${sieve_version}" + fi + fi +} + +src_compile() { + emake CC="$(tc-getCC)" CFLAGS="${CFLAGS}" || die "make failed" + + if use sieve; then + cd "../dovecot-${major_minor}-sieve-${sieve_version}" + emake CC="$(tc-getCC)" CFLAGS="${CFLAGS}" || die "make failed" + + if use managesieve; then + cd "../dovecot-${major_minor}-managesieve-${managesieve_version}" + emake CC="$(tc-getCC)" CFLAGS="${CFLAGS}" || die "make failed" + fi + fi +} + +src_install () { + emake DESTDIR="${D}" install || die "make install failed" + + # insecure: + #use suid && fperms u+s /usr/libexec/dovecot/deliver + #better: + if use suid;then + einfo "Changing perms to allow deliver to be suided" + fowners root:mail /usr/libexec/dovecot/deliver + fperms 4750 /usr/libexec/dovecot/deliver + fi + + rm -f "${D}"/etc/dovecot/dovecot-{ldap,sql}-example.conf + + newinitd "${FILESDIR}"/dovecot-1.2.init dovecot + + rm -rf "${D}"/usr/share/doc/dovecot + + if use ssl; then + sed -i -e 's,^CERTDIR=.*,CERTDIR=\$SSLDIR/dovecot,' \ + -e 's,^KEYDIR=.*,KEYDIR=\$SSLDIR/dovecot,' \ + -e 's,^CERTFILE=.*,CERTFILE=\$CERTDIR/server.pem,' \ + -e 's,^KEYFILE=.*,KEYFILE=\$KEYDIR/server.key,' \ + doc/mkcert.sh || die "failed to update SSL settings in mkcert.sh" + fi + + dodoc AUTHORS NEWS README TODO dovecot-example.conf || die "basic dodoc failed" + dodoc doc/* || die "dodoc doc/ failed" + docinto wiki + dodoc doc/wiki/* || die "dodoc doc/wiki/ failed" + + # Create the dovecot.conf file from the dovecot-example.conf file that + # the dovecot folks nicely left for us.... + local conf="${D}/etc/dovecot/dovecot.conf" + mv "${D}"/etc/dovecot/dovecot-example.conf "${D}"/etc/dovecot/dovecot.conf + + # .maildir is the Gentoo default, but we need to support mbox to + local mail_location="maildir:~/.maildir" + if use mbox; then + mail_location="mbox:/var/spool/mail/%u:INDEX=/var/dovecot/%u" + keepdir /var/dovecot + sed -i -e 's|#mail_privileged_group =|mail_privileged_group = mail|' "${conf}" + fi + sed -i -e \ + "s|#mail_location =|mail_location = ${mail_location}|" "${conf}" \ + || die "failed to update mail location settings in dovecot.conf" + + # We're using pam files (imap and pop3) provided by mailbase + if use pam; then + sed -i -e '/passdb pam/, /^[ \t]*}/ s|#args = dovecot|args = "\*"|' \ + "${conf}" || die "failed to update PAM settings in dovecot.conf" + # mailbase does not provide a managesieve pam file + use managesieve && dosym imap /etc/pam.d/managesieve + fi + + # Listen on ipv6 and ipv4 + if use ipv6; then + sed -i -e 's/^#listen = \*/listen = \*, \[::\]/g' "${conf}" \ + || die "failed to update listen settings in dovecot.conf" + fi + + # Update ssl cert locations + if use ssl; then + sed -i -e 's,^#ssl_cert_file =.*,ssl_cert_file = /etc/ssl/dovecot/server.pem,' \ + -e 's,^#ssl_key_file =.*,ssl_key_file = /etc/ssl/dovecot/server.key,' \ + "${conf}" || die "failed to update SSL settings in dovecot.conf" + fi + + # Install SQL configuration + if use mysql || use postgres; then + cp doc/dovecot-sql-example.conf "${D}"/etc/dovecot/dovecot-sql.conf + fperms 600 /etc/dovecot/dovecot-sql.conf + sed -i -e '/db sql/,/args/ s|=|= /etc/dovecot-sql.conf|' "${conf}" \ + || die "failed to update SQL settings in dovecot-sql.conf" + dodoc doc/dovecot-sql-example.conf + fi + + # Install LDAP configuration + if use ldap; then + cp doc/dovecot-ldap-example.conf "${D}"/etc/dovecot/dovecot-ldap.conf + fperms 600 /etc/dovecot/dovecot-ldap.conf + sed -i -e '/db ldap/,/args/ s|=|= /etc/dovecot-ldap.conf|' "${conf}" \ + || die "failed to update LDAP settings in dovecot-ldap.conf" + dodoc doc/dovecot-ldap-example.conf + fi + + if use sieve; then + cd "../dovecot-${major_minor}-sieve-${sieve_version}" + emake DESTDIR="${D}" install || die "make install failed (sieve)" + + if use managesieve; then + cd "../dovecot-${major_minor}-managesieve-${managesieve_version}" + emake DESTDIR="${D}" install || die "make install failed (managesieve)" + fi + fi + + dodir /var/run/dovecot + fowners root:root /var/run/dovecot + fperms 0755 /var/run/dovecot + keepdir /var/run/dovecot/login + fowners root:dovecot /var/run/dovecot/login + fperms 0750 /var/run/dovecot/login + + ewarn "If you are upgrading from Dovecot 1.1, read " + ewarn " http://wiki.dovecot.org/Upgrading/1.2" + if use sieve; then + ewarn " http://wiki.dovecot.org/LDA/Sieve/Dovecot#Migration_from_CMUSieve" + ewarn " In particular, do not forget to change cmusieve to sieve" + fi +} + +pkg_postinst() { + + if use ssl; then + # Let's not make a new certificate if we already have one + if ! [[ -e "${ROOT}"/etc/ssl/dovecot/server.pem && \ + -e "${ROOT}"/etc/ssl/dovecot/server.key ]]; then + einfo "Creating SSL certificate" + SSL_ORGANIZATION="${SSL_ORGANIZATION:-Dovecot IMAP Server}" + install_cert /etc/ssl/dovecot/server + chown dovecot:mail "${ROOT}"/etc/ssl/dovecot/server.{key,pem} + fi + fi + + if grep -q '^ssl_key_password' "${ROOT}"/etc/dovecot/dovecot.conf; then + echo + ewarn "You have set ssl_key_password in dovecot.conf!" + ewarn "You are URGED to read the advice in the current" + ewarn "dovecot.conf regarding sensible handling of that" + ewarn "password, as it might be readable by any user" + ewarn "on your system who can access that file!" + fi + +} diff --git a/net-mail/dovecot/files/dovecot-1.2.init b/net-mail/dovecot/files/dovecot-1.2.init new file mode 100644 index 000000000000..13f5472dab32 --- /dev/null +++ b/net-mail/dovecot/files/dovecot-1.2.init @@ -0,0 +1,61 @@ +#!/sbin/runscript +# Copyright 1999-2008 Gentoo Foundation +# Distributed under the terms of the GNU General Public License, v2 or later +# $Header: /var/cvsroot/gentoo-x86/net-mail/dovecot/files/dovecot-1.2.init,v 1.1 2010/06/20 10:29:06 patrick Exp $ + +opts="${opts} reload" + +depend() { + need localmount net + before postfix + after bootmisc ldap mysql ntp-client ntpd postgresql saslauthd slapd + use logger +} + +checkconfig() { + DOVECOT_INSTANCE=${SVCNAME##*.} + if [ -n "${DOVECOT_INSTANCE}" -a "${SVCNAME}" != "dovecot" ]; then + DOVECOT_CONF=/etc/dovecot/dovecot.${DOVECOT_INSTANCE}.conf + else + DOVECOT_CONF=/etc/dovecot/dovecot.conf + fi + if [ ! -e ${DOVECOT_CONF} ]; then + eerror "You will need an ${DOVECOT_CONF} first" + return 1 + fi + if [ -x /usr/sbin/dovecot ]; then + DOVECOT_BASEDIR=$(/usr/sbin/dovecot -c ${DOVECOT_CONF} -a | grep '^base_dir: ' | sed 's/^base_dir: //') + else + eerror "dovecot not executable" + return 1 + fi + DOVECOT_BASEDIR=${DOVECOT_BASEDIR:-/var/run/dovecot} + DOVECOT_PIDFILE=${DOVECOT_BASEDIR}/master.pid + if [ ! -d "${DOVECOT_BASEDIR}" ]; then + install -d -o root -g root -m 0755 "${DOVECOT_BASEDIR}" + fi +} + +start() { + checkconfig || return 1 + ebegin "Starting ${SVCNAME}" + start-stop-daemon --start --exec /usr/sbin/dovecot \ + --pidfile "${DOVECOT_PIDFILE}" -- -c "${DOVECOT_CONF}" + eend $? +} + +stop() { + checkconfig || return 1 + ebegin "Stopping ${SVCNAME}" + start-stop-daemon --stop --exec /usr/sbin/dovecot \ + --pidfile "${DOVECOT_PIDFILE}" + eend $? +} + +reload() { + checkconfig || return 1 + ebegin "Reloading ${SVCNAME} configs and restarting auth/login processes" + start-stop-daemon --stop --oknodo --exec /usr/sbin/dovecot \ + --pidfile "${DOVECOT_PIDFILE}" --signal HUP + eend $? +} |