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: f2d3c0d566ea6789192dc3cd5fd8f8fb
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: sysconftool
34 %{?with_mysql:BuildRequires: zlib-devel}
35 PreReq: %{name}-common = %{version}-%{release}
37 Requires(post,preun): /sbin/chkconfig
38 Requires: pam >= 0.77.3
41 Conflicts: cyrus-imapd
43 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
45 %define _libexecdir /usr/%{_lib}/courier-imap
46 %define _sysconfdir /etc/courier-imap
47 %define _certsdir %{_sysconfdir}/certs
48 %define _localstatedir /var/spool/courier-imap
51 Courier-IMAP is an IMAP server for Maildir mailboxes.
54 Courier-IMAP jest serwerem IMAP dla skrzynek pocztowych Maildir.
57 Summary: Common files for imap and pop3 daemons
58 Summary(pl): Pliki wspólne dla serwerów imap i pop3
59 Group: Networking/Daemons
61 Requires(post,preun): /sbin/chkconfig
62 Requires: %{name}-deliverquota = %{version}-%{release}
63 Requires: %{name}-maildirmake = %{version}-%{release}
64 Requires: %{name}-userdb = %{version}-%{release}
68 Common files for imap and pop3 daemons.
70 %description common -l pl
71 Pliki wspólne dla serwerów imap i pop3.
74 Summary: Commands used to create the /etc/userdb.dat
75 Summary(pl): Polecenia do tworzenia /etc/userdb.dat
76 Group: Networking/Daemons
79 Commands used to create the /etc/userdb.dat.
81 %description userdb -l pl
82 Polecenia u¿ywane do stworzenia /etc/userdb.dat.
85 Summary: Deliver to a Maildir with a quota
86 Summary(pl): Obs³uga quoty przy dostarczaniu poczty do skrzynek Maildir
87 Group: Networking/Daemons
89 %description deliverquota
90 deliverquota is a temporary hack to implement E-mail delivery to a
91 Maildir with a software-imposed quota.
93 %description deliverquota -l pl
94 deliverquota jest tymczasowym rozwi±zaniem implementuj±cym
95 dostarczanie e-maili do skrzynek Maildir z programowo narzucon± quot±.
98 Summary: Tool for making mail folders in Maildir format
99 Summary(pl): Narzêdzie do tworzenia folderów w formacie Maildir
100 Group: Networking/Daemons
101 Conflicts: qmail-maildirmake
103 %description maildirmake
104 Maildirmake is a tool for making mail folders in Maildir format.
106 %description maildirmake -l pl
107 Maildirmake jest narzêdziem do tworzenia folderów pocztowych w
111 Summary: Courier-IMAP POP3 Server
112 Summary(pl): Serwer Courier-IMAP POP3
113 Group: Networking/Daemons
114 PreReq: %{name}-common = %{version}-%{release}
115 Requires: pam >= 0.77.3
117 Obsoletes: pop3daemon
118 Conflicts: cyrus-imapd
120 Conflicts: solid-pop3d
124 Courier-IMAP POP3 is an POP3 server for Maildir mailboxes.
126 %description pop3 -l pl
127 Courier-IMAP POP3 jest serwerem POP3 dla skrzynek pocztowych Maildir.
130 Summary: LDAP authentication daemon for Courier IMAP
131 Summary(pl): Demon autentykacji LDAP do Courier IMAP
132 Group: Networking/Daemons
133 PreReq: %{name}-common = %{version}-%{release}
135 %description authldap
136 This package provides LDAP authentication for Courier IMAP.
138 %description authldap -l pl
139 Ten pakiet pozwala na korzystanie z autentykacji LDAP w Courier IMAP.
142 Summary: MySQL authentication daemon for Courier IMAP
143 Summary(pl): Demon autentykacji MySQL do Courier IMAP
144 Group: Networking/Daemons
145 PreReq: %{name}-common = %{version}-%{release}
148 %description authmysql
149 This package provides MySQL authentication for Courier IMAP.
151 %description authmysql -l pl
152 Ten pakiet pozwala na korzystanie z autentykacji MySQL w Courier IMAP.
155 Summary: PostgreSQL authentication daemon for Courier IMAP
156 Summary(pl): Demon autentykacji PostgreSQL do Courier IMAP
157 Group: Networking/Daemons
158 PreReq: %{name}-common = %{version}-%{release}
160 %description authpgsql
161 This package provides PostgreSQL authentication for Courier IMAP.
163 %description authpgsql -l pl
164 Ten pakiet pozwala na korzystanie z autentykacji PostgreSQL w Courier
173 install %{SOURCE1} courier-imap.in
174 install %{SOURCE2} courier-pop3.in
177 cp -f /usr/share/automake/config.sub .
178 cp -f /usr/share/automake/config.sub maildir
195 --localstatedir=%{_localstatedir} \
196 --libexecdir=%{_libexecdir} \
198 --with-authchangepwdir=/var/tmp \
199 --with-authdaemonvar=/var/lib/authdaemon \
200 --with-certsdir=%{_certsdir} \
201 %{?with_mysql:--with-mysql-libs=%{_libdir} --with-mysql-includes=%{_includedir}/mysql} \
202 %{!?with_mysql:--without-authmysql} \
203 %{?with_pgsql:--with-pgsql-libs=%{_libdir} --with-pgsql-includes=%{_includedir}/postgresql} \
204 %{!?with_pgsql:--without-authpgsql} \
205 %{!?with_ldap:--without-authldap}
210 rm -rf $RPM_BUILD_ROOT
211 install -d $RPM_BUILD_ROOT{/etc/{pam.d,rc.d/init.d,security},%{_certsdir}}
214 DESTDIR=$RPM_BUILD_ROOT
216 install courier-imap $RPM_BUILD_ROOT/etc/rc.d/init.d/courier-imap
217 install courier-pop3 $RPM_BUILD_ROOT/etc/rc.d/init.d/courier-pop3
218 install %{SOURCE3} $RPM_BUILD_ROOT/etc/pam.d/imap
219 install %{SOURCE4} $RPM_BUILD_ROOT/etc/pam.d/pop3
221 rm -rf $RPM_BUILD_ROOT%{_mandir}/man8/{authcram,authpam,authpwd,authshadow,authuserdb,authvchkpw,pw2userdb,vchkpw2userdb,authdaemon,authdaemond,authldap,authmysql}.8 \
222 $RPM_BUILD_ROOT%{_sbindir}/{*db,mk*cert}
224 mv -f authlib/README.authmysql.html README.authmysql.html
225 mv -f authlib/README.ldap README.ldap
226 mv -f authlib/README.authmysql.myownquery README.authmysql.myownquery
227 mv -f imap/README README.imap
228 mv -f imap/ChangeLog ChangeLog
229 mv -f maildir/README.maildirquota.txt README.maildirquota
231 install authlib/authdaemonrc $RPM_BUILD_ROOT%{_sysconfdir}
232 install authlib/authldaprc $RPM_BUILD_ROOT%{_sysconfdir}
233 install authlib/authmysqlrc $RPM_BUILD_ROOT%{_sysconfdir}
234 install authlib/authpgsqlrc $RPM_BUILD_ROOT%{_sysconfdir}
236 mv -f $RPM_BUILD_ROOT%{_datadir}/*db \
237 $RPM_BUILD_ROOT%{_sbindir}
238 mv -f $RPM_BUILD_ROOT%{_datadir}/mk*cert \
239 $RPM_BUILD_ROOT%{_sbindir}
241 mv -f tcpd/couriertls.1 $RPM_BUILD_ROOT%{_mandir}/man8/couriertls.8
242 mv -f imap/courierpop3d.8 $RPM_BUILD_ROOT%{_mandir}/man8/courierpop3d.8
244 echo ".so man7/authlib.7" >$RPM_BUILD_ROOT%{_mandir}/man8/authcram.8
245 echo ".so man7/authlib.7" >$RPM_BUILD_ROOT%{_mandir}/man8/authpam.8
246 echo ".so man7/authlib.7" >$RPM_BUILD_ROOT%{_mandir}/man8/authpwd.8
247 echo ".so man7/authlib.7" >$RPM_BUILD_ROOT%{_mandir}/man8/authshadow.8
248 echo ".so man7/authlib.7" >$RPM_BUILD_ROOT%{_mandir}/man8/authuserdb.8
249 echo ".so man7/authlib.7" >$RPM_BUILD_ROOT%{_mandir}/man8/authvchkpw.8
250 echo ".so man7/authlib.7" >$RPM_BUILD_ROOT%{_mandir}/man8/authdaemon.8
251 echo ".so man7/authlib.7" >$RPM_BUILD_ROOT%{_mandir}/man8/authdaemond.8
252 %{?with_pgsql:echo ".so man7/authlib.7" >$RPM_BUILD_ROOT%{_mandir}/man8/authpgsql.8}
253 %{?with_mysql:echo ".so man7/authlib.7" >$RPM_BUILD_ROOT%{_mandir}/man8/authmysql.8}
254 %{?with_ldap:echo ".so man7/authlib.7" >$RPM_BUILD_ROOT%{_mandir}/man8/authldap.8}
255 echo ".so makeuserdb.8" >$RPM_BUILD_ROOT%{_mandir}/man8/pw2userdb.8
256 echo ".so makeuserdb.8" >$RPM_BUILD_ROOT%{_mandir}/man8/vchkpw2userdb.8
258 touch $RPM_BUILD_ROOT/etc/security/blacklist.{pop3,imap}
261 ./sysconftool $RPM_BUILD_ROOT%{_sysconfdir}/*.dist
263 # set yes to start imapd and pop3d
264 sed -i 's/^POP3DSTART.*/POP3DSTART=YES/' $RPM_BUILD_ROOT%{_sysconfdir}/pop3d
265 sed -i 's/^IMAPDSTART.*/IMAPDSTART=YES/' $RPM_BUILD_ROOT%{_sysconfdir}/imapd
267 # remove unpackaged files
268 rm -f $RPM_BUILD_ROOT%{_sysconfdir}/*.dist
271 rm -rf $RPM_BUILD_ROOT
274 /sbin/chkconfig --add courier-imap
276 if [ -f /var/lock/subsys/courier-imap ]; then
277 /etc/rc.d/init.d/courier-imap restart >&2
279 echo "Run \"/etc/rc.d/init.d/courier-imap start\" to start courier-imap daemon."
283 if [ "$1" = "0" ]; then
284 if [ -f /var/lock/subsys/courier-imap ]; then
285 /etc/rc.d/init.d/courier-imap stop >&2
287 /sbin/chkconfig --del courier-imap
290 %triggerin -- %{name} < 3.0.5
291 if [ -f /var/lib/openssl/certs/imapd.pem ]; then
293 echo imapd.pem has been moved automatically to %{_certsdir}
295 mv -f /var/lib/openssl/certs/imapd.pem %{_certsdir}
297 if [ -f /etc/sysconfig/courier-imap ]; then
298 . /etc/sysconfig/courier-imap
299 for opt in `grep ^[^#] /etc/sysconfig/courier-imap |grep -v TLS_CERTFILE |grep -v MAILDIR |grep -v COURIERTLS |cut -d= -f1`;
302 sed -i s/^$opt=.*/"$opt=\"$opt2\""/ %{_sysconfdir}/imapd
303 sed -i s/^$opt=.*/"$opt=\"$opt2\""/ %{_sysconfdir}/imapd-ssl
305 sed -i s/^SSLADDRESS=.*/"SSLADDRESS=$ADDRESS_SSL"/ %{_sysconfdir}/imapd-ssl
306 sed -i s/^SSLPORT=.*/"SSLPORT=$PORTS_SSL"/ %{_sysconfdir}/imapd-ssl
307 sed -i s!^MAILDIRPATH=.*!"MAILDIRPATH=\"$MAILDIR\""! %{_sysconfdir}/imapd-ssl
308 sed -i s!^MAILDIRPATH=.*!"MAILDIRPATH=\"$MAILDIR\""! %{_sysconfdir}/imapd
310 echo IMAPD config file has been rewriten to %{_sysconfdir}/imapd,imapd-ssl
311 echo please look at them
314 if [ -f /var/lock/subsys/courier-imap ]; then
315 /etc/rc.d/init.d/courier-imap restart >&2
318 %triggerin -- %{name} < 3.0.6
319 . %{_sysconfdir}/imapd-ssl
320 if [ $TLS_CACHEFILE = "/var/couriersslcache" ]; then
321 sed -i s/^TLS_CACHEFILE=.*/"TLS_CACHEFILE=\/var\/spool\/courier-imap\/couriersslcache"/ %{_sysconfdir}/imapd-ssl
324 %triggerin -n %{name}-common -- %{name}-common < 3.0.5
325 /sbin/chkconfig --del authdaemon
326 if [ -f /var/lock/subsys/authdaemon ]; then
327 kill `cat /var/lib/authdaemon/pid`
328 rm -f /var/lock/subsys/authdaemon
330 if [ -f /etc/sysconfig/authdaemon ]; then
331 . /etc/sysconfig/authdaemon
332 sed -i s/^version.*/version=authdaemond.$METHOD/ %{_sysconfdir}/authdaemonrc
335 echo Changes to version 3.0.5 :
336 echo - config files has been splited and moved to %{_sysconfdir}
337 echo - certificates directory has changed to %{_certsdir}
341 /sbin/chkconfig --add courier-pop3
342 /sbin/chkconfig --del courier-imap-pop3 >/dev/null 2>&1 || :
343 if [ -f /var/lock/subsys/courier-imap-pop3 ]; then
344 /etc/rc.d/init.d/courier-imap-pop3 stop >&2
345 /etc/rc.d/init.d/courier-pop3 start >&2
346 elif [ -f /var/lock/subsys/courier-pop3 ]; then
347 /etc/rc.d/init.d/courier-pop3 restart >&2
349 echo "Run \"/etc/rc.d/init.d/courier-pop3 start\" to start courier-pop3 daemon."
353 if [ "$1" = "0" ]; then
354 if [ -f /var/lock/subsys/courier-pop3 ]; then
355 /etc/rc.d/init.d/courier-pop3 stop >&2
357 /sbin/chkconfig --del courier-pop3
360 %triggerin -n %{name}-pop3 -- %{name}-pop3 < 3.0.5
361 if [ -f /var/lib/openssl/certs/pop3d.pem ]; then
363 echo pop3d.pem has been moved automatically to %{_certsdir}
365 mv -f /var/lib/openssl/certs/pop3d.pem %{_certsdir}
367 if [ -f /etc/sysconfig/courier-pop3 ]; then
368 . /etc/sysconfig/courier-pop3
369 for opt in `grep ^[^#] /etc/sysconfig/courier-pop3 |grep -v TLS_CERTFILE |grep -v MAILDIR |grep -v COURIERTLS |cut -d= -f1`;
372 sed -i s/^$opt=.*/"$opt=\"$opt2\""/ %{_sysconfdir}/pop3d
373 sed -i s/^$opt=.*/"$opt=\"$opt2\""/ %{_sysconfdir}/pop3d-ssl
375 sed -i s!^MAILDIRPATH=.*!"MAILDIRPATH=\"$MAILDIR\""! %{_sysconfdir}/pop3d-ssl
376 sed -i s!^MAILDIRPATH=.*!"MAILDIRPATH=\"$MAILDIR\""! %{_sysconfdir}/pop3d
378 echo POP3D config file has been rewriten to %{_sysconfdir}/pop3d,pop3d-ssl
379 echo please look at them
382 if [ -f /var/lock/subsys/courier-pop3 ]; then
383 /etc/rc.d/init.d/courier-pop3 restart >&2
386 %triggerin -n %{name}-pop3 -- %{name}-pop3 < 3.0.6
387 . %{_sysconfdir}/pop3d-ssl
388 if [ $TLS_CACHEFILE = "/var/couriersslcache" ]; then
389 sed -i s/^TLS_CACHEFILE=.*/"TLS_CACHEFILE=\/var\/spool\/courier-imap\/couriersslcache"/ %{_sysconfdir}/pop3d-ssl
393 if ps -A |grep -q authdaemond.lda; then
394 %{_libexecdir}/authlib/authdaemond stop
395 %{_libexecdir}/authlib/authdaemond start
399 if [ -x %{_libexecdir}/authlib/authdaemond ]; then
400 if ps -A |grep -q authdaemond.lda; then
401 %{_libexecdir}/authlib/authdaemond stop;
402 %{_libexecdir}/authlib/authdaemond start;
407 if ps -A |grep -q authdaemond.mys; then
408 %{_libexecdir}/authlib/authdaemond stop
409 %{_libexecdir}/authlib/authdaemond start
413 if [ -x %{_libexecdir}/authlib/authdaemond ]; then
414 if ps -A |grep -q authdaemond.mys; then
415 %{_libexecdir}/authlib/authdaemond stop;
416 %{_libexecdir}/authlib/authdaemond start;
421 if ps -A |grep -q authdaemond.pgs; then
422 %{_libexecdir}/authlib/authdaemond stop
423 %{_libexecdir}/authlib/authdaemond start
427 if [ -x %{_libexecdir}/authlib/authdaemond ]; then
428 if ps -A |grep -q authdaemond.pgs; then
429 %{_libexecdir}/authlib/authdaemond stop;
430 %{_libexecdir}/authlib/authdaemond start;
435 %defattr(644,root,root,755)
436 %doc maildir/README.sharedfolders.html
437 %attr(640,root,root) %config(noreplace) %verify(not size mtime md5) /etc/pam.d/imap
438 %attr(640,root,root) %config(noreplace) %verify(not size mtime md5) /etc/security/blacklist.imap
439 %attr(640,root,root) %config(noreplace) %verify(not size mtime md5) %{_sysconfdir}/imapd
440 %attr(640,root,root) %config(noreplace) %verify(not size mtime md5) %{_sysconfdir}/imapd-ssl
441 %attr(640,root,root) %config(noreplace) %verify(not size mtime md5) %{_sysconfdir}/imapd.cnf
442 %attr(754,root,root) /etc/rc.d/init.d/courier-imap
443 %attr(755,daemon,daemon) %dir %{_sysconfdir}/shared
444 %attr(755,daemon,daemon) %dir %{_sysconfdir}/shared.tmp
445 %attr(755,root,root) %{_bindir}/imapd
446 %attr(755,root,root) %{_bindir}/maildiracl
447 %attr(755,root,root) %{_bindir}/maildirkw
448 %attr(755,root,root) %{_sbindir}/authenumerate
449 %attr(755,root,root) %{_sbindir}/imaplogin
450 %attr(755,root,root) %{_sbindir}/mkimapdcert
451 %attr(755,root,root) %{_sbindir}/sharedindexinstall
452 %attr(755,root,root) %{_sbindir}/sharedindexsplit
453 %attr(755,root,root) %{_libexecdir}/imapd.rc
454 %attr(755,root,root) %{_libexecdir}/imapd-ssl.rc
455 %{_mandir}/man8/imapd*
456 %{_mandir}/man1/maildiracl.1*
457 %{_mandir}/man1/maildirkw.1*
460 %defattr(644,root,root,755)
461 %doc AUTHORS ChangeLog imap/BUGS INSTALL README*
462 %attr(700,root,root) /var/lib/authdaemon
463 %attr(750,root,root) %dir %{_sysconfdir}
464 %attr(750,root,root) %dir %{_certsdir}
465 %attr(700,daemon,daemon) %dir %{_localstatedir}
467 %dir %{_libexecdir}/authlib
468 %attr(640,root,root) %config(noreplace) %verify(not size mtime md5) %{_sysconfdir}/authdaemonrc
469 %{_sysconfdir}/quotawarnmsg.example
470 %attr(755,root,root) %{_bindir}/couriertls
471 %attr(755,root,root) %{_libexecdir}/authlib/authdaemon
472 %attr(755,root,root) %{_libexecdir}/authlib/authdaemond
473 %attr(755,root,root) %{_libexecdir}/authlib/authdaemond.plain
474 %attr(755,root,root) %{_libexecdir}/couriertcpd
475 %attr(755,root,root) %{_libexecdir}/makedatprog
476 %attr(755,root,root) %{_sbindir}/courierlogger
477 %{_mandir}/man8/auth[cdsuv]*
478 %{_mandir}/man8/authp[aw]*
479 %{_mandir}/man7/authlib*
480 %{_mandir}/man1/courierlogger*
481 %{_mandir}/man1/couriert*
482 %{_mandir}/man8/couriert*
486 %defattr(644,root,root,755)
487 %attr(755,root,root) %{_sbindir}/makeuserdb
488 %attr(755,root,root) %{_sbindir}/pw2userdb
489 %attr(755,root,root) %{_sbindir}/userdb
490 %attr(755,root,root) %{_sbindir}/userdbpw
491 %attr(755,root,root) %{_sbindir}/vchkpw2userdb
492 %{_mandir}/man8/makeuserdb*
493 %{_mandir}/man8/userdb*
494 %{_mandir}/man8/*pw2userdb*
497 %defattr(644,root,root,755)
498 %attr(755,root,root) %{_bindir}/deliverquota
499 %{_mandir}/man8/deliverquota*
502 %defattr(644,root,root,755)
503 %attr(755,root,root) %{_bindir}/maildirmake
504 %{_mandir}/man1/maildirmake*
507 %defattr(644,root,root,755)
508 %attr(640,root,root) %config(noreplace) %verify(not size mtime md5) /etc/pam.d/pop3
509 %attr(640,root,root) %config(noreplace) %verify(not size mtime md5) /etc/security/blacklist.pop3
510 %attr(640,root,root) %config(noreplace) %verify(not size mtime md5) %{_sysconfdir}/pop3d
511 %attr(640,root,root) %config(noreplace) %verify(not size mtime md5) %{_sysconfdir}/pop3d-ssl
512 %attr(640,root,root) %config(noreplace) %verify(not size mtime md5) %{_sysconfdir}/pop3d.cnf
513 %attr(754,root,root) /etc/rc.d/init.d/courier-pop3
514 %attr(755,root,root) %{_bindir}/pop3d
515 %attr(755,root,root) %{_sbindir}/mkpop3dcert
516 %attr(755,root,root) %{_sbindir}/pop3login
517 %attr(755,root,root) %{_libexecdir}/pop3d.rc
518 %attr(755,root,root) %{_libexecdir}/pop3d-ssl.rc
519 %{_mandir}/man8/courierpop*
523 %defattr(644,root,root,755)
524 %attr(640,root,root) %config(noreplace) %verify(not size mtime md5) %{_sysconfdir}/authldaprc
525 %attr(755,root,root) %{_libexecdir}/authlib/authdaemond.ldap
526 %{_mandir}/man8/authldap*
531 %defattr(644,root,root,755)
532 %attr(640,root,root) %config(noreplace) %verify(not size mtime md5) %{_sysconfdir}/authmysqlrc
533 %attr(755,root,root) %{_libexecdir}/authlib/authdaemond.mysql
534 %{_mandir}/man8/authmysql*
539 %defattr(644,root,root,755)
540 %attr(640,root,root) %config(noreplace) %verify(not size mtime md5) %{_sysconfdir}/authpgsqlrc
541 %attr(755,root,root) %{_libexecdir}/authlib/authdaemond.pgsql
542 %{_mandir}/man8/authpgsql*