OpenPKG CVS Repository http://cvs.openpkg.org/ ____________________________________________________________________________
Server: cvs.openpkg.org Name: Ralf S. Engelschall Root: /v/openpkg/cvs Email: [EMAIL PROTECTED] Module: openpkg-src Date: 24-Nov-2006 21:49:24 Branch: HEAD Handle: 2006112420492400 Added files: openpkg-src/dbmail dbmail-setup.sh dbmail.patch dbmail.spec fsl.dbmail rc.dbmail Log: new package: dbmail 2.2.1 (Fast Scalable RDBMS Mail Server) Summary: Revision Changes Path 1.1 +71 -0 openpkg-src/dbmail/dbmail-setup.sh 1.1 +19 -0 openpkg-src/dbmail/dbmail.patch 1.1 +304 -0 openpkg-src/dbmail/dbmail.spec 1.1 +112 -0 openpkg-src/dbmail/fsl.dbmail 1.1 +100 -0 openpkg-src/dbmail/rc.dbmail ____________________________________________________________________________ patch -p0 <<'@@ .' Index: openpkg-src/dbmail/dbmail-setup.sh ============================================================================ $ cvs diff -u -r0 -r1.1 dbmail-setup.sh --- /dev/null 2006-11-24 21:47:46 +0100 +++ dbmail-setup.sh 2006-11-24 21:49:24 +0100 @@ -0,0 +1,71 @@ +#!/bin/sh +## +## dbmail-setup.sh -- Sympa RDBMS Setup Utility +## + +# package configuration +db_type="@db_type@" +db_script="@l_prefix@/share/dbmail/dbmail-setup.sql" + +# determine database details +db_dir="@l_prefix@/var/dbmail/db" +db_name=`grep "^db" @l_prefix@/etc/dbmail/dbmail.conf | sed -e 's;^[^=]*= *;;'` +db_user=`grep "^user" @l_prefix@/etc/dbmail/dbmail.conf | sed -e 's;^[^=]*= *;;'` +db_pass=`grep "^pass" @l_prefix@/etc/dbmail/dbmail.conf | sed -e 's;^[^=]*= *;;'` + +# determine RDBMS-specific details +if [ ".$db_type" = .sqlite ]; then + db_suser="@l_rusr@" + db_spass="@l_rgrp@" +elif [ ".$db_type" = .mysql ]; then + db_suser=`grep "^user" @l_prefix@/etc/mysql/my.pwd |\ + sed -e 's;^user[^=]*= *;;' -e 's; *$;;'` + db_spass=`grep "^password" @l_prefix@/etc/mysql/my.pwd |\ + sed -e 's;^password[^=]*= *;;' -e 's; *$;;'` +elif [ ".$db_type" = .pgsql ]; then + db_suser="postgresql" + db_spass="" # has to be interactive +fi + +# dispatch operation +cmd="${1:-"install"}" +case "$cmd" in + install ) + # create the DBMail database + if [ ".$db_type" = .sqlite ]; then + ( umask 077 + @l_prefix@/bin/sqlite3 $db_name <$db_script + chown $db_suser:$db_spass $db_name + chmod 640 $db_name + ) || exit $? + elif [ ".$db_type" = .mysql ]; then + # FIXME: MySQL doesn't allow easy relocation of tablespaces AFAIK --rse + @l_prefix@/bin/mysqladmin --user="$db_suser" --password="$db_spass" create "$db_name" + ( echo "GRANT ALL ON $db_name.* TO [EMAIL PROTECTED] IDENTIFIED BY '$db_pass';" + echo "FLUSH PRIVILEGES;" + ) | @l_prefix@/bin/mysql --user="$db_suser" --password="$db_spass" mysql + @l_prefix@/bin/mysql --user="$db_suser" --password="$db_spass" "$db_name" <$db_script + elif [ ".$db_type" = .pgsql ]; then + ( echo "CREATE ROLE $db_user LOGIN ENCRYPTED PASSWORD '$db_pass' NOCREATEDB NOCREATEUSER;" + echo "CREATE TABLESPACE $db_name OWNER $db_user LOCATION '$db_dir';" + echo "CREATE DATABASE $db_name OWNER $db_user TABLESPACE $db_name;" + ) | @l_prefix@/bin/psql -U "$db_suser" -d template1 -f- + @l_prefix@/bin/psql -U "$db_suser" -d "$db_name" -f- <$db_script + fi + ;; + uninstall ) + # remove the DBMail database + if [ ".$db_type" = .sqlite ]; then + rm -f $db_name >/dev/null 2>&1 || true + elif [ ".$db_type" = .mysql ]; then + ( echo "DROP DATABASE $db_name;" + ) | @l_prefix@/bin/mysql --user="$db_suser" --password="$db_spass" mysql + elif [ ".$db_type" = .pgsql ]; then + ( echo "DROP DATABASE $db_name;" + echo "DROP TABLESPACE $db_name;" + echo "DROP ROLE $db_user;" + ) | @l_prefix@/bin/psql -U "$db_suser" -d template1 -f- + fi + ;; +esac + @@ . patch -p0 <<'@@ .' Index: openpkg-src/dbmail/dbmail.patch ============================================================================ $ cvs diff -u -r0 -r1.1 dbmail.patch --- /dev/null 2006-11-24 21:47:46 +0100 +++ dbmail.patch 2006-11-24 21:49:24 +0100 @@ -0,0 +1,19 @@ +Index: configure +--- configure.orig 2006-11-18 14:36:23 +0100 ++++ configure 2006-11-24 20:08:37 +0100 +@@ -2097,13 +2097,13 @@ + else + DM_LOGDIR="$logdirname" + fi +- if test "x$localstatedir" = 'x${prefix}/var' ++ if false + then + DM_STATEDIR='/var/run' + else + DM_STATEDIR=$localstatedir + fi +- if test "x$sysconfdir" = 'x${prefix}/etc' ++ if false + then + DM_CONFDIR='/etc' + else @@ . patch -p0 <<'@@ .' Index: openpkg-src/dbmail/dbmail.spec ============================================================================ $ cvs diff -u -r0 -r1.1 dbmail.spec --- /dev/null 2006-11-24 21:47:46 +0100 +++ dbmail.spec 2006-11-24 21:49:24 +0100 @@ -0,0 +1,304 @@ +## +## dbmail.spec -- OpenPKG RPM Package Specification +## Copyright (c) 2000-2006 OpenPKG Foundation e.V. <http://openpkg.net/> +## Copyright (c) 2000-2006 Ralf S. Engelschall <http://engelschall.com/> +## +## Permission to use, copy, modify, and distribute this software for +## any purpose with or without fee is hereby granted, provided that +## the above copyright notice and this permission notice appear in all +## copies. +## +## THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED +## WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +## MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +## IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR +## CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +## SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +## LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF +## USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +## ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +## OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT +## OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +## SUCH DAMAGE. +## + +# package component versions +%define V_major 2.2 +%define V_minor 1 + +# package information +Name: dbmail +Summary: Fast Scalable RDBMS Mail Server +URL: http://www.dbmail.org/ +Vendor: IC&S +Packager: OpenPKG Foundation e.V. +Distribution: OpenPKG Community +Class: EVAL +Group: Mail +License: GPL +Version: %{V_major}.%{V_minor} +Release: 20061124 + +# package options +%option with_fsl yes +%option with_sieve yes +%option with_sqlite yes +%option with_mysql no +%option with_pgsql no +%option with_ldap no + +# checking for option conflicts +%if "%{with_sqlite}" == "no" && "%{with_mysql}" == "no" && "%{with_pgsql}" == "no" + %{error:one of the build-time options 'with_sqlite', 'with_mysql' or 'with_pgsql' have to be enabled} +%endif + +# list of sources +Source0: http://www.dbmail.org/download/%{V_major}/dbmail-%{V_major}.%{V_minor}.tar.gz +Source1: fsl.dbmail +Source2: rc.dbmail +Source3: dbmail-setup.sh +Patch0: dbmail.patch + +# build information +Prefix: %{l_prefix} +BuildRoot: %{l_buildroot} +BuildPreReq: OpenPKG, openpkg >= 20040130, make, gcc, pkgconfig +PreReq: OpenPKG, openpkg >= 20040130, MTA +BuildPreReq: libiconv, gettext, gc, glib2, gmime +PreReq: libiconv, gettext, gc, glib2, gmime +%if "%{with_fsl}" == "yes" +BuildPreReq: fsl >= 1.6.0 +PreReq: fsl >= 1.6.0 +%endif +%if "%{with_sieve}" == "yes" +BuildPreReq: libsieve >= 2.2 +PreReq: libsieve >= 2.2 +%endif +%if "%{with_sqlite}" == "yes" +BuildPreReq: sqlite +PreReq: sqlite +%endif +%if "%{with_mysql}" == "yes" +BuildPreReq: mysql, mysql::with_innobase = yes, zlib +PreReq: mysql, mysql::with_innobase = yes, zlib +%endif +%if "%{with_pgsql}" == "yes" +BuildPreReq: postgresql, openssl +PreReq: postgresql, openssl +%endif +%if "%{with_ldap}" == "yes" +BuildPreReq: openldap, openssl +PreReq: openldap, openssl +%endif +AutoReq: no +AutoReqProv: no + +%description + DBMail is a collection of programs that enables Email to be + stored in and retrieved from a RDBMS. Currently SQLite, MySQL and + PostgreSQL can be used as the RDBMS db. Advantages of dbmail + are in the areas of scalability, manageability, speed, security and + flexibility. + +%track + prog dbmail = { + version = %{version} + url = http://www.dbmail.org/index.php?page=download + regex = dbmail-(\d+\.[02468](?:\.\d+)+)\.tar\.gz + } + +%prep + %setup -q + %patch -p0 + +%build + export CC="%{l_cc}" + export CFLAGS="%{l_cflags -O}" + export CPPFLAGS="%{l_cppflags}" + export LDFLAGS="%{l_ldflags} %{l_fsl_ldflags}" + export LIBS="%{l_fsl_libs}" +%if "%{with_ldap}" == "yes" + LIBS="$LIBS -llber -lssl -lcrypto" +%endif + ./configure \ + --prefix=%{l_prefix} \ + --sysconfdir=%{l_prefix}/etc/dbmail \ + --localstatedir=%{l_prefix}/var/dbmail/run \ + --with-logdir=%{l_prefix}/var/dbmail/log \ + --with-gc=%{l_prefix} \ +%if "%{with_sieve}" == "yes" + --with-sieve=%{l_prefix}/include \ +%endif +%if "%{with_sqlite}" == "yes" + --with-sqlite \ +%else + --without-sqlite \ +%endif +%if "%{with_mysql}" == "yes" + --with-mysql \ +%else + --without-mysql \ +%endif +%if "%{with_pgsql}" == "yes" + --with-pgsql \ +%else + --without-pgsql \ +%endif +%if "%{with_ldap}" == "yes" + --with-auth-ldap=%{l_prefix}/include \ +%else + --without-auth-ldap \ +%endif + --disable-shared + %{l_make} %{l_mflags -O} + +%install + rm -rf $RPM_BUILD_ROOT + + # install DBMail + %{l_make} %{l_mflags} install AM_MAKEFLAGS="DESTDIR=$RPM_BUILD_ROOT" + + # create additional directories + %{l_shtool} mkdir -f -p -m 755 \ + $RPM_BUILD_ROOT%{l_prefix}/etc/dbmail \ + $RPM_BUILD_ROOT%{l_prefix}/libexec/dbmail \ + $RPM_BUILD_ROOT%{l_prefix}/var/dbmail/db \ + $RPM_BUILD_ROOT%{l_prefix}/var/dbmail/log \ + $RPM_BUILD_ROOT%{l_prefix}/var/dbmail/run + + # wrap executables for DSO run-time environment + for i in dbmail-export dbmail-imapd dbmail-lmtpd dbmail-pop3d \ + dbmail-sievecmd dbmail-smtp dbmail-timsieved dbmail-users dbmail-util; do + mv $RPM_BUILD_ROOT%{l_prefix}/sbin/$i \ + $RPM_BUILD_ROOT%{l_prefix}/libexec/dbmail/$i + strip $RPM_BUILD_ROOT%{l_prefix}/libexec/dbmail/$i >/dev/null 2>&1 || true + ( echo "#!/bin/sh" + echo "LD_LIBRARY_PATH='%{l_prefix}/lib/dbmail:/usr/lib:/lib'" + echo "export LD_LIBRARY_PATH" + echo "exec %{l_prefix}/libexec/dbmail/$i \${1+\"[EMAIL PROTECTED]"}" + ) >$RPM_BUILD_ROOT%{l_prefix}/sbin/$i + chmod 755 $RPM_BUILD_ROOT%{l_prefix}/sbin/$i + done + + # install run-command script + %{l_shtool} mkdir -f -p -m 755 \ + $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d + %{l_shtool} install -c -m 755 %{l_value -s -a} \ + %{SOURCE rc.dbmail} $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d/ + + # install OSSP fsl configuration + %{l_shtool} mkdir -f -p -m 755 \ + $RPM_BUILD_ROOT%{l_prefix}/etc/fsl + %{l_shtool} install -c -m 644 %{l_value -s -a} \ + %{SOURCE fsl.dbmail} \ + $RPM_BUILD_ROOT%{l_prefix}/etc/fsl/ + + # install database setup stuff +%if "%{with_sqlite}" == "yes" + db_type='sqlite' + db_script='sql/sqlite/create_tables.sqlite' +%endif +%if "%{with_mysql}" == "yes" + db_type='mysql' + db_script='sql/mysql/create_tables.mysql' +%endif +%if "%{with_pgsql}" == "yes" + db_type='pgsql' + db_script='sql/postgresql/create_tables.pgsql' +%endif + %{l_shtool} mkdir -f -p -m 755 \ + $RPM_BUILD_ROOT%{l_prefix}/share/dbmail + %{l_shtool} install -c -m 644 \ + $db_script $RPM_BUILD_ROOT%{l_prefix}/share/dbmail/dbmail-setup.sql + %{l_shtool} install -c -m 755 %{l_value -s -a} \ + -e "s;@db_type@;$db_type;g" \ + %{SOURCE dbmail-setup.sh} $RPM_BUILD_ROOT%{l_prefix}/sbin/dbmail-setup + + # install default configuration file + %{l_shtool} install%{l_nil} -c -m 600 %{l_value -s -a} \ + -e "s;^\\(driver[^=]*=\\).*$;\\1 $db_type;" \ +%if "%{with_ldap}" == "yes" + -e 's;^\(authdriver[^=]*=\).*$;\1 ldap;' \ +%else + -e 's;^\(authdriver[^=]*=\).*$;\1 sql;' \ +%endif +%if "%{with_sqlite}" == "yes" + -e 's;^\(user[^=]*=\).*$;\1 %{l_rusr};' \ + -e 's;^\(pass[^=]*=\).*$;\1 %{l_rgrp};' \ + -e 's;^\(db[^=]*=\).*$;\1 %{l_prefix}/var/dbmail/db/dbmail.db;' \ +%else + -e 's;^\(user[^=]*=\).*$;\1 dbmail;' \ + -e 's;^\(pass[^=]*=\).*$;\1 dbmail;' \ + -e 's;^\(db[^=]*=\).*$;\1;' \ +%endif + -e 's;^\(sendmail[^=]*=\).*$;\1 %{l_prefix}/sbin/sendmail;' \ + -e 's;^\(EFFECTIVE_USER[^=]*=\).*$;\1 %{l_rusr};' \ + -e 's;^\(EFFECTIVE_GROUP[^=]*=\).*$;\1 %{l_rgrp};' \ + -e 's;^\(BINDIP[^=]*=\).*$;\1 127.0.0.1;' \ + -e 's;^\(RESOLVE_IP[^=]*=\).*$;\1 no;' \ + -e 's;^\(logfile[^=]*=\).*$;\1 %{l_prefix}/var/dbmail/log/dbmail.log;' \ + -e 's;^\(errorlog[^=]*=\).*$;\1 %{l_prefix}/var/dbmail/log/dbmail.log;' \ + -e 's;^\(pid_directory[^=]*=\).*$;\1 %{l_prefix}/var/dbmail/run;' \ + -e 's;^\(state_directory[^=]*=\).*$;\1 %{l_prefix}/var/dbmail/run;' \ + -e 's;dc=mydomain;dc=example;g' \ + dbmail.conf $RPM_BUILD_ROOT%{l_prefix}/etc/dbmail/ + + # install additional setup documentation + %{l_shtool} install%{l_nil} -c -m 644 \ +%if "%{with_sieve}" == "yes" + README.sieve \ +%endif + README.{aliases,exim,postfix,sieve,smtp,usermap} \ + $RPM_BUILD_ROOT%{l_prefix}/share/dbmail/ + + # determine installation files + %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT %{l_files_std} \ + '%config %attr(0640,%{l_musr},%{l_rgrp}) %{l_prefix}/etc/dbmail/*' \ + '%not %dir %{l_prefix}/etc/fsl' \ + '%config %{l_prefix}/etc/fsl/fsl.dbmail' \ + '%doc %{l_prefix}/share/dbmail/README.*' \ + '%dir %attr(0770,%{l_musr},%{l_rgrp}) %{l_prefix}/var/dbmail' \ + '%dir %attr(0770,%{l_musr},%{l_rgrp}) %{l_prefix}/var/dbmail/*' + +%files -f files + +%clean + rm -rf $RPM_BUILD_ROOT + +%post + if [ $1 -eq 1 ]; then + # display final hints on initial installation + ( echo "To complete this installation of DBMail," +%if "%{with_mysql}" == "yes" + echo "after starting your MySQL RDBMS with" + echo " \$ $RPM_INSTALL_PREFIX/etc/rc mysql start" +%endif +%if "%{with_pgsql}" == "yes" + echo "after starting your PostgreSQL RDBMS with" + echo " \$ $RPM_INSTALL_PREFIX/etc/rc postgresql start" +%endif + echo "please establish the initial DBMail database with:" + echo " \$ $RPM_INSTALL_PREFIX/sbin/dbmail-setup" + echo "Then hook DBMail into your particular MTA manually" + echo "and add each of your users to DBMail with the commands:" + echo " \$ $RPM_INSTALL_PREFIX/sbin/dbmail-users -a <username> -w <password>" + echo " \$ $RPM_INSTALL_PREFIX/sbin/dbmail-users -c <username> -s <user>@<domain>" + ) | %{l_rpmtool} msg -b -t notice + elif [ $1 -eq 2 ]; then + # after upgrade, restart service + [ $1 -eq 2 ] || exit 0 + eval `%{l_rc} dbmail status 2>/dev/null` + [ ".$dbmail_active" = .yes ] && %{l_rc} dbmail restart + fi + exit 0 + +%preun + if [ $1 -eq 0 ]; then + # before erase, stop service and remove log files + [ $1 -eq 0 ] || exit 0 + %{l_rc} dbmail stop 2>/dev/null + rm -f $RPM_INSTALL_PREFIX/var/dbmail/run/* >/dev/null 2>&1 || true + rm -f $RPM_INSTALL_PREFIX/var/dbmail/log/* >/dev/null 2>&1 || true + fi + exit 0 + @@ . patch -p0 <<'@@ .' Index: openpkg-src/dbmail/fsl.dbmail ============================================================================ $ cvs diff -u -r0 -r1.1 fsl.dbmail --- /dev/null 2006-11-24 21:47:46 +0100 +++ fsl.dbmail 2006-11-24 21:49:24 +0100 @@ -0,0 +1,112 @@ +## +## fsl.dbmail -- OSSP fsl configuration +## + +ident (dbmail/imap4d)/.+ q{ + prefix( + prefix="%b %d %H:%M:%S %N <%L> $1[%P]: " + ) + -> { + debug: file( + path="@l_prefix@/var/dbmail/log/dbmail-imapd.log", + perm=0600 + ) + } +}; + +ident (dbmail/lmtpd)/.+ q{ + prefix( + prefix="%b %d %H:%M:%S %N <%L> $1[%P]: " + ) + -> { + debug: file( + path="@l_prefix@/var/dbmail/log/dbmail-lmtpd.log", + perm=0600 + ) + } +}; + +ident (dbmail/smtp)/.+ q{ + prefix( + prefix="%b %d %H:%M:%S %N <%L> $1[%P]: " + ) + -> { + debug: file( + path="@l_prefix@/var/dbmail/log/dbmail-smtp.log", + perm=0600 + ) + } +}; + +ident (dbmail/maintenance)/.+ q{ + prefix( + prefix="%b %d %H:%M:%S %N <%L> $1[%P]: " + ) + -> { + debug: file( + path="@l_prefix@/var/dbmail/log/dbmail-maint.log", + perm=0600 + ) + } +}; + +ident (dbmail/pop3d)/.+ q{ + prefix( + prefix="%b %d %H:%M:%S %N <%L> $1[%P]: " + ) + -> { + debug: file( + path="@l_prefix@/var/dbmail/log/dbmail-pop3d.log", + perm=0600 + ) + } +}; + +ident (dbmail/sievecmd)/.+ q{ + prefix( + prefix="%b %d %H:%M:%S %N <%L> $1[%P]: " + ) + -> { + debug: file( + path="@l_prefix@/var/dbmail/log/dbmail-sievecmd.log", + perm=0600 + ) + } +}; + +ident (dbmail/timsieved)/.+ q{ + prefix( + prefix="%b %d %H:%M:%S %N <%L> $1[%P]: " + ) + -> { + debug: file( + path="@l_prefix@/var/dbmail/log/dbmail-timsieved.log", + perm=0600 + ) + } +}; + +ident (dbmail/adduser)/.+ q{ + prefix( + prefix="%b %d %H:%M:%S %N <%L> $1[%P]: " + ) + -> { + debug: file( + path="@l_prefix@/var/dbmail/log/dbmail-adduser.log", + perm=0600 + ) + } +}; + +ident (dbmail/.+)/.+ q{ + prefix( + prefix="%b %d %H:%M:%S %N <%L> $1[%P]: " + ) + -> { + debug: file( + path="@l_prefix@/var/dbmail/log/dbmail-misc.log", + perm=0600 + ) + } +}; + @@ . patch -p0 <<'@@ .' Index: openpkg-src/dbmail/rc.dbmail ============================================================================ $ cvs diff -u -r0 -r1.1 rc.dbmail --- /dev/null 2006-11-24 21:47:46 +0100 +++ rc.dbmail 2006-11-24 21:49:24 +0100 @@ -0,0 +1,100 @@ [EMAIL PROTECTED]@/bin/openpkg rc +## +## rc.dbmail -- Run-Commands +## + +%config + dbmail_enable="$openpkg_rc_def" + dbmail_protocols="imap lmtp pop3 timsieve" + dbmail_flags_imapd="" + dbmail_flags_lmtpd="" + dbmail_flags_pop3d="" + dbmail_flags_timsieved="" + dbmail_log_prolog="true" + dbmail_log_epilog="true" + dbmail_log_numfiles="10" + dbmail_log_minsize="1M" + dbmail_log_complevel="9" + dbmail_log_tags="imapd lmtpd smtp maint pop3d sievecmd timsieved adduser misc" + +%common + dbmail_logdir="@l_prefix@/var/dbmail/log" + dbmail_pidfile_imapd="@l_prefix@/var/dbmail/run/dbmail-imapd.pid" + dbmail_pidfile_lmtpd="@l_prefix@/var/dbmail/run/dbmail-lmtpd.pid" + dbmail_pidfile_pop3d="@l_prefix@/var/dbmail/run/dbmail-pop3d.pid" + dbmail_pidfile_timsieved="@l_prefix@/var/dbmail/run/dbmail-timsieved.pid" + dbmail_signal () { + [ -f $dbmail_pidfile_imapd ] \ + && kill -$1 `cat $dbmail_pidfile_imapd` + local rc_dbmail_imapd=$? + [ -f $dbmail_pidfile_lmtpd ] \ + && kill -$1 `cat $dbmail_pidfile_lmtpd` + local rc_dbmail_lmtpd=$? + [ -f $dbmail_pidfile_pop3d ] \ + && kill -$1 `cat $dbmail_pidfile_pop3d` + local rc_dbmail_pop3d=$? + [ -f $dbmail_pidfile_timsieved ] \ + && kill -$1 `cat $dbmail_pidfile_timsieved` + local rc_dbmail_timsieved=$? + [ $rc_dbmail_imapd -eq 0 -o \ + $rc_dbmail_lmtpd -eq 0 -o \ + $rc_dbmail_pop3d -eq 0 -o \ + $rc_dbmail_timsieved -eq 0 ] + } + +%status -u @l_susr@ -o + dbmail_usable="unknown" + dbmail_active="no" + rcService dbmail enable yes && \ + dbmail_enable="yes" + rcService dbmail enable yes && \ + dbmail_signal 0 && dbmail_active="yes" + echo "dbmail_enable=\"$dbmail_enable\"" + echo "dbmail_usable=\"$dbmail_usable\"" + echo "dbmail_active=\"$dbmail_active\"" + +%start -u @l_susr@ -p 450 + rcService dbmail enable yes || exit 0 + rcService dbmail active yes && exit 0 + for protocol in $dbmail_protocols; do + case "$protocol" in + imap ) @l_prefix@/sbin/dbmail-imapd ${dbmail_flags_imapd} ;; + lmtp ) @l_prefix@/sbin/dbmail-lmtpd ${dbmail_flags_lmtpd} ;; + pop3 ) @l_prefix@/sbin/dbmail-pop3d ${dbmail_flags_pop3d} ;; + timsieve ) @l_prefix@/sbin/dbmail-timsieved ${dbmail_flags_timsieved} ;; + esac + done + +%stop -u @l_susr@ -p 550 + rcService dbmail enable yes || exit 0 + rcService dbmail active no && exit 0 + dbmail_signal TERM + sleep 5 + +%restart -u @l_susr@ + rcService dbmail enable yes || exit 0 + rcService dbmail active no && exit 0 + rc dbmail stop + sleep 10 + rc dbmail stop + +%hourly -u @l_susr@ + rcService dbmail enable yes || exit 0 + rcService dbmail active no && exit 0 + %{l_prefix}/sbin/dbmail-util -l 1h -qq + +%daily -u @l_susr@ + rcService dbmail enable yes || exit 0 + rcService dbmail active no && exit 0 + %{l_prefix}/sbin/dbmail-util -ay + for tag in $dbmail_log_tags; do + if [ -f $dbmail_logdir/dbmail-$tag.log ]; then + shtool rotate -f \ + -n ${dbmail_log_numfiles} -s ${dbmail_log_minsize} -d \ + -z ${dbmail_log_complevel} -m 664 -o @l_susr@ -g @l_mgrp@ \ + -P "${dbmail_log_prolog}" \ + -E "${dbmail_log_epilog}" \ + $dbmail_logdir/dbmail-$tag.log + fi + done + @@ . ______________________________________________________________________ The OpenPKG Project www.openpkg.org CVS Repository Commit List openpkg-cvs@openpkg.org