5 %bcond_without ldap # without LDAP support
6 %bcond_without mysql # without MySQL support
7 %bcond_without pgsql # without PostgreSQL support
9 Summary: Courier-IMAP server
10 Summary(pl): Serwer Courier-IMAP
15 Group: Networking/Daemons
16 Source0: http://dl.sourceforge.net/courier/%{name}-%{version}.tar.bz2
17 # Source0-md5: 9061583ef8e7b3fd69ef77dbfc0656eb
19 Source2: %{name}-pop3.init
21 Source4: %{name}-pop3.pamd
22 Patch0: %{name}-dirs.patch
23 Patch1: %{name}-certsdir.patch
24 Patch2: %{name}-maildir.patch
25 URL: http://www.courier-mta.org/imap/
26 BuildRequires: autoconf >= 2.54
27 BuildRequires: automake
28 BuildRequires: fam-devel
29 BuildRequires: gdbm-devel
30 BuildRequires: libstdc++-devel
31 BuildRequires: courier-authlib-devel
32 %{?with_mysql:BuildRequires: mysql-devel}
33 %{?with_ldap:BuildRequires: openldap-devel}
34 BuildRequires: openssl-devel >= 0.9.7d
35 %{?with_pgsql:BuildRequires: postgresql-devel}
37 BuildRequires: sed >= 4.0
38 BuildRequires: sysconftool
39 %{?with_mysql:BuildRequires: zlib-devel}
40 PreReq: %{name}-common = %{version}-%{release}
42 Requires(post,preun): /sbin/chkconfig
43 Requires: pam >= 0.77.3
46 Conflicts: cyrus-imapd
48 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
50 %define _libexecdir /usr/%{_lib}/courier-imap
51 %define _sysconfdir /etc/courier-imap
52 %define _certsdir %{_sysconfdir}/certs
53 %define _localstatedir /var/spool/courier-imap
56 Courier-IMAP is an IMAP server for Maildir mailboxes.
59 Courier-IMAP jest serwerem IMAP dla skrzynek pocztowych Maildir.
62 Summary: Common files for imap and pop3 daemons
63 Summary(pl): Pliki wspólne dla serwerów imap i pop3
64 Group: Networking/Daemons
66 Requires(post,preun): /sbin/chkconfig
70 Common files for imap and pop3 daemons.
72 %description common -l pl
73 Pliki wspólne dla serwerów imap i pop3.
76 Summary: Commands used to create the /etc/userdb.dat
77 Summary(pl): Polecenia do tworzenia /etc/userdb.dat
78 Group: Networking/Daemons
81 Commands used to create the /etc/userdb.dat.
83 %description userdb -l pl
84 Polecenia u¿ywane do stworzenia /etc/userdb.dat.
87 Summary: Deliver to a Maildir with a quota
88 Summary(pl): Obs³uga quoty przy dostarczaniu poczty do skrzynek Maildir
89 Group: Networking/Daemons
91 %description deliverquota
92 deliverquota is a temporary hack to implement E-mail delivery to a
93 Maildir with a software-imposed quota.
95 %description deliverquota -l pl
96 deliverquota jest tymczasowym rozwi±zaniem implementuj±cym
97 dostarczanie e-maili do skrzynek Maildir z programowo narzucon± quot±.
100 Summary: Tool for making mail folders in Maildir format
101 Summary(pl): Narzêdzie do tworzenia folderów w formacie Maildir
102 Group: Networking/Daemons
103 Conflicts: qmail-maildirmake
105 %description maildirmake
106 Maildirmake is a tool for making mail folders in Maildir format.
108 %description maildirmake -l pl
109 Maildirmake jest narzêdziem do tworzenia folderów pocztowych w
113 Summary: Courier-IMAP POP3 Server
114 Summary(pl): Serwer Courier-IMAP POP3
115 Group: Networking/Daemons
116 PreReq: %{name}-common = %{version}-%{release}
117 Requires: pam >= 0.77.3
119 Obsoletes: pop3daemon
120 Conflicts: cyrus-imapd
122 Conflicts: solid-pop3d
126 Courier-IMAP POP3 is an POP3 server for Maildir mailboxes.
128 %description pop3 -l pl
129 Courier-IMAP POP3 jest serwerem POP3 dla skrzynek pocztowych Maildir.
132 Summary: LDAP authentication daemon for Courier IMAP
133 Summary(pl): Demon autentykacji LDAP do Courier IMAP
134 Group: Networking/Daemons
135 PreReq: %{name}-common = %{version}-%{release}
137 %description authldap
138 This package provides LDAP authentication for Courier IMAP.
140 %description authldap -l pl
141 Ten pakiet pozwala na korzystanie z autentykacji LDAP w Courier IMAP.
144 Summary: MySQL authentication daemon for Courier IMAP
145 Summary(pl): Demon autentykacji MySQL do Courier IMAP
146 Group: Networking/Daemons
147 PreReq: %{name}-common = %{version}-%{release}
150 %description authmysql
151 This package provides MySQL authentication for Courier IMAP.
153 %description authmysql -l pl
154 Ten pakiet pozwala na korzystanie z autentykacji MySQL w Courier IMAP.
157 Summary: PostgreSQL authentication daemon for Courier IMAP
158 Summary(pl): Demon autentykacji PostgreSQL do Courier IMAP
159 Group: Networking/Daemons
160 PreReq: %{name}-common = %{version}-%{release}
162 %description authpgsql
163 This package provides PostgreSQL authentication for Courier IMAP.
165 %description authpgsql -l pl
166 Ten pakiet pozwala na korzystanie z autentykacji PostgreSQL w Courier
175 install %{SOURCE1} courier-imap.in
176 install %{SOURCE2} courier-pop3.in
179 cp -f /usr/share/automake/config.sub .
180 cp -f /usr/share/automake/config.sub maildir
188 --with-authchangepwdir=/var/tmp \
189 --with-authdaemonvar=/var/lib/authdaemon \
190 --with-certsdir=%{_certsdir} \
191 %{?with_mysql:--with-mysql-libs=%{_libdir} --with-mysql-includes=%{_includedir}/mysql} \
192 %{!?with_mysql:--without-authmysql} \
193 %{?with_pgsql:--with-pgsql-libs=%{_libdir} --with-pgsql-includes=%{_includedir}/postgresql} \
194 %{!?with_pgsql:--without-authpgsql} \
195 %{!?with_ldap:--without-authldap}
200 rm -rf $RPM_BUILD_ROOT
201 install -d $RPM_BUILD_ROOT{/etc/{pam.d,rc.d/init.d,security},%{_certsdir}}
204 DESTDIR=$RPM_BUILD_ROOT
206 install courier-imap $RPM_BUILD_ROOT/etc/rc.d/init.d/courier-imap
207 install courier-pop3 $RPM_BUILD_ROOT/etc/rc.d/init.d/courier-pop3
208 install %{SOURCE3} $RPM_BUILD_ROOT/etc/pam.d/imap
209 install %{SOURCE4} $RPM_BUILD_ROOT/etc/pam.d/pop3
211 rm -rf $RPM_BUILD_ROOT%{_mandir}/man8/{authcram,authpam,authpwd,authshadow,authuserdb,authvchkpw,pw2userdb,vchkpw2userdb,authdaemon,authdaemond,authldap,authmysql}.8 \
212 $RPM_BUILD_ROOT%{_sbindir}/{*db,mk*cert}
214 mv -f authlib/README.authmysql.html README.authmysql.html
215 mv -f authlib/README.ldap README.ldap
216 mv -f authlib/README.authmysql.myownquery README.authmysql.myownquery
217 mv -f imap/README README.imap
218 mv -f imap/ChangeLog ChangeLog
219 mv -f maildir/README.maildirquota.txt README.maildirquota
221 install authlib/authdaemonrc $RPM_BUILD_ROOT%{_sysconfdir}
222 install authlib/authldaprc $RPM_BUILD_ROOT%{_sysconfdir}
223 install authlib/authmysqlrc $RPM_BUILD_ROOT%{_sysconfdir}
224 install authlib/authpgsqlrc $RPM_BUILD_ROOT%{_sysconfdir}
226 mv -f $RPM_BUILD_ROOT%{_datadir}/*db \
227 $RPM_BUILD_ROOT%{_sbindir}
228 mv -f $RPM_BUILD_ROOT%{_datadir}/mk*cert \
229 $RPM_BUILD_ROOT%{_sbindir}
231 mv -f tcpd/couriertls.1 $RPM_BUILD_ROOT%{_mandir}/man8/couriertls.8
232 mv -f imap/courierpop3d.8 $RPM_BUILD_ROOT%{_mandir}/man8/courierpop3d.8
234 echo ".so man7/authlib.7" >$RPM_BUILD_ROOT%{_mandir}/man8/authcram.8
235 echo ".so man7/authlib.7" >$RPM_BUILD_ROOT%{_mandir}/man8/authpam.8
236 echo ".so man7/authlib.7" >$RPM_BUILD_ROOT%{_mandir}/man8/authpwd.8
237 echo ".so man7/authlib.7" >$RPM_BUILD_ROOT%{_mandir}/man8/authshadow.8
238 echo ".so man7/authlib.7" >$RPM_BUILD_ROOT%{_mandir}/man8/authuserdb.8
239 echo ".so man7/authlib.7" >$RPM_BUILD_ROOT%{_mandir}/man8/authvchkpw.8
240 echo ".so man7/authlib.7" >$RPM_BUILD_ROOT%{_mandir}/man8/authdaemon.8
241 echo ".so man7/authlib.7" >$RPM_BUILD_ROOT%{_mandir}/man8/authdaemond.8
242 %{?with_pgsql:echo ".so man7/authlib.7" >$RPM_BUILD_ROOT%{_mandir}/man8/authpgsql.8}
243 %{?with_mysql:echo ".so man7/authlib.7" >$RPM_BUILD_ROOT%{_mandir}/man8/authmysql.8}
244 %{?with_ldap:echo ".so man7/authlib.7" >$RPM_BUILD_ROOT%{_mandir}/man8/authldap.8}
245 echo ".so makeuserdb.8" >$RPM_BUILD_ROOT%{_mandir}/man8/pw2userdb.8
246 echo ".so makeuserdb.8" >$RPM_BUILD_ROOT%{_mandir}/man8/vchkpw2userdb.8
248 touch $RPM_BUILD_ROOT/etc/security/blacklist.{pop3,imap}
251 ./sysconftool $RPM_BUILD_ROOT%{_sysconfdir}/*.dist
253 # set yes to start imapd and pop3d
254 sed -i 's/^POP3DSTART.*/POP3DSTART=YES/' $RPM_BUILD_ROOT%{_sysconfdir}/pop3d
255 sed -i 's/^IMAPDSTART.*/IMAPDSTART=YES/' $RPM_BUILD_ROOT%{_sysconfdir}/imapd
257 # remove unpackaged files
258 rm -f $RPM_BUILD_ROOT%{_sysconfdir}/*.dist
261 rm -rf $RPM_BUILD_ROOT
264 /sbin/chkconfig --add courier-imap
266 if [ -f /var/lock/subsys/courier-imap ]; then
267 /etc/rc.d/init.d/courier-imap restart >&2
269 echo "Run \"/etc/rc.d/init.d/courier-imap start\" to start courier-imap daemon."
273 if [ "$1" = "0" ]; then
274 if [ -f /var/lock/subsys/courier-imap ]; then
275 /etc/rc.d/init.d/courier-imap stop >&2
277 /sbin/chkconfig --del courier-imap
280 %triggerin -- %{name} < 3.0.5
281 if [ -f /var/lib/openssl/certs/imapd.pem ]; then
283 echo imapd.pem has been moved automatically to %{_certsdir}
285 mv -f /var/lib/openssl/certs/imapd.pem %{_certsdir}
287 if [ -f /etc/sysconfig/courier-imap ]; then
288 . /etc/sysconfig/courier-imap
289 for opt in `grep ^[^#] /etc/sysconfig/courier-imap |grep -v TLS_CERTFILE |grep -v MAILDIR |grep -v COURIERTLS |cut -d= -f1`;
292 sed -i s/^$opt=.*/"$opt=\"$opt2\""/ %{_sysconfdir}/imapd
293 sed -i s/^$opt=.*/"$opt=\"$opt2\""/ %{_sysconfdir}/imapd-ssl
295 sed -i s/^SSLADDRESS=.*/"SSLADDRESS=$ADDRESS_SSL"/ %{_sysconfdir}/imapd-ssl
296 sed -i s/^SSLPORT=.*/"SSLPORT=$PORTS_SSL"/ %{_sysconfdir}/imapd-ssl
297 sed -i s!^MAILDIRPATH=.*!"MAILDIRPATH=\"$MAILDIR\""! %{_sysconfdir}/imapd-ssl
298 sed -i s!^MAILDIRPATH=.*!"MAILDIRPATH=\"$MAILDIR\""! %{_sysconfdir}/imapd
300 echo IMAPD config file has been rewriten to %{_sysconfdir}/imapd,imapd-ssl
301 echo please look at them
304 if [ -f /var/lock/subsys/courier-imap ]; then
305 /etc/rc.d/init.d/courier-imap restart >&2
308 %triggerin -- %{name} < 3.0.6
309 . %{_sysconfdir}/imapd-ssl
310 if [ $TLS_CACHEFILE = "/var/couriersslcache" ]; then
311 sed -i s/^TLS_CACHEFILE=.*/"TLS_CACHEFILE=\/var\/spool\/courier-imap\/couriersslcache"/ %{_sysconfdir}/imapd-ssl
314 %triggerin -n %{name}-common -- %{name}-common < 3.0.5
315 /sbin/chkconfig --del authdaemon
316 if [ -f /var/lock/subsys/authdaemon ]; then
317 kill `cat /var/lib/authdaemon/pid`
318 rm -f /var/lock/subsys/authdaemon
320 if [ -f /etc/sysconfig/authdaemon ]; then
321 . /etc/sysconfig/authdaemon
322 sed -i s/^version.*/version=authdaemond.$METHOD/ %{_sysconfdir}/authdaemonrc
325 echo Changes to version 3.0.5 :
326 echo - config files has been splited and moved to %{_sysconfdir}
327 echo - certificates directory has changed to %{_certsdir}
331 /sbin/chkconfig --add courier-pop3
332 /sbin/chkconfig --del courier-imap-pop3 >/dev/null 2>&1 || :
333 if [ -f /var/lock/subsys/courier-imap-pop3 ]; then
334 /etc/rc.d/init.d/courier-imap-pop3 stop >&2
335 /etc/rc.d/init.d/courier-pop3 start >&2
336 elif [ -f /var/lock/subsys/courier-pop3 ]; then
337 /etc/rc.d/init.d/courier-pop3 restart >&2
339 echo "Run \"/etc/rc.d/init.d/courier-pop3 start\" to start courier-pop3 daemon."
343 if [ "$1" = "0" ]; then
344 if [ -f /var/lock/subsys/courier-pop3 ]; then
345 /etc/rc.d/init.d/courier-pop3 stop >&2
347 /sbin/chkconfig --del courier-pop3
350 %triggerin -n %{name}-pop3 -- %{name}-pop3 < 3.0.5
351 if [ -f /var/lib/openssl/certs/pop3d.pem ]; then
353 echo pop3d.pem has been moved automatically to %{_certsdir}
355 mv -f /var/lib/openssl/certs/pop3d.pem %{_certsdir}
357 if [ -f /etc/sysconfig/courier-pop3 ]; then
358 . /etc/sysconfig/courier-pop3
359 for opt in `grep ^[^#] /etc/sysconfig/courier-pop3 |grep -v TLS_CERTFILE |grep -v MAILDIR |grep -v COURIERTLS |cut -d= -f1`;
362 sed -i s/^$opt=.*/"$opt=\"$opt2\""/ %{_sysconfdir}/pop3d
363 sed -i s/^$opt=.*/"$opt=\"$opt2\""/ %{_sysconfdir}/pop3d-ssl
365 sed -i s!^MAILDIRPATH=.*!"MAILDIRPATH=\"$MAILDIR\""! %{_sysconfdir}/pop3d-ssl
366 sed -i s!^MAILDIRPATH=.*!"MAILDIRPATH=\"$MAILDIR\""! %{_sysconfdir}/pop3d
368 echo POP3D config file has been rewriten to %{_sysconfdir}/{pop3d,pop3d-ssl}
369 echo please look at them
372 if [ -f /var/lock/subsys/courier-pop3 ]; then
373 /etc/rc.d/init.d/courier-pop3 restart >&2
376 %triggerin -n %{name}-pop3 -- %{name}-pop3 < 3.0.6
377 . %{_sysconfdir}/pop3d-ssl
378 if [ $TLS_CACHEFILE = "/var/couriersslcache" ]; then
379 sed -i s/^TLS_CACHEFILE=.*/"TLS_CACHEFILE=\/var\/spool\/courier-imap\/couriersslcache"/ %{_sysconfdir}/pop3d-ssl
383 if ps -A |grep -q authdaemond.lda; then
384 %{_libexecdir}/authlib/authdaemond stop
385 %{_libexecdir}/authlib/authdaemond start
389 if [ -x %{_libexecdir}/authlib/authdaemond ]; then
390 if ps -A |grep -q authdaemond.lda; then
391 %{_libexecdir}/authlib/authdaemond stop;
392 %{_libexecdir}/authlib/authdaemond start;
397 if ps -A |grep -q authdaemond.mys; then
398 %{_libexecdir}/authlib/authdaemond stop
399 %{_libexecdir}/authlib/authdaemond start
403 if [ -x %{_libexecdir}/authlib/authdaemond ]; then
404 if ps -A |grep -q authdaemond.mys; then
405 %{_libexecdir}/authlib/authdaemond stop;
406 %{_libexecdir}/authlib/authdaemond start;
411 if ps -A |grep -q authdaemond.pgs; then
412 %{_libexecdir}/authlib/authdaemond stop
413 %{_libexecdir}/authlib/authdaemond start
417 if [ -x %{_libexecdir}/authlib/authdaemond ]; then
418 if ps -A |grep -q authdaemond.pgs; then
419 %{_libexecdir}/authlib/authdaemond stop;
420 %{_libexecdir}/authlib/authdaemond start;
425 %defattr(644,root,root,755)
426 %doc maildir/README.sharedfolders.html
427 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/pam.d/imap
428 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/security/blacklist.imap
429 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/imapd
430 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/imapd-ssl
431 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/imapd.cnf
432 %attr(754,root,root) /etc/rc.d/init.d/courier-imap
433 %attr(755,daemon,daemon) %dir %{_sysconfdir}/shared
434 %attr(755,daemon,daemon) %dir %{_sysconfdir}/shared.tmp
435 %attr(755,root,root) %{_bindir}/imapd
436 %attr(755,root,root) %{_bindir}/maildiracl
437 %attr(755,root,root) %{_bindir}/maildirkw
438 %attr(755,root,root) %{_sbindir}/authenumerate
439 %attr(755,root,root) %{_sbindir}/imaplogin
440 %attr(755,root,root) %{_sbindir}/mkimapdcert
441 %attr(755,root,root) %{_sbindir}/sharedindexinstall
442 %attr(755,root,root) %{_sbindir}/sharedindexsplit
443 %attr(755,root,root) %{_libexecdir}/imapd.rc
444 %attr(755,root,root) %{_libexecdir}/imapd-ssl.rc
445 %{_mandir}/man8/imapd*
446 %{_mandir}/man1/maildiracl.1*
447 %{_mandir}/man1/maildirkw.1*
450 %defattr(644,root,root,755)
451 %doc AUTHORS ChangeLog imap/BUGS INSTALL README*
452 %attr(770,daemon,daemon) /var/lib/authdaemon
453 %attr(750,root,root) %dir %{_sysconfdir}
454 %attr(750,root,root) %dir %{_certsdir}
455 %attr(770,daemon,daemon) %dir %{_localstatedir}
457 %dir %{_libexecdir}/authlib
458 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/authdaemonrc
459 %{_sysconfdir}/quotawarnmsg.example
460 %attr(755,root,root) %{_bindir}/couriertls
461 %attr(755,root,root) %{_libexecdir}/authlib/authdaemon
462 %attr(755,root,root) %{_libexecdir}/authlib/authdaemond
463 %attr(755,root,root) %{_libexecdir}/authlib/authdaemond.plain
464 %attr(755,root,root) %{_libexecdir}/couriertcpd
465 %attr(755,root,root) %{_libexecdir}/makedatprog
466 %attr(755,root,root) %{_sbindir}/courierlogger
467 %{_mandir}/man8/auth[cdsuv]*
468 %{_mandir}/man8/authp[aw]*
469 %{_mandir}/man7/authlib*
470 %{_mandir}/man1/courierlogger*
471 %{_mandir}/man1/couriert*
472 %{_mandir}/man8/couriert*
476 %defattr(644,root,root,755)
477 %attr(755,root,root) %{_sbindir}/makeuserdb
478 %attr(755,root,root) %{_sbindir}/pw2userdb
479 %attr(755,root,root) %{_sbindir}/userdb
480 %attr(755,root,root) %{_sbindir}/userdbpw
481 %attr(755,root,root) %{_sbindir}/vchkpw2userdb
482 %{_mandir}/man8/makeuserdb*
483 %{_mandir}/man8/userdb*
484 %{_mandir}/man8/*pw2userdb*
487 %defattr(644,root,root,755)
488 %attr(755,root,root) %{_bindir}/deliverquota
489 %{_mandir}/man8/deliverquota*
492 %defattr(644,root,root,755)
493 %attr(755,root,root) %{_bindir}/maildirmake
494 %{_mandir}/man1/maildirmake*
497 %defattr(644,root,root,755)
498 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/pam.d/pop3
499 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/security/blacklist.pop3
500 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/pop3d
501 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/pop3d-ssl
502 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/pop3d.cnf
503 %attr(754,root,root) /etc/rc.d/init.d/courier-pop3
504 %attr(755,root,root) %{_bindir}/pop3d
505 %attr(755,root,root) %{_sbindir}/mkpop3dcert
506 %attr(755,root,root) %{_sbindir}/pop3login
507 %attr(755,root,root) %{_libexecdir}/pop3d.rc
508 %attr(755,root,root) %{_libexecdir}/pop3d-ssl.rc
509 %{_mandir}/man8/courierpop*
513 %defattr(644,root,root,755)
514 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/authldaprc
515 %attr(755,root,root) %{_libexecdir}/authlib/authdaemond.ldap
516 %{_mandir}/man8/authldap*
521 %defattr(644,root,root,755)
522 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/authmysqlrc
523 %attr(755,root,root) %{_libexecdir}/authlib/authdaemond.mysql
524 %{_mandir}/man8/authmysql*
529 %defattr(644,root,root,755)
530 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/authpgsqlrc
531 %attr(755,root,root) %{_libexecdir}/authlib/authdaemond.pgsql
532 %{_mandir}/man8/authpgsql*