On Sunday 19 of September 2004 00:12, Tomasz Grobelny wrote:
> Now it is being built 
> on my machine, I hope it will be ok. If correct please apply.
>
It's not ok. Now should be better but still trigger does not work as expected. 
Either it is not called at all (which I doubt) or it is called in wrong order 
(ie after putting /etc/courier-imap/{pop3,pop3s} in place). How to do it The 
Right Way (tm)?

Tomek
diff -u -r old/courier-pop3.in new/courier-pop3.in
--- old/courier-pop3.in	2004-09-18 20:37:01.000000000 +0200
+++ new/courier-pop3.in	2004-09-18 22:19:03.000000000 +0200
@@ -31,49 +31,24 @@
 	# Check if the service is already running?
 	if [ ! -f /var/lock/subsys/courier-pop3 ]; then
 
-        POP3DSTART=""
-        POP3DSSLSTART=""
-
-        if test -f $sysconfdir/pop3d
-        then
-            . $sysconfdir/pop3d
-        fi
-
-        case x$POP3DSTART in
-        x[yY]*)
-        # Start daemons.
-	msg_starting pop3d
-        $libexecdir/pop3d.rc start
-	RETVAL=$?
-        if [ $RETVAL -eq 0 ]; then ok; else fail; fi
-        ;;
-        esac
-
-        if test -f $sysconfdir/pop3d-ssl
-        then
-        . $sysconfdir/pop3d-ssl
-        fi
-
-        case x$POP3DSSLSTART in
-	x[yY]*)
-        if test -x $COURIERTLS
-	then
-	# First time we start this, generate a dummy SSL certificate.
-	if test ! -f $TLS_CERTFILE
-	then
-	echo -n " generating-SSL-certificate..."
-	$sbindir/mkpop3dcert >/dev/null 2>&1
-	fi
-	msg_starting pop3d-ssl
-        $libexecdir/pop3d-ssl.rc start
-	RETVAL=$?
-    	if [ $RETVAL -eq 0 ]; then ok; else fail; fi
-
-	fi
-	;;
-	esac
-
-	touch /var/lock/subsys/courier-pop3
+	. /etc/sysconfig/courier
+	for i in $POP3_CONFIG_FILES; do
+		. $i
+		if [ -x $COURIERTLS ]; then
+		# First time we start this, generate a dummy SSL certificate
+			if [ ! -f $TLS_CERTFILE ]; then
+				echo -n " generating-SSL-certificate..."
+				$sbindir/mkpop3dcert >/dev/null 2>&1
+			fi
+		fi
+		if [ `echo $START|grep "^[yY1]"|wc -l` -eq 1 ]; then
+			msg_starting $i
+			$libexecdir/pop3d.rc start $i
+			RETVAL=$?
+			if [ $RETVAL -eq 0 ]; then ok; else fail; fi
+		fi
+	done
+	touch /var/lock/subsys/courier-pop3;
 	else
 		msg_already_running "Courier POP3"
 	fi
@@ -81,32 +56,22 @@
   stop)
 	if [ -f /var/lock/subsys/courier-pop3 ]; then
 
-        . $sysconfdir/pop3d
-        if [ -f $PIDFILE ]; then
-	    msg_stopping pop3d
-    	    $libexecdir/pop3d.rc stop
-	    RETVAL=$?
-    	    if [ $RETVAL -eq 0 ]; then
-		ok
-		rm -f $PIDFILE
-	    else
-		fail
-	    fi
-	fi
-
-        . $sysconfdir/pop3d-ssl
-        if [ -f $SSLPIDFILE ]; then
-	    msg_stopping pop3d-ssl
-    	    $libexecdir/pop3d-ssl.rc stop
-	    RETVAL=$?
-    	    if [ $RETVAL -eq 0 ]; then
-		ok
-		rm -f $SSLPIDFILE
-	    else 
-		fail
-	    fi
-	fi
-
+	. /etc/sysconfig/courier
+	for i in $POP3_CONFIG_FILES; do
+		. $i
+		if [ -f $PIDFILE ]; then
+			msg_stopping $i
+			$libexecdir/pop3d.rc stop $i
+			RETVAL=$?
+			if [ $RETVAL -eq 0 ]; then
+				ok
+				rm -f $PIDFILE
+			else
+				fail
+			fi
+		fi
+	done
+	
 	rm -f /var/lock/subsys/courier-pop3
 	else
 		msg_not_running "Courier POP3"
