3 %bcond_without ldap # without LDAP support
4 %bcond_without mysql # without MySQL support
5 %bcond_without pgsql # without PostgreSQL support
7 Summary: Courier-IMAP server
8 Summary(pl): Serwer Courier-IMAP
13 Group: Networking/Daemons
14 Source0: http://dl.sourceforge.net/courier/%{name}-%{version}.tar.bz2
15 # Source0-md5: 1b431e6dac39ed728d839ceb35474040
17 Source2: %{name}-pop3.init
19 Source4: %{name}-pop3.pamd
20 Patch0: %{name}-dirs.patch
21 Patch1: %{name}-certsdir.patch
22 Patch2: %{name}-maildir.patch
23 URL: http://www.inter7.com/courierimap/
24 BuildRequires: autoconf >= 2.54
25 BuildRequires: automake
26 BuildRequires: gdbm-devel
27 BuildRequires: libstdc++-devel
28 %{?with_mysql:BuildRequires: mysql-devel}
29 %{?with_ldap:BuildRequires: openldap-devel}
30 BuildRequires: openssl-devel >= 0.9.7d
31 %{?with_pgsql:BuildRequires: postgresql-devel}
33 BuildRequires: sed >= 4.0
34 BuildRequires: sysconftool
35 %{?with_mysql:BuildRequires: zlib-devel}
36 PreReq: %{name}-common = %{version}-%{release}
38 Requires(post,preun): /sbin/chkconfig
39 Requires: pam >= 0.77.3
42 Conflicts: cyrus-imapd
44 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
46 %define _libexecdir /usr/%{_lib}/courier-imap
47 %define _sysconfdir /etc/courier-imap
48 %define _certsdir %{_sysconfdir}/certs
49 %define _localstatedir /var/spool/courier-imap
52 Courier-IMAP is an IMAP server for Maildir mailboxes.
55 Courier-IMAP jest serwerem IMAP dla skrzynek pocztowych Maildir.
58 Summary: Common files for imap and pop3 daemons
59 Summary(pl): Pliki wspólne dla serwerów imap i pop3
60 Group: Networking/Daemons
62 Requires(post,preun): /sbin/chkconfig
66 Common files for imap and pop3 daemons.
68 %description common -l pl
69 Pliki wspólne dla serwerów imap i pop3.
72 Summary: Commands used to create the /etc/userdb.dat
73 Summary(pl): Polecenia do tworzenia /etc/userdb.dat
74 Group: Networking/Daemons
77 Commands used to create the /etc/userdb.dat.
79 %description userdb -l pl
80 Polecenia u¿ywane do stworzenia /etc/userdb.dat.
83 Summary: Deliver to a Maildir with a quota
84 Summary(pl): Obs³uga quoty przy dostarczaniu poczty do skrzynek Maildir
85 Group: Networking/Daemons
87 %description deliverquota
88 deliverquota is a temporary hack to implement E-mail delivery to a
89 Maildir with a software-imposed quota.
91 %description deliverquota -l pl
92 deliverquota jest tymczasowym rozwi±zaniem implementuj±cym
93 dostarczanie e-maili do skrzynek Maildir z programowo narzucon± quot±.
96 Summary: Tool for making mail folders in Maildir format
97 Summary(pl): Narzêdzie do tworzenia folderów w formacie Maildir
98 Group: Networking/Daemons
99 Conflicts: qmail-maildirmake
101 %description maildirmake
102 Maildirmake is a tool for making mail folders in Maildir format.
104 %description maildirmake -l pl
105 Maildirmake jest narzêdziem do tworzenia folderów pocztowych w
109 Summary: Courier-IMAP POP3 Server
110 Summary(pl): Serwer Courier-IMAP POP3
111 Group: Networking/Daemons
112 PreReq: %{name}-common = %{version}-%{release}
113 Requires: pam >= 0.77.3
115 Obsoletes: pop3daemon
116 Conflicts: cyrus-imapd
118 Conflicts: solid-pop3d
122 Courier-IMAP POP3 is an POP3 server for Maildir mailboxes.
124 %description pop3 -l pl
125 Courier-IMAP POP3 jest serwerem POP3 dla skrzynek pocztowych Maildir.
128 Summary: LDAP authentication daemon for Courier IMAP
129 Summary(pl): Demon autentykacji LDAP do Courier IMAP
130 Group: Networking/Daemons
131 PreReq: %{name}-common = %{version}-%{release}
133 %description authldap
134 This package provides LDAP authentication for Courier IMAP.
136 %description authldap -l pl
137 Ten pakiet pozwala na korzystanie z autentykacji LDAP w Courier IMAP.
140 Summary: MySQL authentication daemon for Courier IMAP
141 Summary(pl): Demon autentykacji MySQL do Courier IMAP
142 Group: Networking/Daemons
143 PreReq: %{name}-common = %{version}-%{release}
146 %description authmysql
147 This package provides MySQL authentication for Courier IMAP.
149 %description authmysql -l pl
150 Ten pakiet pozwala na korzystanie z autentykacji MySQL w Courier IMAP.
153 Summary: PostgreSQL authentication daemon for Courier IMAP
154 Summary(pl): Demon autentykacji PostgreSQL do Courier IMAP
155 Group: Networking/Daemons
156 PreReq: %{name}-common = %{version}-%{release}
158 %description authpgsql
159 This package provides PostgreSQL authentication for Courier IMAP.
161 %description authpgsql -l pl
162 Ten pakiet pozwala na korzystanie z autentykacji PostgreSQL w Courier
171 install %{SOURCE1} courier-imap.in
172 install %{SOURCE2} courier-pop3.in
175 cp -f /usr/share/automake/config.sub .
176 cp -f /usr/share/automake/config.sub maildir
194 --with-authchangepwdir=/var/tmp \
195 --with-authdaemonvar=/var/lib/authdaemon \
196 --with-certsdir=%{_certsdir} \
197 %{?with_mysql:--with-mysql-libs=%{_libdir} --with-mysql-includes=%{_includedir}/mysql} \
198 %{!?with_mysql:--without-authmysql} \
199 %{?with_pgsql:--with-pgsql-libs=%{_libdir} --with-pgsql-includes=%{_includedir}/postgresql} \
200 %{!?with_pgsql:--without-authpgsql} \
201 %{!?with_ldap:--without-authldap}
206 rm -rf $RPM_BUILD_ROOT
207 install -d $RPM_BUILD_ROOT{/etc/{pam.d,rc.d/init.d,security},%{_certsdir}}
210 DESTDIR=$RPM_BUILD_ROOT
212 install courier-imap $RPM_BUILD_ROOT/etc/rc.d/init.d/courier-imap
213 install courier-pop3 $RPM_BUILD_ROOT/etc/rc.d/init.d/courier-pop3
214 install %{SOURCE3} $RPM_BUILD_ROOT/etc/pam.d/imap
215 install %{SOURCE4} $RPM_BUILD_ROOT/etc/pam.d/pop3
217 rm -rf $RPM_BUILD_ROOT%{_mandir}/man8/{authcram,authpam,authpwd,authshadow,authuserdb,authvchkpw,pw2userdb,vchkpw2userdb,authdaemon,authdaemond,authldap,authmysql}.8 \
218 $RPM_BUILD_ROOT%{_sbindir}/{*db,mk*cert}
220 mv -f authlib/README.authmysql.html README.authmysql.html
221 mv -f authlib/README.ldap README.ldap
222 mv -f authlib/README.authmysql.myownquery README.authmysql.myownquery
223 mv -f imap/README README.imap
224 mv -f imap/ChangeLog ChangeLog
225 mv -f maildir/README.maildirquota.txt README.maildirquota
227 install authlib/authdaemonrc $RPM_BUILD_ROOT%{_sysconfdir}
228 install authlib/authldaprc $RPM_BUILD_ROOT%{_sysconfdir}
229 install authlib/authmysqlrc $RPM_BUILD_ROOT%{_sysconfdir}
230 install authlib/authpgsqlrc $RPM_BUILD_ROOT%{_sysconfdir}
232 mv -f $RPM_BUILD_ROOT%{_datadir}/*db \
233 $RPM_BUILD_ROOT%{_sbindir}
234 mv -f $RPM_BUILD_ROOT%{_datadir}/mk*cert \
235 $RPM_BUILD_ROOT%{_sbindir}
237 mv -f tcpd/couriertls.1 $RPM_BUILD_ROOT%{_mandir}/man8/couriertls.8
238 mv -f imap/courierpop3d.8 $RPM_BUILD_ROOT%{_mandir}/man8/courierpop3d.8
240 echo ".so man7/authlib.7" >$RPM_BUILD_ROOT%{_mandir}/man8/authcram.8
241 echo ".so man7/authlib.7" >$RPM_BUILD_ROOT%{_mandir}/man8/authpam.8
242 echo ".so man7/authlib.7" >$RPM_BUILD_ROOT%{_mandir}/man8/authpwd.8
243 echo ".so man7/authlib.7" >$RPM_BUILD_ROOT%{_mandir}/man8/authshadow.8
244 echo ".so man7/authlib.7" >$RPM_BUILD_ROOT%{_mandir}/man8/authuserdb.8
245 echo ".so man7/authlib.7" >$RPM_BUILD_ROOT%{_mandir}/man8/authvchkpw.8
246 echo ".so man7/authlib.7" >$RPM_BUILD_ROOT%{_mandir}/man8/authdaemon.8
247 echo ".so man7/authlib.7" >$RPM_BUILD_ROOT%{_mandir}/man8/authdaemond.8
248 %{?with_pgsql:echo ".so man7/authlib.7" >$RPM_BUILD_ROOT%{_mandir}/man8/authpgsql.8}
249 %{?with_mysql:echo ".so man7/authlib.7" >$RPM_BUILD_ROOT%{_mandir}/man8/authmysql.8}
250 %{?with_ldap:echo ".so man7/authlib.7" >$RPM_BUILD_ROOT%{_mandir}/man8/authldap.8}
251 echo ".so makeuserdb.8" >$RPM_BUILD_ROOT%{_mandir}/man8/pw2userdb.8
252 echo ".so makeuserdb.8" >$RPM_BUILD_ROOT%{_mandir}/man8/vchkpw2userdb.8
254 touch $RPM_BUILD_ROOT/etc/security/blacklist.{pop3,imap}
257 ./sysconftool $RPM_BUILD_ROOT%{_sysconfdir}/*.dist
259 # set yes to start imapd and pop3d
260 sed -i 's/^POP3DSTART.*/POP3DSTART=YES/' $RPM_BUILD_ROOT%{_sysconfdir}/pop3d
261 sed -i 's/^IMAPDSTART.*/IMAPDSTART=YES/' $RPM_BUILD_ROOT%{_sysconfdir}/imapd
263 # remove unpackaged files
264 rm -f $RPM_BUILD_ROOT%{_sysconfdir}/*.dist
267 rm -rf $RPM_BUILD_ROOT
270 /sbin/chkconfig --add courier-imap
272 if [ -f /var/lock/subsys/courier-imap ]; then
273 /etc/rc.d/init.d/courier-imap restart >&2
275 echo "Run \"/etc/rc.d/init.d/courier-imap start\" to start courier-imap daemon."
279 if [ "$1" = "0" ]; then
280 if [ -f /var/lock/subsys/courier-imap ]; then
281 /etc/rc.d/init.d/courier-imap stop >&2
283 /sbin/chkconfig --del courier-imap
286 %triggerin -- %{name} < 3.0.5
287 if [ -f /var/lib/openssl/certs/imapd.pem ]; then
289 echo imapd.pem has been moved automatically to %{_certsdir}
291 mv -f /var/lib/openssl/certs/imapd.pem %{_certsdir}
293 if [ -f /etc/sysconfig/courier-imap ]; then
294 . /etc/sysconfig/courier-imap
295 for opt in `grep ^[^#] /etc/sysconfig/courier-imap |grep -v TLS_CERTFILE |grep -v MAILDIR |grep -v COURIERTLS |cut -d= -f1`;
298 sed -i s/^$opt=.*/"$opt=\"$opt2\""/ %{_sysconfdir}/imapd
299 sed -i s/^$opt=.*/"$opt=\"$opt2\""/ %{_sysconfdir}/imapd-ssl
301 sed -i s/^SSLADDRESS=.*/"SSLADDRESS=$ADDRESS_SSL"/ %{_sysconfdir}/imapd-ssl
302 sed -i s/^SSLPORT=.*/"SSLPORT=$PORTS_SSL"/ %{_sysconfdir}/imapd-ssl
303 sed -i s!^MAILDIRPATH=.*!"MAILDIRPATH=\"$MAILDIR\""! %{_sysconfdir}/imapd-ssl
304 sed -i s!^MAILDIRPATH=.*!"MAILDIRPATH=\"$MAILDIR\""! %{_sysconfdir}/imapd
306 echo IMAPD config file has been rewriten to %{_sysconfdir}/imapd,imapd-ssl
307 echo please look at them
310 if [ -f /var/lock/subsys/courier-imap ]; then
311 /etc/rc.d/init.d/courier-imap restart >&2
314 %triggerin -- %{name} < 3.0.6
315 . %{_sysconfdir}/imapd-ssl
316 if [ $TLS_CACHEFILE = "/var/couriersslcache" ]; then
317 sed -i s/^TLS_CACHEFILE=.*/"TLS_CACHEFILE=\/var\/spool\/courier-imap\/couriersslcache"/ %{_sysconfdir}/imapd-ssl
320 %triggerin -n %{name}-common -- %{name}-common < 3.0.5
321 /sbin/chkconfig --del authdaemon
322 if [ -f /var/lock/subsys/authdaemon ]; then
323 kill `cat /var/lib/authdaemon/pid`
324 rm -f /var/lock/subsys/authdaemon
326 if [ -f /etc/sysconfig/authdaemon ]; then
327 . /etc/sysconfig/authdaemon
328 sed -i s/^version.*/version=authdaemond.$METHOD/ %{_sysconfdir}/authdaemonrc
331 echo Changes to version 3.0.5 :
332 echo - config files has been splited and moved to %{_sysconfdir}
333 echo - certificates directory has changed to %{_certsdir}
337 /sbin/chkconfig --add courier-pop3
338 /sbin/chkconfig --del courier-imap-pop3 >/dev/null 2>&1 || :
339 if [ -f /var/lock/subsys/courier-imap-pop3 ]; then
340 /etc/rc.d/init.d/courier-imap-pop3 stop >&2
341 /etc/rc.d/init.d/courier-pop3 start >&2
342 elif [ -f /var/lock/subsys/courier-pop3 ]; then
343 /etc/rc.d/init.d/courier-pop3 restart >&2
345 echo "Run \"/etc/rc.d/init.d/courier-pop3 start\" to start courier-pop3 daemon."
349 if [ "$1" = "0" ]; then
350 if [ -f /var/lock/subsys/courier-pop3 ]; then
351 /etc/rc.d/init.d/courier-pop3 stop >&2
353 /sbin/chkconfig --del courier-pop3
356 %triggerin -n %{name}-pop3 -- %{name}-pop3 < 3.0.5
357 if [ -f /var/lib/openssl/certs/pop3d.pem ]; then
359 echo pop3d.pem has been moved automatically to %{_certsdir}
361 mv -f /var/lib/openssl/certs/pop3d.pem %{_certsdir}
363 if [ -f /etc/sysconfig/courier-pop3 ]; then
364 . /etc/sysconfig/courier-pop3
365 for opt in `grep ^[^#] /etc/sysconfig/courier-pop3 |grep -v TLS_CERTFILE |grep -v MAILDIR |grep -v COURIERTLS |cut -d= -f1`;
368 sed -i s/^$opt=.*/"$opt=\"$opt2\""/ %{_sysconfdir}/pop3d
369 sed -i s/^$opt=.*/"$opt=\"$opt2\""/ %{_sysconfdir}/pop3d-ssl
371 sed -i s!^MAILDIRPATH=.*!"MAILDIRPATH=\"$MAILDIR\""! %{_sysconfdir}/pop3d-ssl
372 sed -i s!^MAILDIRPATH=.*!"MAILDIRPATH=\"$MAILDIR\""! %{_sysconfdir}/pop3d
374 echo POP3D config file has been rewriten to %{_sysconfdir}/{pop3d,pop3d-ssl}
375 echo please look at them
378 if [ -f /var/lock/subsys/courier-pop3 ]; then
379 /etc/rc.d/init.d/courier-pop3 restart >&2
382 %triggerin -n %{name}-pop3 -- %{name}-pop3 < 3.0.6
383 . %{_sysconfdir}/pop3d-ssl
384 if [ $TLS_CACHEFILE = "/var/couriersslcache" ]; then
385 sed -i s/^TLS_CACHEFILE=.*/"TLS_CACHEFILE=\/var\/spool\/courier-imap\/couriersslcache"/ %{_sysconfdir}/pop3d-ssl
389 if ps -A |grep -q authdaemond.lda; then
390 %{_libexecdir}/authlib/authdaemond stop
391 %{_libexecdir}/authlib/authdaemond start
395 if [ -x %{_libexecdir}/authlib/authdaemond ]; then
396 if ps -A |grep -q authdaemond.lda; then
397 %{_libexecdir}/authlib/authdaemond stop;
398 %{_libexecdir}/authlib/authdaemond start;
403 if ps -A |grep -q authdaemond.mys; then
404 %{_libexecdir}/authlib/authdaemond stop
405 %{_libexecdir}/authlib/authdaemond start
409 if [ -x %{_libexecdir}/authlib/authdaemond ]; then
410 if ps -A |grep -q authdaemond.mys; then
411 %{_libexecdir}/authlib/authdaemond stop;
412 %{_libexecdir}/authlib/authdaemond start;
417 if ps -A |grep -q authdaemond.pgs; then
418 %{_libexecdir}/authlib/authdaemond stop
419 %{_libexecdir}/authlib/authdaemond start
423 if [ -x %{_libexecdir}/authlib/authdaemond ]; then
424 if ps -A |grep -q authdaemond.pgs; then
425 %{_libexecdir}/authlib/authdaemond stop;
426 %{_libexecdir}/authlib/authdaemond start;
431 %defattr(644,root,root,755)
432 %doc maildir/README.sharedfolders.html
433 %attr(640,root,root) %config(noreplace) %verify(not size mtime md5) /etc/pam.d/imap
434 %attr(640,root,root) %config(noreplace) %verify(not size mtime md5) /etc/security/blacklist.imap
435 %attr(640,root,root) %config(noreplace) %verify(not size mtime md5) %{_sysconfdir}/imapd
436 %attr(640,root,root) %config(noreplace) %verify(not size mtime md5) %{_sysconfdir}/imapd-ssl
437 %attr(640,root,root) %config(noreplace) %verify(not size mtime md5) %{_sysconfdir}/imapd.cnf
438 %attr(754,root,root) /etc/rc.d/init.d/courier-imap
439 %attr(755,daemon,daemon) %dir %{_sysconfdir}/shared
440 %attr(755,daemon,daemon) %dir %{_sysconfdir}/shared.tmp
441 %attr(755,root,root) %{_bindir}/imapd
442 %attr(755,root,root) %{_bindir}/maildiracl
443 %attr(755,root,root) %{_bindir}/maildirkw
444 %attr(755,root,root) %{_sbindir}/authenumerate
445 %attr(755,root,root) %{_sbindir}/imaplogin
446 %attr(755,root,root) %{_sbindir}/mkimapdcert
447 %attr(755,root,root) %{_sbindir}/sharedindexinstall
448 %attr(755,root,root) %{_sbindir}/sharedindexsplit
449 %attr(755,root,root) %{_libexecdir}/imapd.rc
450 %attr(755,root,root) %{_libexecdir}/imapd-ssl.rc
451 %{_mandir}/man8/imapd*
452 %{_mandir}/man1/maildiracl.1*
453 %{_mandir}/man1/maildirkw.1*
456 %defattr(644,root,root,755)
457 %doc AUTHORS ChangeLog imap/BUGS INSTALL README*
458 %attr(770,daemon,daemon) /var/lib/authdaemon
459 %attr(750,root,root) %dir %{_sysconfdir}
460 %attr(750,root,root) %dir %{_certsdir}
461 %attr(770,daemon,daemon) %dir %{_localstatedir}
463 %dir %{_libexecdir}/authlib
464 %attr(640,root,root) %config(noreplace) %verify(not size mtime md5) %{_sysconfdir}/authdaemonrc
465 %{_sysconfdir}/quotawarnmsg.example
466 %attr(755,root,root) %{_bindir}/couriertls
467 %attr(755,root,root) %{_libexecdir}/authlib/authdaemon
468 %attr(755,root,root) %{_libexecdir}/authlib/authdaemond
469 %attr(755,root,root) %{_libexecdir}/authlib/authdaemond.plain
470 %attr(755,root,root) %{_libexecdir}/couriertcpd
471 %attr(755,root,root) %{_libexecdir}/makedatprog
472 %attr(755,root,root) %{_sbindir}/courierlogger
473 %{_mandir}/man8/auth[cdsuv]*
474 %{_mandir}/man8/authp[aw]*
475 %{_mandir}/man7/authlib*
476 %{_mandir}/man1/courierlogger*
477 %{_mandir}/man1/couriert*
478 %{_mandir}/man8/couriert*
482 %defattr(644,root,root,755)
483 %attr(755,root,root) %{_sbindir}/makeuserdb
484 %attr(755,root,root) %{_sbindir}/pw2userdb
485 %attr(755,root,root) %{_sbindir}/userdb
486 %attr(755,root,root) %{_sbindir}/userdbpw
487 %attr(755,root,root) %{_sbindir}/vchkpw2userdb
488 %{_mandir}/man8/makeuserdb*
489 %{_mandir}/man8/userdb*
490 %{_mandir}/man8/*pw2userdb*
493 %defattr(644,root,root,755)
494 %attr(755,root,root) %{_bindir}/deliverquota
495 %{_mandir}/man8/deliverquota*
498 %defattr(644,root,root,755)
499 %attr(755,root,root) %{_bindir}/maildirmake
500 %{_mandir}/man1/maildirmake*
503 %defattr(644,root,root,755)
504 %attr(640,root,root) %config(noreplace) %verify(not size mtime md5) /etc/pam.d/pop3
505 %attr(640,root,root) %config(noreplace) %verify(not size mtime md5) /etc/security/blacklist.pop3
506 %attr(640,root,root) %config(noreplace) %verify(not size mtime md5) %{_sysconfdir}/pop3d
507 %attr(640,root,root) %config(noreplace) %verify(not size mtime md5) %{_sysconfdir}/pop3d-ssl
508 %attr(640,root,root) %config(noreplace) %verify(not size mtime md5) %{_sysconfdir}/pop3d.cnf
509 %attr(754,root,root) /etc/rc.d/init.d/courier-pop3
510 %attr(755,root,root) %{_bindir}/pop3d
511 %attr(755,root,root) %{_sbindir}/mkpop3dcert
512 %attr(755,root,root) %{_sbindir}/pop3login
513 %attr(755,root,root) %{_libexecdir}/pop3d.rc
514 %attr(755,root,root) %{_libexecdir}/pop3d-ssl.rc
515 %{_mandir}/man8/courierpop*
519 %defattr(644,root,root,755)
520 %attr(640,root,root) %config(noreplace) %verify(not size mtime md5) %{_sysconfdir}/authldaprc
521 %attr(755,root,root) %{_libexecdir}/authlib/authdaemond.ldap
522 %{_mandir}/man8/authldap*
527 %defattr(644,root,root,755)
528 %attr(640,root,root) %config(noreplace) %verify(not size mtime md5) %{_sysconfdir}/authmysqlrc
529 %attr(755,root,root) %{_libexecdir}/authlib/authdaemond.mysql
530 %{_mandir}/man8/authmysql*
535 %defattr(644,root,root,755)
536 %attr(640,root,root) %config(noreplace) %verify(not size mtime md5) %{_sysconfdir}/authpgsqlrc
537 %attr(755,root,root) %{_libexecdir}/authlib/authdaemond.pgsql
538 %{_mandir}/man8/authpgsql*