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: 9061583ef8e7b3fd69ef77dbfc0656eb
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.courier-mta.org/imap/
24 BuildRequires: autoconf >= 2.54
25 BuildRequires: automake
26 BuildRequires: fam-devel
27 BuildRequires: gdbm-devel
28 BuildRequires: libstdc++-devel
29 %{?with_mysql:BuildRequires: mysql-devel}
30 %{?with_ldap:BuildRequires: openldap-devel}
31 BuildRequires: openssl-devel >= 0.9.7d
32 %{?with_pgsql:BuildRequires: postgresql-devel}
34 BuildRequires: sed >= 4.0
35 BuildRequires: sysconftool
36 %{?with_mysql:BuildRequires: zlib-devel}
37 PreReq: %{name}-common = %{version}-%{release}
39 Requires(post,preun): /sbin/chkconfig
40 Requires: pam >= 0.77.3
43 Conflicts: cyrus-imapd
45 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
47 %define _libexecdir /usr/%{_lib}/courier-imap
48 %define _sysconfdir /etc/courier-imap
49 %define _certsdir %{_sysconfdir}/certs
50 %define _localstatedir /var/spool/courier-imap
53 Courier-IMAP is an IMAP server for Maildir mailboxes.
56 Courier-IMAP jest serwerem IMAP dla skrzynek pocztowych Maildir.
59 Summary: Common files for imap and pop3 daemons
60 Summary(pl): Pliki wspólne dla serwerów imap i pop3
61 Group: Networking/Daemons
63 Requires(post,preun): /sbin/chkconfig
67 Common files for imap and pop3 daemons.
69 %description common -l pl
70 Pliki wspólne dla serwerów imap i pop3.
73 Summary: Commands used to create the /etc/userdb.dat
74 Summary(pl): Polecenia do tworzenia /etc/userdb.dat
75 Group: Networking/Daemons
78 Commands used to create the /etc/userdb.dat.
80 %description userdb -l pl
81 Polecenia u¿ywane do stworzenia /etc/userdb.dat.
84 Summary: Deliver to a Maildir with a quota
85 Summary(pl): Obs³uga quoty przy dostarczaniu poczty do skrzynek Maildir
86 Group: Networking/Daemons
88 %description deliverquota
89 deliverquota is a temporary hack to implement E-mail delivery to a
90 Maildir with a software-imposed quota.
92 %description deliverquota -l pl
93 deliverquota jest tymczasowym rozwi±zaniem implementuj±cym
94 dostarczanie e-maili do skrzynek Maildir z programowo narzucon± quot±.
97 Summary: Tool for making mail folders in Maildir format
98 Summary(pl): Narzêdzie do tworzenia folderów w formacie Maildir
99 Group: Networking/Daemons
100 Conflicts: qmail-maildirmake
102 %description maildirmake
103 Maildirmake is a tool for making mail folders in Maildir format.
105 %description maildirmake -l pl
106 Maildirmake jest narzêdziem do tworzenia folderów pocztowych w
110 Summary: Courier-IMAP POP3 Server
111 Summary(pl): Serwer Courier-IMAP POP3
112 Group: Networking/Daemons
113 PreReq: %{name}-common = %{version}-%{release}
114 Requires: pam >= 0.77.3
116 Obsoletes: pop3daemon
117 Conflicts: cyrus-imapd
119 Conflicts: solid-pop3d
123 Courier-IMAP POP3 is an POP3 server for Maildir mailboxes.
125 %description pop3 -l pl
126 Courier-IMAP POP3 jest serwerem POP3 dla skrzynek pocztowych Maildir.
129 Summary: LDAP authentication daemon for Courier IMAP
130 Summary(pl): Demon autentykacji LDAP do Courier IMAP
131 Group: Networking/Daemons
132 PreReq: %{name}-common = %{version}-%{release}
134 %description authldap
135 This package provides LDAP authentication for Courier IMAP.
137 %description authldap -l pl
138 Ten pakiet pozwala na korzystanie z autentykacji LDAP w Courier IMAP.
141 Summary: MySQL authentication daemon for Courier IMAP
142 Summary(pl): Demon autentykacji MySQL do Courier IMAP
143 Group: Networking/Daemons
144 PreReq: %{name}-common = %{version}-%{release}
147 %description authmysql
148 This package provides MySQL authentication for Courier IMAP.
150 %description authmysql -l pl
151 Ten pakiet pozwala na korzystanie z autentykacji MySQL w Courier IMAP.
154 Summary: PostgreSQL authentication daemon for Courier IMAP
155 Summary(pl): Demon autentykacji PostgreSQL do Courier IMAP
156 Group: Networking/Daemons
157 PreReq: %{name}-common = %{version}-%{release}
159 %description authpgsql
160 This package provides PostgreSQL authentication for Courier IMAP.
162 %description authpgsql -l pl
163 Ten pakiet pozwala na korzystanie z autentykacji PostgreSQL w Courier
172 install %{SOURCE1} courier-imap.in
173 install %{SOURCE2} courier-pop3.in
176 cp -f /usr/share/automake/config.sub .
177 cp -f /usr/share/automake/config.sub maildir
195 --with-authchangepwdir=/var/tmp \
196 --with-authdaemonvar=/var/lib/authdaemon \
197 --with-certsdir=%{_certsdir} \
198 %{?with_mysql:--with-mysql-libs=%{_libdir} --with-mysql-includes=%{_includedir}/mysql} \
199 %{!?with_mysql:--without-authmysql} \
200 %{?with_pgsql:--with-pgsql-libs=%{_libdir} --with-pgsql-includes=%{_includedir}/postgresql} \
201 %{!?with_pgsql:--without-authpgsql} \
202 %{!?with_ldap:--without-authldap}
207 rm -rf $RPM_BUILD_ROOT
208 install -d $RPM_BUILD_ROOT{/etc/{pam.d,rc.d/init.d,security},%{_certsdir}}
211 DESTDIR=$RPM_BUILD_ROOT
213 install courier-imap $RPM_BUILD_ROOT/etc/rc.d/init.d/courier-imap
214 install courier-pop3 $RPM_BUILD_ROOT/etc/rc.d/init.d/courier-pop3
215 install %{SOURCE3} $RPM_BUILD_ROOT/etc/pam.d/imap
216 install %{SOURCE4} $RPM_BUILD_ROOT/etc/pam.d/pop3
218 rm -rf $RPM_BUILD_ROOT%{_mandir}/man8/{authcram,authpam,authpwd,authshadow,authuserdb,authvchkpw,pw2userdb,vchkpw2userdb,authdaemon,authdaemond,authldap,authmysql}.8 \
219 $RPM_BUILD_ROOT%{_sbindir}/{*db,mk*cert}
221 mv -f authlib/README.authmysql.html README.authmysql.html
222 mv -f authlib/README.ldap README.ldap
223 mv -f authlib/README.authmysql.myownquery README.authmysql.myownquery
224 mv -f imap/README README.imap
225 mv -f imap/ChangeLog ChangeLog
226 mv -f maildir/README.maildirquota.txt README.maildirquota
228 install authlib/authdaemonrc $RPM_BUILD_ROOT%{_sysconfdir}
229 install authlib/authldaprc $RPM_BUILD_ROOT%{_sysconfdir}
230 install authlib/authmysqlrc $RPM_BUILD_ROOT%{_sysconfdir}
231 install authlib/authpgsqlrc $RPM_BUILD_ROOT%{_sysconfdir}
233 mv -f $RPM_BUILD_ROOT%{_datadir}/*db \
234 $RPM_BUILD_ROOT%{_sbindir}
235 mv -f $RPM_BUILD_ROOT%{_datadir}/mk*cert \
236 $RPM_BUILD_ROOT%{_sbindir}
238 mv -f tcpd/couriertls.1 $RPM_BUILD_ROOT%{_mandir}/man8/couriertls.8
239 mv -f imap/courierpop3d.8 $RPM_BUILD_ROOT%{_mandir}/man8/courierpop3d.8
241 echo ".so man7/authlib.7" >$RPM_BUILD_ROOT%{_mandir}/man8/authcram.8
242 echo ".so man7/authlib.7" >$RPM_BUILD_ROOT%{_mandir}/man8/authpam.8
243 echo ".so man7/authlib.7" >$RPM_BUILD_ROOT%{_mandir}/man8/authpwd.8
244 echo ".so man7/authlib.7" >$RPM_BUILD_ROOT%{_mandir}/man8/authshadow.8
245 echo ".so man7/authlib.7" >$RPM_BUILD_ROOT%{_mandir}/man8/authuserdb.8
246 echo ".so man7/authlib.7" >$RPM_BUILD_ROOT%{_mandir}/man8/authvchkpw.8
247 echo ".so man7/authlib.7" >$RPM_BUILD_ROOT%{_mandir}/man8/authdaemon.8
248 echo ".so man7/authlib.7" >$RPM_BUILD_ROOT%{_mandir}/man8/authdaemond.8
249 %{?with_pgsql:echo ".so man7/authlib.7" >$RPM_BUILD_ROOT%{_mandir}/man8/authpgsql.8}
250 %{?with_mysql:echo ".so man7/authlib.7" >$RPM_BUILD_ROOT%{_mandir}/man8/authmysql.8}
251 %{?with_ldap:echo ".so man7/authlib.7" >$RPM_BUILD_ROOT%{_mandir}/man8/authldap.8}
252 echo ".so makeuserdb.8" >$RPM_BUILD_ROOT%{_mandir}/man8/pw2userdb.8
253 echo ".so makeuserdb.8" >$RPM_BUILD_ROOT%{_mandir}/man8/vchkpw2userdb.8
255 touch $RPM_BUILD_ROOT/etc/security/blacklist.{pop3,imap}
258 ./sysconftool $RPM_BUILD_ROOT%{_sysconfdir}/*.dist
260 # set yes to start imapd and pop3d
261 sed -i 's/^POP3DSTART.*/POP3DSTART=YES/' $RPM_BUILD_ROOT%{_sysconfdir}/pop3d
262 sed -i 's/^IMAPDSTART.*/IMAPDSTART=YES/' $RPM_BUILD_ROOT%{_sysconfdir}/imapd
264 # remove unpackaged files
265 rm -f $RPM_BUILD_ROOT%{_sysconfdir}/*.dist
268 rm -rf $RPM_BUILD_ROOT
271 /sbin/chkconfig --add courier-imap
273 if [ -f /var/lock/subsys/courier-imap ]; then
274 /etc/rc.d/init.d/courier-imap restart >&2
276 echo "Run \"/etc/rc.d/init.d/courier-imap start\" to start courier-imap daemon."
280 if [ "$1" = "0" ]; then
281 if [ -f /var/lock/subsys/courier-imap ]; then
282 /etc/rc.d/init.d/courier-imap stop >&2
284 /sbin/chkconfig --del courier-imap
287 %triggerin -- %{name} < 3.0.5
288 if [ -f /var/lib/openssl/certs/imapd.pem ]; then
290 echo imapd.pem has been moved automatically to %{_certsdir}
292 mv -f /var/lib/openssl/certs/imapd.pem %{_certsdir}
294 if [ -f /etc/sysconfig/courier-imap ]; then
295 . /etc/sysconfig/courier-imap
296 for opt in `grep ^[^#] /etc/sysconfig/courier-imap |grep -v TLS_CERTFILE |grep -v MAILDIR |grep -v COURIERTLS |cut -d= -f1`;
299 sed -i s/^$opt=.*/"$opt=\"$opt2\""/ %{_sysconfdir}/imapd
300 sed -i s/^$opt=.*/"$opt=\"$opt2\""/ %{_sysconfdir}/imapd-ssl
302 sed -i s/^SSLADDRESS=.*/"SSLADDRESS=$ADDRESS_SSL"/ %{_sysconfdir}/imapd-ssl
303 sed -i s/^SSLPORT=.*/"SSLPORT=$PORTS_SSL"/ %{_sysconfdir}/imapd-ssl
304 sed -i s!^MAILDIRPATH=.*!"MAILDIRPATH=\"$MAILDIR\""! %{_sysconfdir}/imapd-ssl
305 sed -i s!^MAILDIRPATH=.*!"MAILDIRPATH=\"$MAILDIR\""! %{_sysconfdir}/imapd
307 echo IMAPD config file has been rewriten to %{_sysconfdir}/imapd,imapd-ssl
308 echo please look at them
311 if [ -f /var/lock/subsys/courier-imap ]; then
312 /etc/rc.d/init.d/courier-imap restart >&2
315 %triggerin -- %{name} < 3.0.6
316 . %{_sysconfdir}/imapd-ssl
317 if [ $TLS_CACHEFILE = "/var/couriersslcache" ]; then
318 sed -i s/^TLS_CACHEFILE=.*/"TLS_CACHEFILE=\/var\/spool\/courier-imap\/couriersslcache"/ %{_sysconfdir}/imapd-ssl
321 %triggerin -n %{name}-common -- %{name}-common < 3.0.5
322 /sbin/chkconfig --del authdaemon
323 if [ -f /var/lock/subsys/authdaemon ]; then
324 kill `cat /var/lib/authdaemon/pid`
325 rm -f /var/lock/subsys/authdaemon
327 if [ -f /etc/sysconfig/authdaemon ]; then
328 . /etc/sysconfig/authdaemon
329 sed -i s/^version.*/version=authdaemond.$METHOD/ %{_sysconfdir}/authdaemonrc
332 echo Changes to version 3.0.5 :
333 echo - config files has been splited and moved to %{_sysconfdir}
334 echo - certificates directory has changed to %{_certsdir}
338 /sbin/chkconfig --add courier-pop3
339 /sbin/chkconfig --del courier-imap-pop3 >/dev/null 2>&1 || :
340 if [ -f /var/lock/subsys/courier-imap-pop3 ]; then
341 /etc/rc.d/init.d/courier-imap-pop3 stop >&2
342 /etc/rc.d/init.d/courier-pop3 start >&2
343 elif [ -f /var/lock/subsys/courier-pop3 ]; then
344 /etc/rc.d/init.d/courier-pop3 restart >&2
346 echo "Run \"/etc/rc.d/init.d/courier-pop3 start\" to start courier-pop3 daemon."
350 if [ "$1" = "0" ]; then
351 if [ -f /var/lock/subsys/courier-pop3 ]; then
352 /etc/rc.d/init.d/courier-pop3 stop >&2
354 /sbin/chkconfig --del courier-pop3
357 %triggerin -n %{name}-pop3 -- %{name}-pop3 < 3.0.5
358 if [ -f /var/lib/openssl/certs/pop3d.pem ]; then
360 echo pop3d.pem has been moved automatically to %{_certsdir}
362 mv -f /var/lib/openssl/certs/pop3d.pem %{_certsdir}
364 if [ -f /etc/sysconfig/courier-pop3 ]; then
365 . /etc/sysconfig/courier-pop3
366 for opt in `grep ^[^#] /etc/sysconfig/courier-pop3 |grep -v TLS_CERTFILE |grep -v MAILDIR |grep -v COURIERTLS |cut -d= -f1`;
369 sed -i s/^$opt=.*/"$opt=\"$opt2\""/ %{_sysconfdir}/pop3d
370 sed -i s/^$opt=.*/"$opt=\"$opt2\""/ %{_sysconfdir}/pop3d-ssl
372 sed -i s!^MAILDIRPATH=.*!"MAILDIRPATH=\"$MAILDIR\""! %{_sysconfdir}/pop3d-ssl
373 sed -i s!^MAILDIRPATH=.*!"MAILDIRPATH=\"$MAILDIR\""! %{_sysconfdir}/pop3d
375 echo POP3D config file has been rewriten to %{_sysconfdir}/{pop3d,pop3d-ssl}
376 echo please look at them
379 if [ -f /var/lock/subsys/courier-pop3 ]; then
380 /etc/rc.d/init.d/courier-pop3 restart >&2
383 %triggerin -n %{name}-pop3 -- %{name}-pop3 < 3.0.6
384 . %{_sysconfdir}/pop3d-ssl
385 if [ $TLS_CACHEFILE = "/var/couriersslcache" ]; then
386 sed -i s/^TLS_CACHEFILE=.*/"TLS_CACHEFILE=\/var\/spool\/courier-imap\/couriersslcache"/ %{_sysconfdir}/pop3d-ssl
390 if ps -A |grep -q authdaemond.lda; then
391 %{_libexecdir}/authlib/authdaemond stop
392 %{_libexecdir}/authlib/authdaemond start
396 if [ -x %{_libexecdir}/authlib/authdaemond ]; then
397 if ps -A |grep -q authdaemond.lda; then
398 %{_libexecdir}/authlib/authdaemond stop;
399 %{_libexecdir}/authlib/authdaemond start;
404 if ps -A |grep -q authdaemond.mys; then
405 %{_libexecdir}/authlib/authdaemond stop
406 %{_libexecdir}/authlib/authdaemond start
410 if [ -x %{_libexecdir}/authlib/authdaemond ]; then
411 if ps -A |grep -q authdaemond.mys; then
412 %{_libexecdir}/authlib/authdaemond stop;
413 %{_libexecdir}/authlib/authdaemond start;
418 if ps -A |grep -q authdaemond.pgs; then
419 %{_libexecdir}/authlib/authdaemond stop
420 %{_libexecdir}/authlib/authdaemond start
424 if [ -x %{_libexecdir}/authlib/authdaemond ]; then
425 if ps -A |grep -q authdaemond.pgs; then
426 %{_libexecdir}/authlib/authdaemond stop;
427 %{_libexecdir}/authlib/authdaemond start;
432 %defattr(644,root,root,755)
433 %doc maildir/README.sharedfolders.html
434 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/pam.d/imap
435 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/security/blacklist.imap
436 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/imapd
437 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/imapd-ssl
438 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/imapd.cnf
439 %attr(754,root,root) /etc/rc.d/init.d/courier-imap
440 %attr(755,daemon,daemon) %dir %{_sysconfdir}/shared
441 %attr(755,daemon,daemon) %dir %{_sysconfdir}/shared.tmp
442 %attr(755,root,root) %{_bindir}/imapd
443 %attr(755,root,root) %{_bindir}/maildiracl
444 %attr(755,root,root) %{_bindir}/maildirkw
445 %attr(755,root,root) %{_sbindir}/authenumerate
446 %attr(755,root,root) %{_sbindir}/imaplogin
447 %attr(755,root,root) %{_sbindir}/mkimapdcert
448 %attr(755,root,root) %{_sbindir}/sharedindexinstall
449 %attr(755,root,root) %{_sbindir}/sharedindexsplit
450 %attr(755,root,root) %{_libexecdir}/imapd.rc
451 %attr(755,root,root) %{_libexecdir}/imapd-ssl.rc
452 %{_mandir}/man8/imapd*
453 %{_mandir}/man1/maildiracl.1*
454 %{_mandir}/man1/maildirkw.1*
457 %defattr(644,root,root,755)
458 %doc AUTHORS ChangeLog imap/BUGS INSTALL README*
459 %attr(770,daemon,daemon) /var/lib/authdaemon
460 %attr(750,root,root) %dir %{_sysconfdir}
461 %attr(750,root,root) %dir %{_certsdir}
462 %attr(770,daemon,daemon) %dir %{_localstatedir}
464 %dir %{_libexecdir}/authlib
465 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/authdaemonrc
466 %{_sysconfdir}/quotawarnmsg.example
467 %attr(755,root,root) %{_bindir}/couriertls
468 %attr(755,root,root) %{_libexecdir}/authlib/authdaemon
469 %attr(755,root,root) %{_libexecdir}/authlib/authdaemond
470 %attr(755,root,root) %{_libexecdir}/authlib/authdaemond.plain
471 %attr(755,root,root) %{_libexecdir}/couriertcpd
472 %attr(755,root,root) %{_libexecdir}/makedatprog
473 %attr(755,root,root) %{_sbindir}/courierlogger
474 %{_mandir}/man8/auth[cdsuv]*
475 %{_mandir}/man8/authp[aw]*
476 %{_mandir}/man7/authlib*
477 %{_mandir}/man1/courierlogger*
478 %{_mandir}/man1/couriert*
479 %{_mandir}/man8/couriert*
483 %defattr(644,root,root,755)
484 %attr(755,root,root) %{_sbindir}/makeuserdb
485 %attr(755,root,root) %{_sbindir}/pw2userdb
486 %attr(755,root,root) %{_sbindir}/userdb
487 %attr(755,root,root) %{_sbindir}/userdbpw
488 %attr(755,root,root) %{_sbindir}/vchkpw2userdb
489 %{_mandir}/man8/makeuserdb*
490 %{_mandir}/man8/userdb*
491 %{_mandir}/man8/*pw2userdb*
494 %defattr(644,root,root,755)
495 %attr(755,root,root) %{_bindir}/deliverquota
496 %{_mandir}/man8/deliverquota*
499 %defattr(644,root,root,755)
500 %attr(755,root,root) %{_bindir}/maildirmake
501 %{_mandir}/man1/maildirmake*
504 %defattr(644,root,root,755)
505 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/pam.d/pop3
506 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/security/blacklist.pop3
507 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/pop3d
508 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/pop3d-ssl
509 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/pop3d.cnf
510 %attr(754,root,root) /etc/rc.d/init.d/courier-pop3
511 %attr(755,root,root) %{_bindir}/pop3d
512 %attr(755,root,root) %{_sbindir}/mkpop3dcert
513 %attr(755,root,root) %{_sbindir}/pop3login
514 %attr(755,root,root) %{_libexecdir}/pop3d.rc
515 %attr(755,root,root) %{_libexecdir}/pop3d-ssl.rc
516 %{_mandir}/man8/courierpop*
520 %defattr(644,root,root,755)
521 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/authldaprc
522 %attr(755,root,root) %{_libexecdir}/authlib/authdaemond.ldap
523 %{_mandir}/man8/authldap*
528 %defattr(644,root,root,755)
529 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/authmysqlrc
530 %attr(755,root,root) %{_libexecdir}/authlib/authdaemond.mysql
531 %{_mandir}/man8/authmysql*
536 %defattr(644,root,root,755)
537 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/authpgsqlrc
538 %attr(755,root,root) %{_libexecdir}/authlib/authdaemond.pgsql
539 %{_mandir}/man8/authpgsql*