diff options
author | Max Kalika <max@gentoo.org> | 2003-09-18 18:23:30 +0000 |
---|---|---|
committer | Max Kalika <max@gentoo.org> | 2003-09-18 18:23:30 +0000 |
commit | a4dd364ce8882268b8fad8bbcdeed213ae992793 (patch) | |
tree | 3ca0640dca5f818c01b6a7284c5217f009b37980 /net-mail/cyrus-imspd | |
parent | Initial checkin. (diff) | |
download | historical-a4dd364ce8882268b8fad8bbcdeed213ae992793.tar.gz historical-a4dd364ce8882268b8fad8bbcdeed213ae992793.tar.bz2 historical-a4dd364ce8882268b8fad8bbcdeed213ae992793.zip |
Initial checkin.
Diffstat (limited to 'net-mail/cyrus-imspd')
-rw-r--r-- | net-mail/cyrus-imspd/Manifest | 17 | ||||
-rw-r--r-- | net-mail/cyrus-imspd/cyrus-imspd-1.7.ebuild | 84 | ||||
-rw-r--r-- | net-mail/cyrus-imspd/files/cyrus-imspd-db4.patch | 98 | ||||
-rw-r--r-- | net-mail/cyrus-imspd/files/cyrus-imspd-gentoo.patch | 154 | ||||
-rw-r--r-- | net-mail/cyrus-imspd/files/digest-cyrus-imspd-1.7 | 1 | ||||
-rw-r--r-- | net-mail/cyrus-imspd/files/gentestcrt.sh | 243 | ||||
-rw-r--r-- | net-mail/cyrus-imspd/files/imspd.conf | 6 | ||||
-rw-r--r-- | net-mail/cyrus-imspd/files/imspd.rc6 | 46 | ||||
-rw-r--r-- | net-mail/cyrus-imspd/files/stunnel.conf | 13 | ||||
-rw-r--r-- | net-mail/cyrus-imspd/metadata.xml | 5 |
10 files changed, 657 insertions, 10 deletions
diff --git a/net-mail/cyrus-imspd/Manifest b/net-mail/cyrus-imspd/Manifest index 35cde1391887..de0a93b3edaf 100644 --- a/net-mail/cyrus-imspd/Manifest +++ b/net-mail/cyrus-imspd/Manifest @@ -1,13 +1,10 @@ -MD5 2fb8472ca77abd5ecb72150010865089 cyrus-imspd-1.6_alpha3.ebuild 2445 -MD5 2fb8472ca77abd5ecb72150010865089 cyrus-imspd-1.7.ebuild 2445 -MD5 1d05f425dc7eb23ebfb0cf94ab324ba7 .cyrus-imspd-1.7.ebuild.swp 12288 -MD5 6c507c6ac8f1b8e4613b53b14ffa9b14 ChangeLog 1535 -MD5 daef9ba09e65d956d5850f26d0899b2c files/cyrus-imspd-db4.patch 3787 +MD5 ca1d3e5d88bda410f48b0134bc7f4ce9 cyrus-imspd-1.7.ebuild 2299 +MD5 15c4db9a19c9023900f5a1341f2e996f ChangeLog 1851 +MD5 5721b86fd871bdfab77231abc6e02f68 metadata.xml 161 +MD5 3c8013bd55f6ce72fda11e0b0a058221 files/cyrus-imspd-db4.patch 3786 MD5 aa6f51b5cf7fcffd8af00e26c81c2eed files/imspd.conf 156 -MD5 d6a2b7a0409bb41e919d0ea0ee8ab3f1 files/imspd.rc6 1032 -MD5 4285cc48835cd7ffe4b67e946e13ddbf files/cyrus-imspd-sasl2.patch 275125 -MD5 068e27102dcdf933be3c00f83b1b7146 files/cyrus-imspd-gentoo.patch 9408 -MD5 6f1fde348608b38d5e6c4a5e9c974b7f files/digest-cyrus-imspd-1.6_alpha3 70 -MD5 73a2af7bf09d98276e20bceb1df35b72 files/gentestcrt.sh 8790 +MD5 4abe3ce5da075b56135d9fb7060fc1e9 files/imspd.rc6 1149 +MD5 7d092edc1868ef27ebd61712f1be77ce files/cyrus-imspd-gentoo.patch 5092 +MD5 25ae448568ad4a44c37e27243ed5b3e6 files/gentestcrt.sh 8797 MD5 091bfd9602efd88a1f6411bf09203ffc files/digest-cyrus-imspd-1.7 68 MD5 9cc4403d49faa5913f7cafe219e0ce41 files/stunnel.conf 220 diff --git a/net-mail/cyrus-imspd/cyrus-imspd-1.7.ebuild b/net-mail/cyrus-imspd/cyrus-imspd-1.7.ebuild new file mode 100644 index 000000000000..b0d073212726 --- /dev/null +++ b/net-mail/cyrus-imspd/cyrus-imspd-1.7.ebuild @@ -0,0 +1,84 @@ +# Copyright 1999-2003 Gentoo Technologies, Inc. +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/net-mail/cyrus-imspd/cyrus-imspd-1.7.ebuild,v 1.1 2003/09/18 18:23:29 max Exp $ + +DESCRIPTION="Internet Message Support Protocol (IMSP) server." +HOMEPAGE="http://asg.web.cmu.edu/cyrus/" +SRC_URI="ftp://ftp.andrew.cmu.edu/pub/cyrus-mail/${PN}-v${PV}.tar.gz" + +LICENSE="as-is" +SLOT="0" +KEYWORDS="~x86" +IUSE="kerberos ldap ssl" + +DEPEND="virtual/glibc + >=sys-libs/db-3.2 + >=dev-libs/cyrus-sasl-2.1.3 + >=dev-libs/cyrus-imap-dev-2.1.14 + >=sys-apps/sed-4 + kerberos? ( virtual/krb5 ) + ldap? ( >=net-nds/openldap-2.0 ) + ssl? ( >=dev-libs/openssl-0.9.6 >=net-misc/stunnel-4.04 )" + +S="${WORKDIR}/${PN}-v${PV}" + +src_unpack() { + unpack ${A} && cd "${S}" + + epatch "${FILESDIR}/cyrus-imspd-gentoo.patch" + epatch "${FILESDIR}/cyrus-imspd-db4.patch" + + # cyrus 2.2.x has an extra library which things must link against + if [ -n "`best_version '=dev-libs/cyrus-imap-dev-2.2*'`" ] ; then + sed -e "s:-lcyrus:-lcyrus -lcyrus_min:" \ + -i "${S}/imsp/Makefile.in" \ + -i "${S}/cmulocal/libcyrus.m4" || die "sed failed" + fi + + # recreate configure. + ebegin "Recreating configure" + rm -f configure acconfig.h + sh SMakefile &>/dev/null || die "SMakefile failed" + eend $? +} + +src_compile() { + local myconf="`use_with ldap ldap=ldap`" + + if [ "`use kerberos`" ] ; then + myconf="${myconf} --with-auth=krb --enable-gssapi" + else + myconf="${myconf} --with-auth=unix --without-krb --disable-gssapi" + fi + + econf ${myconf} + make || die "compile problem" +} + +src_install() { + newsbin imsp/cyrus-imspd imspd + + exeinto /etc/init.d + newexe "${FILESDIR}/imspd.rc6" imspd + insinto /etc/conf.d + newins "${FILESDIR}/imspd.conf" imspd + + keepdir /var/imsp{,/user} + + if [ "`use ssl`" ] ; then + insinto /etc/stunnel + newins "${FILESDIR}/stunnel.conf" imspd.conf + + dosed "s:#IMSPD_USE_SSL:IMSPD_USE_SSL:" /etc/conf.d/imspd + + einfo "Generating self-signed test certificate." + (yes "" | "${FILESDIR}/gentestcrt.sh") &>/dev/null + (cat server.key && echo && cat server.crt) > server.pem + insinto /etc/ssl/imspd + doins server.{key,crt,pem} + fowners mail:root /etc/ssl/imspd/server.{key,crt,pem} + fperms 0400 /etc/ssl/imspd/server.{key,crt,pem} + fi + + dodoc README imsp/options.sample notes/* +} diff --git a/net-mail/cyrus-imspd/files/cyrus-imspd-db4.patch b/net-mail/cyrus-imspd/files/cyrus-imspd-db4.patch new file mode 100644 index 000000000000..aa414ef35949 --- /dev/null +++ b/net-mail/cyrus-imspd/files/cyrus-imspd-db4.patch @@ -0,0 +1,98 @@ +diff -urN cyrus-sasl-2.1.14/cmulocal/berkdb.m4 cyrus-sasl-2.1.14-modified/cmulocal/berkdb.m4 +--- cyrus-sasl-2.1.14/cmulocal/berkdb.m4 2003-04-15 17:25:41.000000000 -0500 ++++ cyrus-sasl-2.1.14-modified/cmulocal/berkdb.m4 2003-07-09 03:17:48.000000000 -0500 +@@ -211,12 +211,20 @@ + BDB_LIBADD="" + fi + +- for dbname in db-4.1 db4.1 db41 db-4.0 db4.0 db-4 db40 db4 db-3.3 db3.3 db33 db-3.2 db3.2 db32 db-3.1 db3.1 db31 db-3 db30 db3 db ++ for dbname in db-4.1 db4.1 db41 db-4.0 db4.0 db-4 db40 db4 db + do +- AC_CHECK_LIB($dbname, db_create, BDB_LIBADD="$BDB_LIBADD -l$dbname"; +- dblib="berkeley"; break, dblib="no") ++ AC_CHECK_LIB($dbname, db_create_4000, BDB_LIBADD="$BDB_LIBADD -l$dbname"; ++ dblib="berkeley"; break, AC_CHECK_LIB($dbname, db_create_4001, BDB_LIBADD="$BDB_LIBADD -l$dbname"; ++ dblib="berkeley"; break, dblib="no")) + done + if test "$dblib" = "no"; then ++ for dbname in db-4.1 db4.1 db41 db-4.0 db4.0 db-4 db40 db4 db-3.3 db3.3 db-3.2 db3.2 db-3.1 db3.1 db-3 db3 db ++ do ++ AC_CHECK_LIB($dbname, db_create, BDB_LIBADD="$BDB_LIBADD -l$dbname"; ++ dblib="berkeley"; break, dblib="no") ++ done ++ fi ++ if test "$dblib" = "no"; then + AC_CHECK_LIB(db, db_open, BDB_LIBADD="$BDB_LIBADD -ldb"; + dblib="berkeley"; dbname=db, + dblib="no") +diff -urN cyrus-sasl-2.1.14/cmulocal/sasl2.m4 cyrus-sasl-2.1.14-modified/cmulocal/sasl2.m4 +--- cyrus-sasl-2.1.14/cmulocal/sasl2.m4 2003-05-14 13:36:41.000000000 -0500 ++++ cyrus-sasl-2.1.14-modified/cmulocal/sasl2.m4 2003-07-09 03:18:31.000000000 -0500 +@@ -25,8 +25,9 @@ + dnl + dnl The choice is reflected in GSSAPIBASE_LIBS + dnl we might need libdb +- AC_CHECK_LIB(db, db_open) +- ++ AC_CHECK_LIB(db, db_open,, ++ AC_CHECK_LIB(db, db_open_4001,, ++ AC_CHECK_LIB(db, db_open_4000))) + gss_impl="no"; + AC_CHECK_LIB(resolv,res_search) + if test -d ${gssapi}; then +--- cyrus-sasl-2.1.14/configure.in 2003-04-15 17:25:41.000000000 -0500 ++++ cyrus-sasl-2.1.14-modified/configure.in 2003-07-09 03:17:48.000000000 -0500 +@@ -55,28 +55,34 @@ + CPPFLAGS="-I/usr/local/include ${CPPFLAGS}" + CMU_ADD_LIBPATH("/usr/local/lib") + +-dnl +-dnl Get ready to use DB +-dnl ++dnl Berkeley DB Detection ++ ++dnl support old-style ++AC_ARG_WITH(dbdir, ++ [ --with-dbdir=DIR Berkeley DB files are in prefix DIR], ++ with_bdb_lib="$withval/lib"; with_bdb_inc="$withval/include", ++ with_bdb_lib=none; with_bdb_inc=none) ++ ++CYRUS_BERKELEY_DB_CHK() ++ ++if test "$dblib" = "no"; then ++ AC_ERROR([this version requires Berkeley DB 3.x or later. ++(Get it from http://www.sleepycat.com/). You may need to suppply the ++--with-bdb-libdir or --with-bdb-incdir configure options.]) ++fi + +-AC_CHECK_FUNC(dbopen, [AC_DEFINE(HAVE_LIBDB) +- use_db=1], +- AC_CHECK_LIB(db,dbopen,[AC_DEFINE(HAVE_LIBDB) +- LIBS=" -ldb ${LIBS}" +- use_db=1])) +-dnl if db_185.h is present, we're using db2 or 3 and should include db_185.h +-dnl instead of db.h; otherwise, include db.h. this is handled in the code +-dnl itself. +-AC_CHECK_HEADER(db_185.h, [AC_DEFINE(HAVE_DB_185_H) +- AC_DEFINE(HAVE_LIBDB) +- LIBS="-ldb ${LIBS}" +- use_db=1]) +- +-if test -z "use_db"; then +- AC_CHECK_LIB(ndbm, dbm_open) +- AC_CHECK_LIB(dbm, dbm_open) ++if test "$with_bdb_lib" != "none"; then ++ CMU_ADD_LIBPATH($with_bdb_lib) + fi + ++BDB_INC=${BDB_INCADD} ++BDB_LIB=${BDB_LIBADD} ++AC_SUBST(BDB_INC) ++AC_SUBST(BDB_LIB) ++ ++LIBS="${LIBS} ${BDB_LIBADD}" ++CPPFLAGS="${BDB_INCADD} ${CPPFLAGS}" ++ + dnl + dnl Random other libraries + dnl diff --git a/net-mail/cyrus-imspd/files/cyrus-imspd-gentoo.patch b/net-mail/cyrus-imspd/files/cyrus-imspd-gentoo.patch new file mode 100644 index 000000000000..06b75bde8af5 --- /dev/null +++ b/net-mail/cyrus-imspd/files/cyrus-imspd-gentoo.patch @@ -0,0 +1,154 @@ +diff -ruN cyrus-imspd-v1.7-vanilla/Makefile.in cyrus-imspd-v1.7/Makefile.in +--- cyrus-imspd-v1.7-vanilla/Makefile.in 1997-10-28 19:12:07.000000000 -0800 ++++ cyrus-imspd-v1.7/Makefile.in 2003-09-10 13:24:02.000000000 -0700 +@@ -21,7 +21,7 @@ + # SOFTWARE. + # + +-SUBDIRS = lib imsp ++SUBDIRS = imsp + + srcdir = @srcdir@ + VPATH = @srcdir@ +diff -ruN cyrus-imspd-v1.7-vanilla/SMakefile cyrus-imspd-v1.7/SMakefile +--- cyrus-imspd-v1.7-vanilla/SMakefile 1969-12-31 16:00:00.000000000 -0800 ++++ cyrus-imspd-v1.7/SMakefile 2003-09-10 13:42:02.000000000 -0700 +@@ -0,0 +1,36 @@ ++# ++# This file is specific to Carnegie Mellon University's ++# software build process ++# ++ ++echo aclocal -I cmulocal ++aclocal -I cmulocal ++echo autoconf ++autoconf ++echo autoheader ++autoheader ++ ++CC=gcc ++WITHAUTH="--with-auth=krb_pts --with-krb=/usr/local --with-ldap=ldap" ++ ++LIBS="" ++case `uname` in ++ Linux) CFLAGS="-O3" ++ LIBS="-ldbm" ;; ++ SunOS) ++# CFLAGS="-xO4 -xdepend" ++ CC=gcc ++ CFLAGS="-g -O2" ++ ;; ++ *) CFLAGS=-g ;; ++esac ++export CFLAGS CC LIBS ++ ++ ++MFCOMMAND="./configure" ++ ++unset LD_LIBRARY_PATH ++ ++LNCOMMAND="${LNCOMMAND} ; ${SRCDIR}/configure $WITHAUTH" ++INSTCOMMAND="${MAKE} DESTDIR=${DESTDIR} prefix=${DESTDIR} exec_prefix=${DESTDIR} install" ++ +diff -ruN cyrus-imspd-v1.7-vanilla/imsp/Makefile.in cyrus-imspd-v1.7/imsp/Makefile.in +--- cyrus-imspd-v1.7-vanilla/imsp/Makefile.in 2000-12-17 19:37:53.000000000 -0800 ++++ cyrus-imspd-v1.7/imsp/Makefile.in 2003-09-10 13:25:06.000000000 -0700 +@@ -48,8 +48,8 @@ + + DEFS = @DEFS@ $(DEFINES) + CPPFLAGS = -I.. -I. -I$(srcdir) -I$(srcdir)/../lib @CPPFLAGS@ +-LIBS = @LIBS@ +-DEPLIBS = ../lib/libcyrus.a @DEPLIBS@ ++LIBS = @LIBS@ -L/usr/lib -lcyrus ++DEPLIBS = @DEPLIBS@ + + CFLAGS = @CFLAGS@ + LDFLAGS = @LDFLAGS@ +diff -ruN cyrus-imspd-v1.7-vanilla/imsp/abook.c cyrus-imspd-v1.7/imsp/abook.c +--- cyrus-imspd-v1.7-vanilla/imsp/abook.c 2000-12-17 17:47:03.000000000 -0800 ++++ cyrus-imspd-v1.7/imsp/abook.c 2003-09-10 13:27:47.000000000 -0700 +@@ -109,7 +109,7 @@ + + /* get the ACL */ + if (!acl && sdb_get(abooks, name, SDB_ICASE, &acl) < 0) return (0); +- if (acl) mask = acl_myrights(auth_get_state(id), acl); ++ if (acl) mask = cyrus_acl_myrights(auth_get_state(id), acl); + + /* check for administrator */ + if (auth_level(id) == AUTH_ADMIN) mask |= ACL_ALL; +@@ -699,7 +699,7 @@ + strcpy(tmpacl, "\t"); + tmpc = name[osrclen]; + name[osrclen] = '\0'; +- acl_set(&tmpacl, name, ACL_MODE_SET, ACL_ALL, NULL, NULL); ++ cyrus_acl_set(&tmpacl, name, ACL_MODE_SET, ACL_ALL, NULL, NULL); + name[osrclen] = tmpc; + } + value = tmpacl; +@@ -928,7 +928,7 @@ + strcpy(acl, "\t"); + tmpc = name[ownerlen]; + name[ownerlen] = '\0'; +- acl_set(&acl, name, ACL_MODE_SET, ACL_ALL, NULL, NULL); ++ cyrus_acl_set(&acl, name, ACL_MODE_SET, ACL_ALL, NULL, NULL); + name[ownerlen] = tmpc; + } + } else { +@@ -937,9 +937,9 @@ + } + /* update acl */ + if (acl +- && acl_set(&acl, ident, ACL_MODE_SET, +- rights ? acl_strtomask(rights) : 0L, +- NULL, NULL) == 0) { ++ && cyrus_acl_set(&acl, ident, ACL_MODE_SET, ++ rights ? cyrus_acl_strtomask(rights) : 0L, ++ NULL, NULL) == 0) { + if (sdb_set(abooks, name, SDB_ICASE, acl) == 0) { + result = AB_SUCCESS; + } +@@ -962,7 +962,7 @@ + char *name, *rights; + { + /* some more error checking might be in order... */ +- acl_masktostr(abook_rights(id, name, NULL), rights); ++ cyrus_acl_masktostr(abook_rights(id, name, NULL), rights); + + return (AB_SUCCESS); + } +diff -ruN cyrus-imspd-v1.7-vanilla/imsp/authize.c cyrus-imspd-v1.7/imsp/authize.c +--- cyrus-imspd-v1.7-vanilla/imsp/authize.c 2003-08-06 09:56:53.000000000 -0700 ++++ cyrus-imspd-v1.7/imsp/authize.c 2003-09-10 13:28:11.000000000 -0700 +@@ -122,7 +122,7 @@ + + /* Get an authentication state from the libcyrus "auth" module + * (not to be confused the the IMSP authize module in this file). +- * This is needed for acl_myrights(). ++ * This is needed for cyrus_acl_myrights(). + * Free id->state in case this isn't the first authentication this session. + */ + if (id->state) +diff -ruN cyrus-imspd-v1.7-vanilla/imsp/bb.c cyrus-imspd-v1.7/imsp/bb.c +--- cyrus-imspd-v1.7-vanilla/imsp/bb.c 2000-02-10 14:10:21.000000000 -0800 ++++ cyrus-imspd-v1.7/imsp/bb.c 2003-09-10 13:28:37.000000000 -0700 +@@ -385,7 +385,7 @@ + struct auth_state *id; + char *name, *acl; + { +- long rights = acl_myrights(id, acl); ++ long rights = cyrus_acl_myrights(id, acl); + char *user = auth_username(id); + int len = strlen(user); + +diff -ruN cyrus-imspd-v1.7-vanilla/imsp/imsp_server.c cyrus-imspd-v1.7/imsp/imsp_server.c +--- cyrus-imspd-v1.7-vanilla/imsp/imsp_server.c 2003-08-06 09:56:54.000000000 -0700 ++++ cyrus-imspd-v1.7/imsp/imsp_server.c 2003-09-10 13:30:25.000000000 -0700 +@@ -1272,7 +1272,7 @@ + defacl = malloc(strlen(user) + 32); + if (defacl) { + sprintf(acl = defacl, "%s\t%s\t", user, +- acl_masktostr(ACL_ALL, rbuf)); ++ cyrus_acl_masktostr(ACL_ALL, rbuf)); + } + } + } diff --git a/net-mail/cyrus-imspd/files/digest-cyrus-imspd-1.7 b/net-mail/cyrus-imspd/files/digest-cyrus-imspd-1.7 new file mode 100644 index 000000000000..7027025bfc13 --- /dev/null +++ b/net-mail/cyrus-imspd/files/digest-cyrus-imspd-1.7 @@ -0,0 +1 @@ +MD5 43374692dcbef7c30440818bb20759cb cyrus-imspd-v1.7.tar.gz 612076 diff --git a/net-mail/cyrus-imspd/files/gentestcrt.sh b/net-mail/cyrus-imspd/files/gentestcrt.sh new file mode 100644 index 000000000000..ef61fad3e4ec --- /dev/null +++ b/net-mail/cyrus-imspd/files/gentestcrt.sh @@ -0,0 +1,243 @@ +#!/bin/sh +## $Header: /var/cvsroot/gentoo-x86/net-mail/cyrus-imspd/files/gentestcrt.sh,v 1.1 2003/09/18 18:23:29 max Exp $ +## +## gentestcrt -- Create self-signed test certificate +## (C) 2001 Jean-Michel Dault <jmdault@mandrakesoft.com> and Mandrakesoft +## Based on cca.sh script by Ralf S. Engelschall +## + +# external tools +openssl="/usr/bin/openssl" + +# some optional terminal sequences +case $TERM in + xterm|xterm*|vt220|vt220*) + T_MD=`echo dummy | awk '{ printf("%c%c%c%c", 27, 91, 49, 109); }'` + T_ME=`echo dummy | awk '{ printf("%c%c%c", 27, 91, 109); }'` + ;; + vt100|vt100*) + T_MD=`echo dummy | awk '{ printf("%c%c%c%c%c%c", 27, 91, 49, 109, 0, 0); }'` + T_ME=`echo dummy | awk '{ printf("%c%c%c%c%c", 27, 91, 109, 0, 0); }'` + ;; + default) + T_MD='' + T_ME='' + ;; +esac + +# find some random files +# (do not use /dev/random here, because this device +# doesn't work as expected on all platforms) +randfiles='' +for file in /var/log/messages /var/adm/messages \ + /kernel /vmunix /vmlinuz \ + /etc/hosts /etc/resolv.conf; do + if [ -f $file ]; then + if [ ".$randfiles" = . ]; then + randfiles="$file" + else + randfiles="${randfiles}:$file" + fi + fi +done + + +echo "${T_MD}maketestcrt -- Create self-signed test certificate${T_ME}" +echo "(C) 2001 Jean-Michel Dault <jmdault@mandrakesoft.com> and Mandrakesoft" +echo "Based on cca.sh script by Ralf S. Engelschall" +echo "" + +grep -q -s DUMMY server.crt && mv server.crt server.crt.dummy +grep -q -s DUMMY server.key && mv server.key server.key.dummy + +echo "" +echo "" + +if [ ! -e ./server.crt -a ! -e ./server.key ];then + echo "Will create server.key and server.crt in `pwd`" +else + echo "server.key and server.crt already exist, dying" + exit +fi + +echo "" + + +mkdir -p /tmp/tmpssl-$$ +pushd /tmp/tmpssl-$$ > /dev/null + + + echo "${T_MD}INITIALIZATION${T_ME}" + + echo "" + echo "${T_MD}Generating custom Certificate Authority (CA)${T_ME}" + echo "______________________________________________________________________" + echo "" + echo "${T_MD}STEP 1: Generating RSA private key for CA (1024 bit)${T_ME}" + cp /dev/null ca.rnd + echo '01' >ca.ser + if [ ".$randfiles" != . ]; then + $openssl genrsa -rand $randfiles -out ca.key 1024 + else + $openssl genrsa -out ca.key 1024 + fi + if [ $? -ne 0 ]; then + echo "cca:Error: Failed to generate RSA private key" 1>&2 + exit 1 + fi + echo "______________________________________________________________________" + echo "" + echo "${T_MD}STEP 2: Generating X.509 certificate signing request for CA${T_ME}" + cat >.cfg <<EOT +[ req ] +default_bits = 1024 +distinguished_name = req_DN +RANDFILE = ca.rnd +[ req_DN ] +countryName = "1. Country Name (2 letter code)" +#countryName_default = CA +#countryName_min = 2 +countryName_max = 2 +stateOrProvinceName = "2. State or Province Name (full name) " +#stateOrProvinceName_default = "Quebec" +localityName = "3. Locality Name (eg, city) " +#localityName_default = "Montreal" +0.organizationName = "4. Organization Name (eg, company) " +0.organizationName_default = "Cyrus IMSP Server" +organizationalUnitName = "5. Organizational Unit Name (eg, section) " +organizationalUnitName_default = "For testing purposes only" +commonName = "6. Common Name (eg, CA name) " +commonName_max = 64 +commonName_default = "localhost" +emailAddress = "7. Email Address (eg, name@FQDN)" +emailAddress_max = 40 +#emailAddress_default = "root@localhost" +EOT + $openssl req -config .cfg -new -key ca.key -out ca.csr + if [ $? -ne 0 ]; then + echo "cca:Error: Failed to generate certificate signing request" 1>&2 + exit 1 + fi + echo "______________________________________________________________________" + echo "" + echo "${T_MD}STEP 3: Generating X.509 certificate for CA signed by itself${T_ME}" + cat >.cfg <<EOT +#extensions = x509v3 +#[ x509v3 ] +#subjectAltName = email:copy +#basicConstraints = CA:true,pathlen:0 +#nsComment = "CCA generated custom CA certificate" +#nsCertType = sslCA +EOT + $openssl x509 -extfile .cfg -req -days 365 -signkey ca.key -in ca.csr -out ca.crt + if [ $? -ne 0 ]; then + echo "cca:Error: Failed to generate self-signed CA certificate" 1>&2 + exit 1 + fi + echo "______________________________________________________________________" + echo "" + echo "${T_MD}RESULT:${T_ME}" + $openssl verify ca.crt + if [ $? -ne 0 ]; then + echo "cca:Error: Failed to verify resulting X.509 certificate" 1>&2 + exit 1 + fi + $openssl x509 -text -in ca.crt + $openssl rsa -text -in ca.key + + echo "${T_MD}CERTIFICATE GENERATION${T_ME}" + user="server" + + echo "" + echo "${T_MD}Generating custom USER${T_ME} [$user]" + echo "______________________________________________________________________" + echo "" + echo "${T_MD}STEP 5: Generating RSA private key for USER (1024 bit)${T_ME}" + if [ ".$randfiles" != . ]; then + $openssl genrsa -rand $randfiles -out $user.key 1024 + else + $openssl genrsa -out $user.key 1024 + fi + if [ $? -ne 0 ]; then + echo "cca:Error: Failed to generate RSA private key" 1>&2 + exit 1 + fi + echo "______________________________________________________________________" + echo "" + echo "${T_MD}STEP 6: Generating X.509 certificate signing request for USER${T_ME}" + cat >.cfg <<EOT +[ req ] +default_bits = 1024 +distinguished_name = req_DN +RANDFILE = ca.rnd +[ req_DN ] +countryName = "1. Country Name (2 letter code)" +#countryName_default = XY +#countryName_min = 2 +countryName_max = 2 +stateOrProvinceName = "2. State or Province Name (full name) " +#stateOrProvinceName_default = "Unknown" +localityName = "3. Locality Name (eg, city) " +#localityName_default = "Server Room" +0.organizationName = "4. Organization Name (eg, company) " +0.organizationName_default = "Cyrus IMSP Server" +organizationalUnitName = "5. Organizational Unit Name (eg, section) " +organizationalUnitName_default = "Test Certificate" +commonName = "6. Common Name (eg, DOMAIN NAME) " +commonName_max = 64 +commonName_default = "localhost" +emailAddress = "7. Email Address (eg, name@fqdn)" +emailAddress_max = 40 +#emailAddress_default = "root@localhost" +EOT + $openssl req -config .cfg -new -key $user.key -out $user.csr + if [ $? -ne 0 ]; then + echo "cca:Error: Failed to generate certificate signing request" 1>&2 + exit 1 + fi + rm -f .cfg + echo "______________________________________________________________________" + echo "" + echo "${T_MD}STEP 7: Generating X.509 certificate signed by own CA${T_ME}" + cat >.cfg <<EOT +#extensions = x509v3 +#[ x509v3 ] +#subjectAltName = email:copy +#basicConstraints = CA:false,pathlen:0 +#nsComment = "CCA generated client certificate" +#nsCertType = client +EOT + $openssl x509 -extfile .cfg -days 365 -CAserial ca.ser -CA ca.crt -CAkey ca.key -in $user.csr -req -out $user.crt + if [ $? -ne 0 ]; then + echo "cca:Error: Failed to generate X.509 certificate" 1>&2 + exit 1 + fi + caname="`$openssl x509 -noout -text -in ca.crt |\ + grep Subject: | sed -e 's;.*CN=;;' -e 's;/Em.*;;'`" + username="`$openssl x509 -noout -text -in $user.crt |\ + grep Subject: | sed -e 's;.*CN=;;' -e 's;/Em.*;;'`" +# echo "Assembling PKCS#12 package" +# $openssl pkcs12 -export -in $user.crt -inkey $user.key -certfile ca.crt -name "$username" -caname "$caname" -out $user.p12 + echo "______________________________________________________________________" + echo "" + echo "${T_MD}RESULT:${T_ME}" + $openssl verify -CAfile ca.crt $user.crt + if [ $? -ne 0 ]; then + echo "cca:Error: Failed to verify resulting X.509 certificate" 1>&2 + exit 1 + fi + $openssl x509 -text -in $user.crt + $openssl rsa -text -in $user.key + + +popd >/dev/null + + +rm -f /tmp/tmpssl-$$/*.csr +rm -f /tmp/tmpssl-$$/ca.* +chmod 400 /tmp/tmpssl-$$/* + +echo "Certificate creation done!" +cp /tmp/tmpssl-$$/server.* . + +rm -rf /tmp/tmpssl-$$ diff --git a/net-mail/cyrus-imspd/files/imspd.conf b/net-mail/cyrus-imspd/files/imspd.conf new file mode 100644 index 000000000000..d173cdb224ce --- /dev/null +++ b/net-mail/cyrus-imspd/files/imspd.conf @@ -0,0 +1,6 @@ +# Specify whether or not to start an SSL tunnel. +# +# to use this, cyrus-imspd must have been installed +# with the ssl USE flag enabled. + +#IMSPD_USE_SSL=yes diff --git a/net-mail/cyrus-imspd/files/imspd.rc6 b/net-mail/cyrus-imspd/files/imspd.rc6 new file mode 100644 index 000000000000..77cd241a42d2 --- /dev/null +++ b/net-mail/cyrus-imspd/files/imspd.rc6 @@ -0,0 +1,46 @@ +#!/sbin/runscript +# Copyright 1999-2003 Gentoo Technologies, Inc. +# Distributed under the terms of the GNU General Public License, v2 or later +# $Header: /var/cvsroot/gentoo-x86/net-mail/cyrus-imspd/files/imspd.rc6,v 1.1 2003/09/18 18:23:29 max Exp $ + +depend() { + need net + use dns logger + after saslauthd +} + +use_ssl() { + if [ "${IMSPD_USE_SSL}" = "yes" -a -x /usr/sbin/stunnel -a -f /etc/stunnel/imspd.conf ] ; then + echo "yes" + return 0 + fi + + return 1 +} + +start() { + ebegin "Starting cyrus imspd" + start-stop-daemon --start --quiet --background --make-pidfile \ + --pidfile /var/run/imspd.pid --exec /usr/sbin/imspd + eend $? + + if [ -n "`use_ssl`" ] ; then + ebegin "Starting cyrus imspd ssl tunnel" + start-stop-daemon --start --quiet --exec /usr/sbin/stunnel \ + -- /etc/stunnel/imspd.conf + eend $? + fi +} + +stop() { + if [ -n "`use_ssl`" ] ; then + ebegin "Stopping cyrus imspd ssl tunnel" + start-stop-daemon --stop --quiet \ + --pidfile /var/run/stunnel.imspd.pid + eend $? + fi + + ebegin "Stopping cyrus imspd" + start-stop-daemon --stop --quiet --pidfile /var/run/imspd.pid + eend $? +} diff --git a/net-mail/cyrus-imspd/files/stunnel.conf b/net-mail/cyrus-imspd/files/stunnel.conf new file mode 100644 index 000000000000..26c05f70c29d --- /dev/null +++ b/net-mail/cyrus-imspd/files/stunnel.conf @@ -0,0 +1,13 @@ +# the service name +service = imspd + +# location of pid file +pid = /var/run/stunnel.imspd.pid + +# location of certification file +cert = /etc/ssl/imspd/server.pem + +# service configuration +[imspd] +accept = 906 +connect = 406 diff --git a/net-mail/cyrus-imspd/metadata.xml b/net-mail/cyrus-imspd/metadata.xml new file mode 100644 index 000000000000..51f94e3fbe0e --- /dev/null +++ b/net-mail/cyrus-imspd/metadata.xml @@ -0,0 +1,5 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd"> +<pkgmetadata> +<herd>net-mail</herd> +</pkgmetadata> |