diff --git a/mail/dovecot/Makefile b/mail/dovecot/Makefile new file mode 100644 index 00000000000..f4a7b74a128 --- /dev/null +++ b/mail/dovecot/Makefile @@ -0,0 +1,34 @@ +# $OpenBSD: Makefile,v 1.1.1.1 2003/07/14 23:44:28 jolan Exp $ + +COMMENT= "compact IMAP/POP3 server" +DISTNAME= dovecot-0.99.10 +CATEGORIES= mail +MASTER_SITES= ${HOMEPAGE} + +HOMEPAGE= http://dovecot.procontrol.fi/ + +MAINTAINER= Jolan Luff + +# LGPL +PERMIT_PACKAGE_CDROM= Yes +PERMIT_PACKAGE_FTP= Yes +PERMIT_DISTFILES_CDROM= Yes +PERMIT_DISTFILES_FTP= Yes + +MODULES= iconv + +CONFIGURE_STYLE=gnu +CONFIGURE_ARGS+=--without-pam --without-shadow --without-vpopmail \ + --localstatedir=/var --with-ssldir=/etc/ssl --with-ssl=openssl + +post-configure: + @perl -pi -e 's|_PREFIX_|${PREFIX}|g' ${WRKSRC}/dovecot-example.conf + +post-install: + ${INSTALL_DATA_DIR} ${PREFIX}/share/examples/dovecot + ${INSTALL_DATA} ${WRKSRC}/doc/dovecot-openssl.cnf \ + ${WRKSRC}/dovecot-example.conf ${PREFIX}/share/examples/dovecot + ${INSTALL_SCRIPT} ${WRKSRC}/doc/mkcert.sh \ + ${PREFIX}/sbin/dovecot-mkcert.sh + +.include diff --git a/mail/dovecot/distinfo b/mail/dovecot/distinfo new file mode 100644 index 00000000000..bfc671673c4 --- /dev/null +++ b/mail/dovecot/distinfo @@ -0,0 +1,3 @@ +MD5 (dovecot-0.99.10.tar.gz) = 26d8452366a28418cc8a114781a721b6 +RMD160 (dovecot-0.99.10.tar.gz) = 82f9b0abe95697fc52e5f5415a90eaba172371f7 +SHA1 (dovecot-0.99.10.tar.gz) = 0a1d83cbd27c3aa3e0732416a0871afc23ee5e19 diff --git a/mail/dovecot/patches/patch-Makefile_in b/mail/dovecot/patches/patch-Makefile_in new file mode 100644 index 00000000000..9f40bb6167e --- /dev/null +++ b/mail/dovecot/patches/patch-Makefile_in @@ -0,0 +1,12 @@ +$OpenBSD: patch-Makefile_in,v 1.1.1.1 2003/07/14 23:44:28 jolan Exp $ +--- Makefile.in.orig Thu Jun 26 11:14:04 2003 ++++ Makefile.in Sat Jul 5 19:30:34 2003 +@@ -345,7 +345,7 @@ install-data-am: install-confDATA + install-data: install-data-recursive + + install-am: all-am +- @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am ++ @$(MAKE) $(AM_MAKEFLAGS) install-exec-am + install: install-recursive + uninstall-am: uninstall-confDATA + uninstall: uninstall-recursive diff --git a/mail/dovecot/patches/patch-doc_mkcert_sh b/mail/dovecot/patches/patch-doc_mkcert_sh new file mode 100644 index 00000000000..ea921c443a2 --- /dev/null +++ b/mail/dovecot/patches/patch-doc_mkcert_sh @@ -0,0 +1,29 @@ +$OpenBSD: patch-doc_mkcert_sh,v 1.1.1.1 2003/07/14 23:44:28 jolan Exp $ +--- doc/mkcert.sh.orig Mon Feb 24 13:38:23 2003 ++++ doc/mkcert.sh Sun Jul 6 03:10:59 2003 +@@ -5,17 +5,18 @@ + + OPENSSL=${OPENSSL-openssl} + SSLDIR=${SSLDIR-/etc/ssl} +-OPENSSLCONFIG=${OPENSSLCONFIG-dovecot-openssl.cnf} ++OPENSSLCONFIG=${OPENSSLCONFIG-${SSLDIR}/dovecot-openssl.cnf} + +-CERTFILE=$SSLDIR/certs/imapd.pem +-KEYFILE=$SSLDIR/private/imapd.pem ++CERTFILE=$SSLDIR/dovecotcert.pem ++KEYFILE=$SSLDIR/private/dovecot.pem + +-if [ ! -d $SSLDIR/certs ]; then +- echo $SSLDIR/certs directory doesn't exist +-fi ++#if [ ! -d $SSLDIR/certs ]; then ++# echo $SSLDIR/certs directory doesn't exist ++#fi + + if [ ! -d $SSLDIR/private ]; then +- echo $SSLDIR/private directory doesn't exist ++ echo "$SSLDIR/private directory doesn't exist" ++ exit 1 + fi + + if [ -f $CERTFILE ]; then diff --git a/mail/dovecot/patches/patch-dovecot-example_conf b/mail/dovecot/patches/patch-dovecot-example_conf new file mode 100644 index 00000000000..0956dea1b42 --- /dev/null +++ b/mail/dovecot/patches/patch-dovecot-example_conf @@ -0,0 +1,135 @@ +$OpenBSD: patch-dovecot-example_conf,v 1.1.1.1 2003/07/14 23:44:28 jolan Exp $ +--- dovecot-example.conf.orig Thu Jun 26 11:11:06 2003 ++++ dovecot-example.conf Mon Jul 14 18:27:22 2003 +@@ -1,13 +1,12 @@ + ## Dovecot 1.0 configuration file + + # Default values are shown after each value, it's not required to uncomment +-# any of the lines. Exception to this are paths, they're just examples +-# with real defaults being based on configure options. The paths listed here +-# are for configure --prefix=/usr --sysconfdir=/etc --localstatedir=/var +-# --with-ssldir=/etc/ssl ++# any of the lines. ++ ++# *** NOTE *** Some values HAVE been changed for OpenBSD use. + + # Base directory where to store runtime data. +-#base_dir = /var/run/dovecot/ ++base_dir = /var/dovecot/ + + # Protocols we want to be serving: + # imap imaps pop3 pop3s +@@ -33,12 +32,12 @@ + # dropping root privileges, so keep the key file unreadable by anyone but + # root. Included doc/mkcert.sh can be used to easily generate self-signed + # certificate, just make sure to update the domains in dovecot-openssl.cnf +-#ssl_cert_file = /etc/ssl/certs/dovecot.pem ++ssl_cert_file = /etc/ssl/dovecotcert.pem + #ssl_key_file = /etc/ssl/private/dovecot.pem + + # SSL parameter file. Master process generates this file for login processes. + # It contains Diffie Hellman and RSA parameters. +-#ssl_parameters_file = /var/run/dovecot/ssl-parameters.dat ++ssl_parameters_file = /var/dovecot/ssl-parameters.dat + + # How often to regenerate the SSL parameters file. Generation is quite CPU + # intensive operation. The value is in hours, 0 disables regeneration +@@ -47,7 +46,7 @@ + + # Disable LOGIN command and all other plaintext authentications unless + # SSL/TLS is used (LOGINDISABLED capability) +-#disable_plaintext_auth = no ++disable_plaintext_auth = yes + + # Use this logfile instead of syslog(). /dev/stderr can be used if you want to + # use stderr for logging (ONLY /dev/stderr - otherwise it is closed). +@@ -67,7 +66,7 @@ + # Directory where authentication process places authentication UNIX sockets + # which login needs to be able to connect to. The sockets are created when + # running as root, so you don't have to worry about permissions. +-#login_dir = /var/run/dovecot/login ++login_dir = /var/dovecot/login + + # chroot login process to the login_dir. Only reason not to do this is if you + # wish to run the whole Dovecot without roots. +@@ -81,12 +80,12 @@ + login = imap + + # Executable location. +-#login_executable = /usr/libexec/dovecot/imap-login ++#login_executable = _PREFIX_/libexec/dovecot/imap-login + + # User to use for the login process. Create a completely new user for this, + # and don't use it anywhere else. The user must also belong to a group where + # only it has access, it's used to control access for authentication process. +-#login_user = dovecot ++login_user = _dovecot + + # Set max. process size in megabytes. If you don't use + # login_process_per_connection you might need to grow this. +@@ -126,7 +125,7 @@ login = imap + login = pop3 + + # Exception to above rule being the executable location. +-#login_executable = /usr/libexec/dovecot/pop3-login ++#login_executable = _PREFIX_/libexec/dovecot/pop3-login + + ## + ## Mail processes +@@ -284,7 +283,7 @@ login = pop3 + # with is important to avoid deadlocks if other MTAs/MUAs are using both fcntl + # and flock. Some operating systems don't allow using both of them + # simultaneously, eg. BSDs. If dotlock is used, it's always created first. +-#mbox_locks = dotlock fcntl ++mbox_locks = fcntl + + # Should we create dotlock file even when we want only a read-lock? Setting + # this to yes hurts the performance when the mailbox is accessed simultaneously +@@ -314,7 +313,7 @@ login = pop3 + ## + + # Executable location +-#imap_executable = /usr/libexec/dovecot/imap ++#imap_executable = _PREFIX_/libexec/dovecot/imap + + # Set max. process size in megabytes. Most of the memory goes to mmap()ing + # files, so it shouldn't harm much even if this limit is set pretty high. +@@ -322,14 +321,14 @@ login = pop3 + + # Support for dynamically loadable modules. + #imap_use_modules = no +-#imap_modules = /usr/lib/dovecot/imap ++#imap_modules = _PREFIX_/lib/dovecot/imap + + ## + ## POP3 process + ## + + # Executable location +-#pop3_executable = /usr/libexec/dovecot/pop3 ++#pop3_executable = _PREFIX_/libexec/dovecot/pop3 + + # Set max. process size in megabytes. Most of the memory goes to mmap()ing + # files, so it shouldn't harm much even if this limit is set pretty high. +@@ -337,7 +336,7 @@ login = pop3 + + # Support for dynamically loadable modules. + #pop3_use_modules = no +-#pop3_modules = /usr/lib/dovecot/pop3 ++#pop3_modules = _PREFIX_/lib/dovecot/pop3 + + ## + ## Authentication processes +@@ -386,10 +385,10 @@ auth_userdb = passwd + # vpopmail: vpopmail authentication + # ldap : LDAP, see doc/dovecot-ldap.conf + # pgsql : a PostgreSQL database, see doc/dovecot-pgsql.conf +-auth_passdb = pam ++auth_passdb = passwd + + # Executable location +-#auth_executable = /usr/libexec/dovecot/dovecot-auth ++#auth_executable = _PREFIX_/libexec/dovecot/dovecot-auth + + # Set max. process size in megabytes. + #auth_process_size = 256 diff --git a/mail/dovecot/pkg/DEINSTALL b/mail/dovecot/pkg/DEINSTALL new file mode 100644 index 00000000000..f09eb1bda66 --- /dev/null +++ b/mail/dovecot/pkg/DEINSTALL @@ -0,0 +1,44 @@ +#!/bin/sh +# $OpenBSD: DEINSTALL,v 1.1.1.1 2003/07/14 23:44:28 jolan Exp $ +PATH=/bin:/usr/bin:/sbin:/usr/sbin +PREFIX=${PKG_PREFIX:-/usr/local} +SYSCONFDIR=${SYSCONFDIR:-/etc} +CONFIG_FILE=${SYSCONFDIR}/dovecot.conf +DOVECOTDIR=/var/dovecot +SSL_DIR=/etc/ssl +DOVECOTUSER=_dovecot +DOVECOTGROUP=_dovecot + +echo +echo "+---------------" +echo "| To completely deinstall the $1 package you need to perform" +echo "| these steps as root:" +echo "|" +if userinfo -e $DOVECOTUSER; then +echo "| userdel $DOVECOTUSER" +fi +if groupinfo -e $DOVECOTGROUP; then +echo "| groupdel $DOVECOTGROUP" +fi +if [ -f $CONFIG_FILE ]; then +echo "| rm $CONFIG_FILE" +fi +if [ -f $SSL_DIR/dovecot-openssl.cnf ]; then +echo "| rm $SSL_DIR/dovecot-openssl.cnf" +fi +if [ -f $SSL_DIR/dovecotcert.pem ]; then +echo "| rm $SSL_DIR/dovecotcert.pem" +fi +if [ -f $SSL_DIR/private/dovecot.pem ]; then +echo "| rm $SSL_DIR/private/dovecot.pem" +fi +if [ -d $DOVECOTDIR ]; then +echo "| rm -rf $DOVECOTDIR" +fi +echo "|" +echo "| Do not do this if you plan on re-installing" +echo "| $1 at some future time." +echo "+---------------" +echo + +exit 0 diff --git a/mail/dovecot/pkg/DESCR b/mail/dovecot/pkg/DESCR new file mode 100644 index 00000000000..3e14149ff1a --- /dev/null +++ b/mail/dovecot/pkg/DESCR @@ -0,0 +1,8 @@ +Dovecot is an IMAP and POP3 server for Linux/UNIX-like systems, written +with security primarily in mind. Although it's written in C, it uses +several coding techniques to avoid most of the common pitfalls. Dovecot +can work with standard mbox and maildir formats and it's fully +compatible with UW-IMAP and Courier IMAP servers as well as mail clients +accessing the mailboxes directly. + +WWW: ${HOMEPAGE} diff --git a/mail/dovecot/pkg/INSTALL b/mail/dovecot/pkg/INSTALL new file mode 100644 index 00000000000..fc122574355 --- /dev/null +++ b/mail/dovecot/pkg/INSTALL @@ -0,0 +1,116 @@ +#!/bin/sh +# $OpenBSD: INSTALL,v 1.1.1.1 2003/07/14 23:44:28 jolan Exp $ +PATH=/bin:/usr/bin:/sbin:/usr/sbin +PREFIX=${PKG_PREFIX:-/usr/local} +SYSCONFDIR=${SYSCONFDIR:-/etc} +CONFIG_FILE=${SYSCONFDIR}/dovecot.conf +SSL_DIR=/etc/ssl +SSL_FILE=$SSL_DIR/dovecot-openssl.cnf +SAMPLE_CONFIG_DIR=$PREFIX/share/examples/dovecot +SAMPLE_CONFIG_FILE=$SAMPLE_CONFIG_DIR/dovecot-example.conf +SAMPLE_SSL_FILE=$SAMPLE_CONFIG_DIR/dovecot-openssl.cnf +DOVECOTUSER=_dovecot +DOVECOTGROUP=_dovecot +ID=518 + +do_usergroup_install() +{ + # Create Opennap user and group + if groupinfo -e $DOVECOTGROUP; then + echo "===> Using $DOVECOTGROUP group for dovecot" + else + echo "===> Creating $DOVECOTGROUP group for dovecot" + groupadd -g $ID $DOVECOTGROUP + fi + if userinfo -e $DOVECOTUSER; then + echo "===> Using $DOVECOTUSER user for dovecot" + else + echo "===> Creating $DOVECOTUSER user for dovecot" + useradd -g $DOVECOTGROUP -d /nonexistent -L daemon -c 'Dovecot Account' -s /sbin/nologin -u $ID $DOVECOTUSER + fi +} + +do_config_notice() +{ + echo + echo "+---------------" + echo "| The existing $1 configuration file $CONFIG_FILE" + echo "| has NOT been changed. You may want to compare it to the" + echo "| current sample file $SAMPLE_CONFIG_FILE," + echo "| and update your configuration as needed." + echo "+---------------" +} + +do_ssl_notice() +{ + echo + echo "+---------------" + echo "| The existing $1 configuration file $SSL_FILE" + echo "| has NOT been changed. You may want to compare it to the" + echo "| current sample file $SAMPLE_SSL_FILE," + echo "| and update your configuration as needed." + echo "+---------------" + echo +} + +do_config_install() +{ + install -o root -g wheel -m 644 $SAMPLE_CONFIG_FILE $CONFIG_FILE + echo + echo "+---------------" + echo "| A $1 configuration file has been installed to:" + echo "| $CONFIG_FILE. Please view this file and" + echo "| adjust it to suit your needs." + echo "+---------------" +} + +do_ssl_install() +{ + install -o root -g wheel -m 644 $SAMPLE_SSL_FILE $SSL_FILE + echo + echo "+---------------" + echo "| Files to facilitate the generation of a self-signed" + echo "| certificate and key for Dovecot have been installed:" + echo "| $SSL_FILE (Edit this accordingly!)" + echo "| $PREFIX/sbin/dovecot-mkcert.sh" + echo "|" + echo "| If this has been or will be accomplished by other means," + echo "| use the following paths for the files:" + echo "| $SSL_DIR/dovecotcert.pem" + echo "| $SSL_DIR/private/dovecot.pem" + echo "+---------------" + echo +} + +# verify proper execution +# +if [ $# -ne 2 ]; then + echo "usage: $0 distname { PRE-INSTALL | POST-INSTALL }" >&2 + exit 1 +fi + +# Verify/process the command +# +case $2 in + PRE-INSTALL) + do_usergroup_install + ;; + POST-INSTALL) + if [ ! -f $CONFIG_FILE ]; then + do_config_install $1 + else + do_config_notice $1 + fi + if [ ! -f $SSL_FILE ]; then + do_ssl_install $1 + else + do_ssl_notice $1 + fi + ;; + *) + echo "usage: $0 distname { PRE-INSTALL | POST-INSTALL }" >&2 + exit 1 + ;; +esac + +exit 0 diff --git a/mail/dovecot/pkg/MESSAGE b/mail/dovecot/pkg/MESSAGE new file mode 100644 index 00000000000..56e9499c176 --- /dev/null +++ b/mail/dovecot/pkg/MESSAGE @@ -0,0 +1,7 @@ +If you wish to have Dovecot started automatically at boot time, +simply add the follow lines to /etc/rc.local: + +if [ -x ${PREFIX}/sbin/dovecot ]; then + echo -n ' dovecot'; ${PREFIX}/sbin/dovecot +fi + diff --git a/mail/dovecot/pkg/PLIST b/mail/dovecot/pkg/PLIST new file mode 100644 index 00000000000..d33672e4122 --- /dev/null +++ b/mail/dovecot/pkg/PLIST @@ -0,0 +1,20 @@ +@comment $OpenBSD: PLIST,v 1.1.1.1 2003/07/14 23:44:28 jolan Exp $ +libexec/dovecot/dovecot-auth +libexec/dovecot/imap +libexec/dovecot/imap-login +libexec/dovecot/pop3 +libexec/dovecot/pop3-login +sbin/dovecot +sbin/dovecot-mkcert.sh +share/doc/dovecot/auth.txt +share/doc/dovecot/configuration.txt +share/doc/dovecot/design.txt +share/doc/dovecot/index.txt +share/doc/dovecot/mail-storages.txt +share/doc/dovecot/multiaccess.txt +share/doc/dovecot/nfs.txt +share/examples/dovecot/dovecot-example.conf +share/examples/dovecot/dovecot-openssl.cnf +@dirrm share/examples/dovecot +@dirrm share/doc/dovecot +@dirrm libexec/dovecot