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: 3177f4451d02b6380c5b45aa80d795a7
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
63 Requires: %{name}-deliverquota = %{version}-%{release}
64 Requires: %{name}-maildirmake = %{version}-%{release}
65 Requires: %{name}-userdb = %{version}-%{release}
69 Common files for imap and pop3 daemons.
71 %description common -l pl
72 Pliki wspólne dla serwerów imap i pop3.
75 Summary: Commands used to create the /etc/userdb.dat
76 Summary(pl): Polecenia do tworzenia /etc/userdb.dat
77 Group: Networking/Daemons
80 Commands used to create the /etc/userdb.dat.
82 %description userdb -l pl
83 Polecenia u¿ywane do stworzenia /etc/userdb.dat.
86 Summary: Deliver to a Maildir with a quota
87 Summary(pl): Obs³uga quoty przy dostarczaniu poczty do skrzynek Maildir
88 Group: Networking/Daemons
90 %description deliverquota
91 deliverquota is a temporary hack to implement E-mail delivery to a
92 Maildir with a software-imposed quota.
94 %description deliverquota -l pl
95 deliverquota jest tymczasowym rozwi±zaniem implementuj±cym
96 dostarczanie e-maili do skrzynek Maildir z programowo narzucon± quot±.
99 Summary: Tool for making mail folders in Maildir format
100 Summary(pl): Narzêdzie do tworzenia folderów w formacie Maildir
101 Group: Networking/Daemons
102 Conflicts: qmail-maildirmake
104 %description maildirmake
105 Maildirmake is a tool for making mail folders in Maildir format.
107 %description maildirmake -l pl
108 Maildirmake jest narzêdziem do tworzenia folderów pocztowych w
112 Summary: Courier-IMAP POP3 Server
113 Summary(pl): Serwer Courier-IMAP POP3
114 Group: Networking/Daemons
115 PreReq: %{name}-common = %{version}-%{release}
116 Requires: pam >= 0.77.3
118 Obsoletes: pop3daemon
119 Conflicts: cyrus-imapd
121 Conflicts: solid-pop3d
125 Courier-IMAP POP3 is an POP3 server for Maildir mailboxes.
127 %description pop3 -l pl
128 Courier-IMAP POP3 jest serwerem POP3 dla skrzynek pocztowych Maildir.
131 Summary: LDAP authentication daemon for Courier IMAP
132 Summary(pl): Demon autentykacji LDAP do Courier IMAP
133 Group: Networking/Daemons
134 PreReq: %{name}-common = %{version}-%{release}
136 %description authldap
137 This package provides LDAP authentication for Courier IMAP.
139 %description authldap -l pl
140 Ten pakiet pozwala na korzystanie z autentykacji LDAP w Courier IMAP.
143 Summary: MySQL authentication daemon for Courier IMAP
144 Summary(pl): Demon autentykacji MySQL do Courier IMAP
145 Group: Networking/Daemons
146 PreReq: %{name}-common = %{version}-%{release}
149 %description authmysql
150 This package provides MySQL authentication for Courier IMAP.
152 %description authmysql -l pl
153 Ten pakiet pozwala na korzystanie z autentykacji MySQL w Courier IMAP.
156 Summary: PostgreSQL authentication daemon for Courier IMAP
157 Summary(pl): Demon autentykacji PostgreSQL do Courier IMAP
158 Group: Networking/Daemons
159 PreReq: %{name}-common = %{version}-%{release}
161 %description authpgsql
162 This package provides PostgreSQL authentication for Courier IMAP.
164 %description authpgsql -l pl
165 Ten pakiet pozwala na korzystanie z autentykacji PostgreSQL w Courier
174 install %{SOURCE1} courier-imap.in
175 install %{SOURCE2} courier-pop3.in
178 cp -f /usr/share/automake/config.sub .
179 cp -f /usr/share/automake/config.sub maildir
196 --localstatedir=%{_localstatedir} \
197 --libexecdir=%{_libexecdir} \
199 --with-authchangepwdir=/var/tmp \
200 --with-authdaemonvar=/var/lib/authdaemon \
201 --with-certsdir=%{_certsdir} \
202 %{?with_mysql:--with-mysql-libs=%{_libdir} --with-mysql-includes=%{_includedir}/mysql} \
203 %{!?with_mysql:--without-authmysql} \
204 %{?with_pgsql:--with-pgsql-libs=%{_libdir} --with-pgsql-includes=%{_includedir}/postgresql} \
205 %{!?with_pgsql:--without-authpgsql} \
206 %{!?with_ldap:--without-authldap}
211 rm -rf $RPM_BUILD_ROOT
212 install -d $RPM_BUILD_ROOT{/etc/{pam.d,rc.d/init.d,security},%{_certsdir}}
215 DESTDIR=$RPM_BUILD_ROOT
217 install courier-imap $RPM_BUILD_ROOT/etc/rc.d/init.d/courier-imap
218 install courier-pop3 $RPM_BUILD_ROOT/etc/rc.d/init.d/courier-pop3
219 install %{SOURCE3} $RPM_BUILD_ROOT/etc/pam.d/imap
220 install %{SOURCE4} $RPM_BUILD_ROOT/etc/pam.d/pop3
222 rm -rf $RPM_BUILD_ROOT%{_mandir}/man8/{authcram,authpam,authpwd,authshadow,authuserdb,authvchkpw,pw2userdb,vchkpw2userdb,authdaemon,authdaemond,authldap,authmysql}.8 \
223 $RPM_BUILD_ROOT%{_sbindir}/{*db,mk*cert}
225 mv -f authlib/README.authmysql.html README.authmysql.html
226 mv -f authlib/README.ldap README.ldap
227 mv -f authlib/README.authmysql.myownquery README.authmysql.myownquery
228 mv -f imap/README README.imap
229 mv -f imap/ChangeLog ChangeLog
230 mv -f maildir/README.maildirquota.txt README.maildirquota
232 install authlib/authdaemonrc $RPM_BUILD_ROOT%{_sysconfdir}
233 install authlib/authldaprc $RPM_BUILD_ROOT%{_sysconfdir}
234 install authlib/authmysqlrc $RPM_BUILD_ROOT%{_sysconfdir}
235 install authlib/authpgsqlrc $RPM_BUILD_ROOT%{_sysconfdir}
237 mv -f $RPM_BUILD_ROOT%{_datadir}/*db \
238 $RPM_BUILD_ROOT%{_sbindir}
239 mv -f $RPM_BUILD_ROOT%{_datadir}/mk*cert \
240 $RPM_BUILD_ROOT%{_sbindir}
242 mv -f tcpd/couriertls.1 $RPM_BUILD_ROOT%{_mandir}/man8/couriertls.8
243 mv -f imap/courierpop3d.8 $RPM_BUILD_ROOT%{_mandir}/man8/courierpop3d.8
245 echo ".so man7/authlib.7" >$RPM_BUILD_ROOT%{_mandir}/man8/authcram.8
246 echo ".so man7/authlib.7" >$RPM_BUILD_ROOT%{_mandir}/man8/authpam.8
247 echo ".so man7/authlib.7" >$RPM_BUILD_ROOT%{_mandir}/man8/authpwd.8
248 echo ".so man7/authlib.7" >$RPM_BUILD_ROOT%{_mandir}/man8/authshadow.8
249 echo ".so man7/authlib.7" >$RPM_BUILD_ROOT%{_mandir}/man8/authuserdb.8
250 echo ".so man7/authlib.7" >$RPM_BUILD_ROOT%{_mandir}/man8/authvchkpw.8
251 echo ".so man7/authlib.7" >$RPM_BUILD_ROOT%{_mandir}/man8/authdaemon.8
252 echo ".so man7/authlib.7" >$RPM_BUILD_ROOT%{_mandir}/man8/authdaemond.8
253 %{?with_pgsql:echo ".so man7/authlib.7" >$RPM_BUILD_ROOT%{_mandir}/man8/authpgsql.8}
254 %{?with_mysql:echo ".so man7/authlib.7" >$RPM_BUILD_ROOT%{_mandir}/man8/authmysql.8}
255 %{?with_ldap:echo ".so man7/authlib.7" >$RPM_BUILD_ROOT%{_mandir}/man8/authldap.8}
256 echo ".so makeuserdb.8" >$RPM_BUILD_ROOT%{_mandir}/man8/pw2userdb.8
257 echo ".so makeuserdb.8" >$RPM_BUILD_ROOT%{_mandir}/man8/vchkpw2userdb.8
259 touch $RPM_BUILD_ROOT/etc/security/blacklist.{pop3,imap}
262 ./sysconftool $RPM_BUILD_ROOT%{_sysconfdir}/*.dist
264 # set yes to start imapd and pop3d
265 sed -i 's/^POP3DSTART.*/POP3DSTART=YES/' $RPM_BUILD_ROOT%{_sysconfdir}/pop3d
266 sed -i 's/^IMAPDSTART.*/IMAPDSTART=YES/' $RPM_BUILD_ROOT%{_sysconfdir}/imapd
268 # remove unpackaged files
269 rm -f $RPM_BUILD_ROOT%{_sysconfdir}/*.dist
272 rm -rf $RPM_BUILD_ROOT
275 /sbin/chkconfig --add courier-imap
277 if [ -f /var/lock/subsys/courier-imap ]; then
278 /etc/rc.d/init.d/courier-imap restart >&2
280 echo "Run \"/etc/rc.d/init.d/courier-imap start\" to start courier-imap daemon."
284 if [ "$1" = "0" ]; then
285 if [ -f /var/lock/subsys/courier-imap ]; then
286 /etc/rc.d/init.d/courier-imap stop >&2
288 /sbin/chkconfig --del courier-imap
291 %triggerin -- %{name} < 3.0.5
292 if [ -f /var/lib/openssl/certs/imapd.pem ]; then
294 echo imapd.pem has been moved automatically to %{_certsdir}
296 mv -f /var/lib/openssl/certs/imapd.pem %{_certsdir}
298 if [ -f /etc/sysconfig/courier-imap ]; then
299 . /etc/sysconfig/courier-imap
300 for opt in `grep ^[^#] /etc/sysconfig/courier-imap |grep -v TLS_CERTFILE |grep -v MAILDIR |grep -v COURIERTLS |cut -d= -f1`;
303 sed -i s/^$opt=.*/"$opt=\"$opt2\""/ %{_sysconfdir}/imapd
304 sed -i s/^$opt=.*/"$opt=\"$opt2\""/ %{_sysconfdir}/imapd-ssl
306 sed -i s/^SSLADDRESS=.*/"SSLADDRESS=$ADDRESS_SSL"/ %{_sysconfdir}/imapd-ssl
307 sed -i s/^SSLPORT=.*/"SSLPORT=$PORTS_SSL"/ %{_sysconfdir}/imapd-ssl
308 sed -i s!^MAILDIRPATH=.*!"MAILDIRPATH=\"$MAILDIR\""! %{_sysconfdir}/imapd-ssl
309 sed -i s!^MAILDIRPATH=.*!"MAILDIRPATH=\"$MAILDIR\""! %{_sysconfdir}/imapd
311 echo IMAPD config file has been rewriten to %{_sysconfdir}/imapd,imapd-ssl
312 echo please look at them
315 if [ -f /var/lock/subsys/courier-imap ]; then
316 /etc/rc.d/init.d/courier-imap restart >&2
319 %triggerin -- %{name} < 3.0.6
320 . %{_sysconfdir}/imapd-ssl
321 if [ $TLS_CACHEFILE = "/var/couriersslcache" ]; then
322 sed -i s/^TLS_CACHEFILE=.*/"TLS_CACHEFILE=\/var\/spool\/courier-imap\/couriersslcache"/ %{_sysconfdir}/imapd-ssl
325 %triggerin -n %{name}-common -- %{name}-common < 3.0.5
326 /sbin/chkconfig --del authdaemon
327 if [ -f /var/lock/subsys/authdaemon ]; then
328 kill `cat /var/lib/authdaemon/pid`
329 rm -f /var/lock/subsys/authdaemon
331 if [ -f /etc/sysconfig/authdaemon ]; then
332 . /etc/sysconfig/authdaemon
333 sed -i s/^version.*/version=authdaemond.$METHOD/ %{_sysconfdir}/authdaemonrc
336 echo Changes to version 3.0.5 :
337 echo - config files has been splited and moved to %{_sysconfdir}
338 echo - certificates directory has changed to %{_certsdir}
342 /sbin/chkconfig --add courier-pop3
343 /sbin/chkconfig --del courier-imap-pop3 >/dev/null 2>&1 || :
344 if [ -f /var/lock/subsys/courier-imap-pop3 ]; then
345 /etc/rc.d/init.d/courier-imap-pop3 stop >&2
346 /etc/rc.d/init.d/courier-pop3 start >&2
347 elif [ -f /var/lock/subsys/courier-pop3 ]; then
348 /etc/rc.d/init.d/courier-pop3 restart >&2
350 echo "Run \"/etc/rc.d/init.d/courier-pop3 start\" to start courier-pop3 daemon."
354 if [ "$1" = "0" ]; then
355 if [ -f /var/lock/subsys/courier-pop3 ]; then
356 /etc/rc.d/init.d/courier-pop3 stop >&2
358 /sbin/chkconfig --del courier-pop3
361 %triggerin -n %{name}-pop3 -- %{name}-pop3 < 3.0.5
362 if [ -f /var/lib/openssl/certs/pop3d.pem ]; then
364 echo pop3d.pem has been moved automatically to %{_certsdir}
366 mv -f /var/lib/openssl/certs/pop3d.pem %{_certsdir}
368 if [ -f /etc/sysconfig/courier-pop3 ]; then
369 . /etc/sysconfig/courier-pop3
370 for opt in `grep ^[^#] /etc/sysconfig/courier-pop3 |grep -v TLS_CERTFILE |grep -v MAILDIR |grep -v COURIERTLS |cut -d= -f1`;
373 sed -i s/^$opt=.*/"$opt=\"$opt2\""/ %{_sysconfdir}/pop3d
374 sed -i s/^$opt=.*/"$opt=\"$opt2\""/ %{_sysconfdir}/pop3d-ssl
376 sed -i s!^MAILDIRPATH=.*!"MAILDIRPATH=\"$MAILDIR\""! %{_sysconfdir}/pop3d-ssl
377 sed -i s!^MAILDIRPATH=.*!"MAILDIRPATH=\"$MAILDIR\""! %{_sysconfdir}/pop3d
379 echo POP3D config file has been rewriten to %{_sysconfdir}/pop3d,pop3d-ssl
380 echo please look at them
383 if [ -f /var/lock/subsys/courier-pop3 ]; then
384 /etc/rc.d/init.d/courier-pop3 restart >&2
387 %triggerin -n %{name}-pop3 -- %{name}-pop3 < 3.0.6
388 . %{_sysconfdir}/pop3d-ssl
389 if [ $TLS_CACHEFILE = "/var/couriersslcache" ]; then
390 sed -i s/^TLS_CACHEFILE=.*/"TLS_CACHEFILE=\/var\/spool\/courier-imap\/couriersslcache"/ %{_sysconfdir}/pop3d-ssl
394 if ps -A |grep -q authdaemond.lda; then
395 %{_libexecdir}/authlib/authdaemond stop
396 %{_libexecdir}/authlib/authdaemond start
400 if [ -x %{_libexecdir}/authlib/authdaemond ]; then
401 if ps -A |grep -q authdaemond.lda; then
402 %{_libexecdir}/authlib/authdaemond stop;
403 %{_libexecdir}/authlib/authdaemond start;
408 if ps -A |grep -q authdaemond.mys; then
409 %{_libexecdir}/authlib/authdaemond stop
410 %{_libexecdir}/authlib/authdaemond start
414 if [ -x %{_libexecdir}/authlib/authdaemond ]; then
415 if ps -A |grep -q authdaemond.mys; then
416 %{_libexecdir}/authlib/authdaemond stop;
417 %{_libexecdir}/authlib/authdaemond start;
422 if ps -A |grep -q authdaemond.pgs; then
423 %{_libexecdir}/authlib/authdaemond stop
424 %{_libexecdir}/authlib/authdaemond start
428 if [ -x %{_libexecdir}/authlib/authdaemond ]; then
429 if ps -A |grep -q authdaemond.pgs; then
430 %{_libexecdir}/authlib/authdaemond stop;
431 %{_libexecdir}/authlib/authdaemond start;
436 %defattr(644,root,root,755)
437 %doc maildir/README.sharedfolders.html
438 %attr(640,root,root) %config(noreplace) %verify(not size mtime md5) /etc/pam.d/imap
439 %attr(640,root,root) %config(noreplace) %verify(not size mtime md5) /etc/security/blacklist.imap
440 %attr(640,root,root) %config(noreplace) %verify(not size mtime md5) %{_sysconfdir}/imapd
441 %attr(640,root,root) %config(noreplace) %verify(not size mtime md5) %{_sysconfdir}/imapd-ssl
442 %attr(640,root,root) %config(noreplace) %verify(not size mtime md5) %{_sysconfdir}/imapd.cnf
443 %attr(754,root,root) /etc/rc.d/init.d/courier-imap
444 %attr(755,daemon,daemon) %dir %{_sysconfdir}/shared
445 %attr(755,daemon,daemon) %dir %{_sysconfdir}/shared.tmp
446 %attr(755,root,root) %{_bindir}/imapd
447 %attr(755,root,root) %{_bindir}/maildiracl
448 %attr(755,root,root) %{_bindir}/maildirkw
449 %attr(755,root,root) %{_sbindir}/authenumerate
450 %attr(755,root,root) %{_sbindir}/imaplogin
451 %attr(755,root,root) %{_sbindir}/mkimapdcert
452 %attr(755,root,root) %{_sbindir}/sharedindexinstall
453 %attr(755,root,root) %{_sbindir}/sharedindexsplit
454 %attr(755,root,root) %{_libexecdir}/imapd.rc
455 %attr(755,root,root) %{_libexecdir}/imapd-ssl.rc
456 %{_mandir}/man8/imapd*
457 %{_mandir}/man1/maildiracl.1*
458 %{_mandir}/man1/maildirkw.1*
461 %defattr(644,root,root,755)
462 %doc AUTHORS ChangeLog imap/BUGS INSTALL README*
463 %attr(770,daemon,daemon) /var/lib/authdaemon
464 %attr(750,root,root) %dir %{_sysconfdir}
465 %attr(750,root,root) %dir %{_certsdir}
466 %attr(770,daemon,daemon) %dir %{_localstatedir}
468 %dir %{_libexecdir}/authlib
469 %attr(640,root,root) %config(noreplace) %verify(not size mtime md5) %{_sysconfdir}/authdaemonrc
470 %{_sysconfdir}/quotawarnmsg.example
471 %attr(755,root,root) %{_bindir}/couriertls
472 %attr(755,root,root) %{_libexecdir}/authlib/authdaemon
473 %attr(755,root,root) %{_libexecdir}/authlib/authdaemond
474 %attr(755,root,root) %{_libexecdir}/authlib/authdaemond.plain
475 %attr(755,root,root) %{_libexecdir}/couriertcpd
476 %attr(755,root,root) %{_libexecdir}/makedatprog
477 %attr(755,root,root) %{_sbindir}/courierlogger
478 %{_mandir}/man8/auth[cdsuv]*
479 %{_mandir}/man8/authp[aw]*
480 %{_mandir}/man7/authlib*
481 %{_mandir}/man1/courierlogger*
482 %{_mandir}/man1/couriert*
483 %{_mandir}/man8/couriert*
487 %defattr(644,root,root,755)
488 %attr(755,root,root) %{_sbindir}/makeuserdb
489 %attr(755,root,root) %{_sbindir}/pw2userdb
490 %attr(755,root,root) %{_sbindir}/userdb
491 %attr(755,root,root) %{_sbindir}/userdbpw
492 %attr(755,root,root) %{_sbindir}/vchkpw2userdb
493 %{_mandir}/man8/makeuserdb*
494 %{_mandir}/man8/userdb*
495 %{_mandir}/man8/*pw2userdb*
498 %defattr(644,root,root,755)
499 %attr(755,root,root) %{_bindir}/deliverquota
500 %{_mandir}/man8/deliverquota*
503 %defattr(644,root,root,755)
504 %attr(755,root,root) %{_bindir}/maildirmake
505 %{_mandir}/man1/maildirmake*
508 %defattr(644,root,root,755)
509 %attr(640,root,root) %config(noreplace) %verify(not size mtime md5) /etc/pam.d/pop3
510 %attr(640,root,root) %config(noreplace) %verify(not size mtime md5) /etc/security/blacklist.pop3
511 %attr(640,root,root) %config(noreplace) %verify(not size mtime md5) %{_sysconfdir}/pop3d
512 %attr(640,root,root) %config(noreplace) %verify(not size mtime md5) %{_sysconfdir}/pop3d-ssl
513 %attr(640,root,root) %config(noreplace) %verify(not size mtime md5) %{_sysconfdir}/pop3d.cnf
514 %attr(754,root,root) /etc/rc.d/init.d/courier-pop3
515 %attr(755,root,root) %{_bindir}/pop3d
516 %attr(755,root,root) %{_sbindir}/mkpop3dcert
517 %attr(755,root,root) %{_sbindir}/pop3login
518 %attr(755,root,root) %{_libexecdir}/pop3d.rc
519 %attr(755,root,root) %{_libexecdir}/pop3d-ssl.rc
520 %{_mandir}/man8/courierpop*
524 %defattr(644,root,root,755)
525 %attr(640,root,root) %config(noreplace) %verify(not size mtime md5) %{_sysconfdir}/authldaprc
526 %attr(755,root,root) %{_libexecdir}/authlib/authdaemond.ldap
527 %{_mandir}/man8/authldap*
532 %defattr(644,root,root,755)
533 %attr(640,root,root) %config(noreplace) %verify(not size mtime md5) %{_sysconfdir}/authmysqlrc
534 %attr(755,root,root) %{_libexecdir}/authlib/authdaemond.mysql
535 %{_mandir}/man8/authmysql*
540 %defattr(644,root,root,755)
541 %attr(640,root,root) %config(noreplace) %verify(not size mtime md5) %{_sysconfdir}/authpgsqlrc
542 %attr(755,root,root) %{_libexecdir}/authlib/authdaemond.pgsql
543 %{_mandir}/man8/authpgsql*