diff -u -r old/imap/pop3d-ssl.dist.in new/imap/pop3d-ssl.dist.in
--- old/imap/pop3d-ssl.dist.in	2004-08-26 14:39:29.000000000 +0200
+++ new/imap/pop3d-ssl.dist.in	2004-09-18 22:17:20.000000000 +0200
@@ -7,6 +7,7 @@
 #
 #  Copyright 2000-2002 Double Precision, Inc.  See COPYING for
 #  distribution information.
+#  Copyright 2004 Tomasz Grobelny <[EMAIL PROTECTED]>
 #
 #  This configuration file sets various options for the Courier-IMAP server
 #  when used to handle SSL POP3 connections.
@@ -18,15 +19,7 @@
 #
 #  Download OpenSSL from http://www.openssl.org/
 #
-##NAME: SSLPORT:0
-#
-#  Options in the pop3d-ssl configuration file AUGMENT the options in the
-#  pop3d configuration file.  First the pop3d configuration file is read,
-#  then the pop3d-ssl configuration file, so we do not have to redefine
-#  anything.
-#
-#  However, some things do have to be redefined.  The port number is
-#  specified by SSLPORT, instead of PORT.  The default port is port 995.
+##NAME: PORT:0
 #
 #  Multiple port numbers can be separated by commas.  When multiple port
 #  numbers are used it is possibly to select a specific IP address for a
@@ -35,36 +28,36 @@
 #  The SSLADDRESS setting is a default for ports that do not have
 #  a specified IP address.
 
-SSLPORT=995
+PORT=995
 
-##NAME: SSLADDRESS:0
+##NAME: ADDRESS:0
 #
 #  Address to listen on, can be set to a single IP address.
 #
-# SSLADDRESS=127.0.0.1
+# ADDRESS=127.0.0.1
 
-SSLADDRESS=0
+ADDRESS=0
 
-##NAME: SSLPIDFILE:0
+##NAME: PIDFILE:0
 #
 # You can also redefine AUTHMODULES, although I can't
 # think of why you'd want to do that.
 #
 #
 
[EMAIL PROTECTED]@/pop3d-ssl.pid
[EMAIL PROTECTED]@/pop3d-ssl.pid
 
 ##NAME: POP3DSSLSTART:0
 #
 #  Whether or not to start POP3 over SSL on spop3 port:
 
-POP3DSSLSTART=NO
+START=NO
 
 ##NAME: POP3_STARTTLS:0
 #
 # Whether or not to implement the POP3 STLS extension:
 
-POP3_STARTTLS=YES
+POP3_STARTTLS=NO
 
 ##NAME: POP3_TLS_REQUIRED:1
 #
@@ -183,3 +176,6 @@
 # MAILDIRPATH - directory name of the maildir directory.
 #
 MAILDIRPATH=Mail/Maildir
+
+COURIERTLS_OPTIONS="-server -tcpd"
+ERRLOGGERNAME="pop3d-ssl"
diff -u -r old/imap/pop3d.dist.in new/imap/pop3d.dist.in
--- old/imap/pop3d.dist.in	2004-08-26 14:39:29.000000000 +0200
+++ new/imap/pop3d.dist.in	2004-09-18 22:17:49.000000000 +0200
@@ -7,6 +7,7 @@
 #
 #  Copyright 1998 - 2002 Double Precision, Inc.  See COPYING for
 #  distribution information.
+#  Copyright 2004 Tomasz Grobelny <[EMAIL PROTECTED]>
 #
 #  Courier POP3 daemon configuration
 #
@@ -145,10 +146,23 @@
 # with enough platforms so that people get annoyed with having to flip it to
 # YES every time.
 
