[patch] dovecot

Marcin Sztolcman msztolcman at post.pl
Fri Jan 21 01:24:27 CET 2005


Witam
poprawilem troche speca i plik konfiguracyjny.
spec:
wersja 0.99.13 + md5
url na dovecot.org (stary url przenosi i tak na dovecot.org)
dodawany jest user dovecot (uid i gid: 142 - wg uid_gid.db.txt (najnisze 
wolne)
do doc dorzucone 2 pliki: USE-WIKI-INSTEAD i mkcert.sh (ktorego mi 
brakowalo strasznie podczas pierwszego kontaktu z dovecotem ;) )

conf:
certyfikaty w /etc
login_user = dovecot
auth_passdb = pam

pakiet sie buduje i u mnie smiga

prosilbym tylko o sprawdzenie czy dodawanie usera/grupy i pozniej ich 
usuwanie jest zrobione ok, przyklady bralem z exim.spec ;)

	MySZ

-- 
Marcin ``MySZ`` Sztolcman :: mailto:http://urzenia.net/email

wylapmy troche spamu: spamtest at ber.pl
-------------- next part --------------
--- dovecot-0.99.13/dovecot-example.conf	2005-01-21 00:18:53.018464520 +0100
+++ dovecot-example.conf.new	2005-01-21 00:22:39.614016760 +0100
@@ -33,8 +33,8 @@
 # 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_key_file = /etc/ssl/private/dovecot.pem
+ssl_cert_file = /etc/certs/dovecot.pem
+ssl_key_file = /etc/certs/dovecot.pem
 
 # SSL parameter file. Master process generates this file for login processes.
 # It contains Diffie Hellman and RSA parameters.
@@ -92,7 +92,7 @@
 # only it has access, it's used to control access for authentication process.
 # Note that this user is NOT used to access mails.
 # http://wiki.dovecot.org/UserIds
-#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.
-------------- next part --------------
--- dovecot.spec.org	2005-01-14 21:14:41.000000000 +0100
+++ dovecot.spec	2005-01-21 00:59:05.909649304 +0100
@@ -9,17 +9,17 @@
 Summary:	IMAP and POP3 server written with security primarily in mind
 Summary(pl):	Serwer IMAP i POP3 pisany głównie z myślą o bezpieczeństwie
 Name:		dovecot
-Version:	0.99.11
+Version:	0.99.13
 Release:	1
 License:	LGPL v2.1
 Group:		Networking/Daemons
 Source0:	http://dovecot.org/releases/%{name}-%{version}.tar.gz
-# Source0-md5:	05090ad784540b96c84f32080ada9f97
+# Source0-md5:	a84896c4236232b843972370e3730729
 Source1:	%{name}.pamd
 Source2:	%{name}.init
 Source3:	%{name}.sysconfig
 Patch0:		%{name}-config.patch
-URL:		http://dovecot.procontrol.fi/
+URL:		http://dovecot.org/
 BuildRequires:	autoconf
 BuildRequires:	automake
 %{?with_sasl:BuildRequires:	cyrus-sasl-devel >= 2.0}
@@ -33,8 +33,14 @@
 %{?with_pgsql:BuildRequires:	postgresql-devel}
 Requires(post,preun):	/sbin/chkconfig
 Requires:	pam >= 0.77.3
-Provides:	imapdaemon
+Requires(pre):	/bin/id
+Requires(pre):	/usr/bin/getgid
+Requires(pre):	/usr/sbin/groupadd
+Requires(pre):	/usr/sbin/useradd
+Requires(postun):	/usr/sbin/groupdel
+Requires(postun):	/usr/sbin/userdel
 BuildRoot:	%{tmpdir}/%{name}-%{version}-root-%(id -u -n)
+Provides:	imapdaemon
 
 %description
 Dovecot is an IMAP and POP3 server for Linux/UNIX-like systems,
@@ -140,6 +146,26 @@
 %clean
 rm -rf $RPM_BUILD_ROOT
 
+%pre
+if [ -n "`/usr/bin/getgid dovecot`" ]; then
+	if [ "`/usr/bin/getgid dovecot`" != 142 ]; then
+		echo "Warning: group dovecot haven't gid=142. Correct this before installing dovecot" 1>&2
+		exit 1
+	fi
+else
+	/usr/sbin/groupadd -g 142 dovecot 1>&2
+fi
+
+if [ -n "`/bin/id -u dovecot 2>/dev/null`" ]; then
+	if [ "`/bin/id -u dovecot`" != 142 ]; then
+		echo "Warning: user dovecot doesn't have uid=142. Correct this before installing dovecot" 1>&2
+		exit 1
+	fi
+else
+	/usr/sbin/useradd -u 142 -d /var/spool/dovecot -s /bin/false \
+		-c "Dovecot pseudo user" -g dovecot dovecot 1>&2
+fi
+
 %post
 /sbin/chkconfig --add dovecot
 if [ -f /var/lock/subsys/dovecot ]; then
@@ -156,10 +182,16 @@
 	/sbin/chkconfig --del dovecot
 fi
 
+%postun
+if [ "$1" = "0" ]; then
+	%userremove dovecot
+	%groupremove dovecot
+fi
+
 %files
 %defattr(644,root,root,755)
 # COPYING contains some notes, not actual LGPL text
-%doc AUTHORS COPYING ChangeLog NEWS README TODO doc/*.txt doc/*.c*f
+%doc AUTHORS COPYING ChangeLog NEWS README TODO doc/USE-WIKI-INSTEAD doc/*.txt doc/*.c*f doc/mkcert.sh
 %attr(755,root,root) %{_sbindir}/%{name}
 %config(noreplace) %verify(not size mtime md5) /etc/%{name}.conf
 %attr(640,root,root) %config(noreplace) %verify(not size mtime md5) /etc/pam.d/%{name}


More information about the pld-devel-pl mailing list