-POP3DSTART=NO
+START=YES
 
 ##NAME: MAILDIRPATH:0
 #
 # MAILDIRPATH - directory name of the maildir directory.
 #
 MAILDIRPATH=Mail/Maildir
+
+COURIERTLS=""
+COURIERTLS_OPTIONS=""
+ERRLOGGERNAME="pop3d"
+
+POP3_STARTTLS=YES
+POP3_TLS_REQUIRED=0
[EMAIL PROTECTED]@/couriersslcache
+TLS_CACHESIZE=524288
[EMAIL PROTECTED]@/pop3d.pem
+TLS_PROTOCOL=SSL3
+TLS_STARTTLS_PROTO=TLS1
+TLS_VERIFYPEER=NONE
diff -u -r old/pop3d.rc.in new/pop3d.rc.in
--- old/pop3d.rc.in	2004-06-09 00:44:16.000000000 +0200
+++ new/pop3d.rc.in	2004-09-18 22:16:33.000000000 +0200
@@ -2,6 +2,7 @@
 # $Id: pop3d.rc.in,v 1.12 2004/04/18 15:54:38 mrsam Exp $
 #
 # Copyright 1998 - 2002 Double Precision, Inc.
+# Copyright 2004 Tomasz Grobelny <[EMAIL PROTECTED]>
 # See COPYING for distribution information.
 
 
@@ -10,20 +11,13 @@
 [EMAIL PROTECTED]@
 [EMAIL PROTECTED]@
 
-if test ! -f @sysconfdir@/pop3d
+if test ! -f $2
 then
-	echo "@sysconfdir@/pop3d does not exist, forgot make install-configure?"
+	echo "$2 does not exist, forgot to configure?"
 	exit 1
 fi
 
-if test ! -f @sysconfdir@/pop3d-ssl
-then
-	echo "@sysconfdir@/pop3d-ssl does not exist, forgot make install-configure?"
-	exit 1
-fi
-
-. @sysconfdir@/pop3d-ssl
-. @sysconfdir@/pop3d
+. $2
 
 case $1 in
 start)
@@ -43,17 +37,19 @@
 		[EMAIL PROTECTED]@ ;
 		[EMAIL PROTECTED]@ ;
 		[EMAIL PROTECTED]@ ;
-		. @sysconfdir@/pop3d ; \
-				. @sysconfdir@/pop3d-ssl ; \
-		TLS_PROTOCOL=$TLS_STARTTLS_PROTOCOL ; \
-		export TLS_PROTOCOL ;
+		. $2 ; \
+		if [[ -n \"$TLS_STARTTLS_PROTO\" ]]; then \
+			TLS_PROTOCOL=$TLS_STARTTLS_PROTO; \
+			export TLS_PROTOCOL; \
+		fi; \
 		@libexecdir@/couriertcpd -address=$ADDRESS \
 			[EMAIL PROTECTED]@/courierlogger \
-			-stderrloggername=pop3d \
+			-stderrloggername=$ERRLOGGERNAME \
 			-maxprocs=$MAXDAEMONS -maxperip=$MAXPERIP \
 			-pid=$PIDFILE $TCPDOPTS \
-			$PORT @sbindir@/pop3login $LIBAUTHMODULES \
-				@bindir@/pop3d ${MAILDIRPATH}"
+			$PORT $COURIERTLS $COURIERTLS_OPTIONS \
+				/usr/sbin/pop3login $LIBAUTHMODULES \
+				/usr/bin/pop3d ${MAILDIRPATH}"
 	;;
 stop)
 	@libexecdir@/couriertcpd -pid=$PIDFILE -stop
Index: courier-imap.spec
===================================================================
RCS file: /cvsroot/SPECS/courier-imap.spec,v
retrieving revision 1.132
diff -u -3 -p -r1.132 courier-imap.spec
--- courier-imap.spec	3 Aug 2004 21:31:23 -0000	1.132
+++ courier-imap.spec	19 Sep 2004 00:11:15 -0000
@@ -9,7 +9,7 @@ Summary:	Courier-IMAP server
 Summary(pl):	Serwer Courier-IMAP
 Name:		courier-imap
 Version:	3.0.7
-Release:	2
+Release:	3
 License:	GPL
 Group:		Networking/Daemons
 Source0:	http://dl.sourceforge.net/courier/%{name}-%{version}.tar.bz2
@@ -18,9 +18,11 @@ Source1:	%{name}.init
 Source2:	%{name}-pop3.init
 Source3:	%{name}.pamd
 Source4:	%{name}-pop3.pamd
+Source5:	%{name}-sysconfig
 Patch0:		%{name}-dirs.patch
 Patch1:		%{name}-certsdir.patch
 Patch2:		%{name}-maildir.patch
+Patch3:		%{name}-pop3drc.patch
 URL:		http://www.inter7.com/courierimap/
 BuildRequires:	autoconf >= 2.54
 BuildRequires:	automake
@@ -174,6 +176,7 @@ IMAP.
 
 install %{SOURCE1} courier-imap.in
 install %{SOURCE2} courier-pop3.in
+%patch3 -p1
 
 %build
 cp -f /usr/share/automake/config.sub .
@@ -210,7 +213,7 @@ cd ..
 
 %install
 rm -rf $RPM_BUILD_ROOT
-install -d $RPM_BUILD_ROOT{/etc/{pam.d,rc.d/init.d,security},%{_certsdir}}
+install -d $RPM_BUILD_ROOT{/etc/{pam.d,rc.d/init.d,security,sysconfig},%{_certsdir}}
 
 %{__make} install \
 	DESTDIR=$RPM_BUILD_ROOT
@@ -219,6 +222,7 @@ install courier-imap $RPM_BUILD_ROOT/etc
 install courier-pop3 $RPM_BUILD_ROOT/etc/rc.d/init.d/courier-pop3
 install %{SOURCE3} $RPM_BUILD_ROOT/etc/pam.d/imap
 install %{SOURCE4} $RPM_BUILD_ROOT/etc/pam.d/pop3
+install %{SOURCE5} $RPM_BUILD_ROOT/etc/sysconfig/courier
 
 rm -rf	$RPM_BUILD_ROOT%{_mandir}/man8/{authcram,authpam,authpwd,authshadow,authuserdb,authvchkpw,pw2userdb,vchkpw2userdb,authdaemon,authdaemond,authldap,authmysql}.8 \
 	$RPM_BUILD_ROOT%{_sbindir}/{*db,mk*cert}
@@ -266,7 +270,11 @@ touch $RPM_BUILD_ROOT/etc/security/black
 sed -i 's/^POP3DSTART.*/POP3DSTART=YES/' $RPM_BUILD_ROOT%{_sysconfdir}/pop3d
 sed -i 's/^IMAPDSTART.*/IMAPDSTART=YES/' $RPM_BUILD_ROOT%{_sysconfdir}/imapd
 
+mv -f $RPM_BUILD_ROOT%{_sysconfdir}/pop3d $RPM_BUILD_ROOT%{_sysconfdir}/pop3
+mv -f $RPM_BUILD_ROOT%{_sysconfdir}/pop3d-ssl $RPM_BUILD_ROOT%{_sysconfdir}/pop3s
+
 # remove unpackaged files
+rm -f $RPM_BUILD_ROOT%{_libexecdir}/pop3d-ssl.rc
 rm -f $RPM_BUILD_ROOT%{_sysconfdir}/*.dist
 
 %clean
@@ -339,6 +347,53 @@ echo - config files has been splited and
 echo - certificates directory has changed to %{_certsdir}
 echo
 
+%triggerin -n %{name}-pop3 -- %{name}-pop3 < 3.0.7-2
+if [ ! -f /etc/courier-imap/pop3 ]; then
+
+#pop3d
+cat > /etc/courier-imap/pop3 <<EOF
+###################################
+# begin of pop3d-ssl
+EOF
+cat /etc/courier-imap/pop3d-ssl >> /etc/courier-imap/pop3
+cat >> /etc/courier-imap/pop3 <<EOF
+# end of pop3d-ssl
+###################################
+EOF
+cat /etc/courier-imap/pop3d >> /etc/courier-imap/pop3
+cat >> /etc/courier-imap/pop3 <<EOF
+COURIERTLS=""
+COURIERTLS_OPTIONS=""
+ERRLOGGERNAME="pop3d"
+TLS_STARTTLS_PROTO="\$TLS_STARTTLS_PROTOCOL"
+START="\$POP3DSTART"
+EOF
+fi
+
+if [ ! -f /etc/courier-imap/pop3s ]; then
+#pop3d-ssl
+cat > /etc/courier-imap/pop3s <<EOF
+###################################
+# begin of pop3d
+EOF
+cat /etc/courier-imap/pop3d >> /etc/courier-imap/pop3s
+cat >> /etc/courier-imap/pop3s <<EOF
+# end of pop3d
+###################################
+EOF
+cat /etc/courier-imap/pop3d-ssl >> /etc/courier-imap/pop3s
+cat >> /etc/courier-imap/pop3s <<EOF
+COURIERTLS_OPTIONS="-server -tcpd"
+PIDFILE="\$SSLPIDFILE"
+PORT="\$SSLPORT"
+ADDRESS="\$SSLADDRESS"
+POP3_STARTTLS=NO
+POP3_TLS_REQUIRED=0
+ERRLOGGERNAME="pop3d-ssl"
+START="\$POP3DSSLSTART"
+EOF
+fi
+
 %post pop3
 /sbin/chkconfig --add courier-pop3
 /sbin/chkconfig --del courier-imap-pop3 >/dev/null 2>&1 || :
@@ -468,6 +523,7 @@ fi
 %dir %{_libexecdir}
 %dir %{_libexecdir}/authlib
 %attr(640,root,root) %config(noreplace) %verify(not size mtime md5) %{_sysconfdir}/authdaemonrc
+%attr(640,root,root) %config(noreplace) %verify(not size mtime md5) /etc/sysconfig/courier
 %{_sysconfdir}/quotawarnmsg.example
 %attr(755,root,root) %{_bindir}/couriertls
 %attr(755,root,root) %{_libexecdir}/authlib/authdaemon
@@ -509,15 +565,14 @@ fi
 %defattr(644,root,root,755)
 %attr(640,root,root) %config(noreplace) %verify(not size mtime md5) /etc/pam.d/pop3
 %attr(640,root,root) %config(noreplace) %verify(not size mtime md5) /etc/security/blacklist.pop3
-%attr(640,root,root) %config(noreplace) %verify(not size mtime md5) %{_sysconfdir}/pop3d
-%attr(640,root,root) %config(noreplace) %verify(not size mtime md5) %{_sysconfdir}/pop3d-ssl
+%attr(640,root,root) %config(noreplace) %verify(not size mtime md5) %{_sysconfdir}/pop3
+%attr(640,root,root) %config(noreplace) %verify(not size mtime md5) %{_sysconfdir}/pop3s
 %attr(640,root,root) %config(noreplace) %verify(not size mtime md5) %{_sysconfdir}/pop3d.cnf
 %attr(754,root,root) /etc/rc.d/init.d/courier-pop3
 %attr(755,root,root) %{_bindir}/pop3d
 %attr(755,root,root) %{_sbindir}/mkpop3dcert
 %attr(755,root,root) %{_sbindir}/pop3login
 %attr(755,root,root) %{_libexecdir}/pop3d.rc
-%attr(755,root,root) %{_libexecdir}/pop3d-ssl.rc
 %{_mandir}/man8/courierpop*
 
 %if %{with ldap}
POP3_CONFIG_FILES="/etc/courier-imap/pop3 /etc/courier-imap/pop3s"
IMAP_CONFIG_FILES="/etc/courier-imap/imap /etc/courier-imap/imaps"
_______________________________________________
pld-devel-en mailing list
[EMAIL PROTECTED]
http://lists.pld-linux.org/mailman/listinfo/pld-devel-en

Reply via email to