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: 8b0c79997905dc46cfe4cc13be74ceaf
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
50 Courier-IMAP is an IMAP server for Maildir mailboxes.
53 Courier-IMAP jest serwerem IMAP dla skrzynek pocztowych Maildir.
56 Summary: Common files for imap and pop3 daemons
57 Summary(pl): Pliki wspólne dla serwerów imap i pop3
58 Group: Networking/Daemons
60 Requires(post,preun): /sbin/chkconfig
61 Requires: %{name}-deliverquota = %{version}-%{release}
62 Requires: %{name}-maildirmake = %{version}-%{release}
63 Requires: %{name}-userdb = %{version}-%{release}
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
194 --libexecdir=%{_libexecdir} \
196 --with-authchangepwdir=/var/tmp \
197 --with-authdaemonvar=/var/lib/authdaemon \
198 --with-certsdir=%{_certsdir} \
199 %{?with_mysql:--with-mysql-libs=%{_libdir} --with-mysql-includes=%{_includedir}/mysql} \
200 %{!?with_mysql:--without-authmysql} \
201 %{?with_pgsql:--with-pgsql-libs=%{_libdir} --with-pgsql-includes=%{_includedir}/postgresql} \
202 %{!?with_pgsql:--without-authpgsql} \
203 %{!?with_ldap:--without-authldap}
208 rm -rf $RPM_BUILD_ROOT
209 install -d $RPM_BUILD_ROOT/etc/{pam.d,rc.d/init.d,security,sysconfig} \
210 $RPM_BUILD_ROOT{%{_sysconfdir}/shared,%{_certsdir},/var/lib/authdaemon}
213 DESTDIR=$RPM_BUILD_ROOT
215 install courier-imap $RPM_BUILD_ROOT/etc/rc.d/init.d/courier-imap
216 install courier-pop3 $RPM_BUILD_ROOT/etc/rc.d/init.d/courier-pop3
217 install %{SOURCE3} $RPM_BUILD_ROOT/etc/pam.d/imap
218 install %{SOURCE4} $RPM_BUILD_ROOT/etc/pam.d/pop3
220 rm -rf $RPM_BUILD_ROOT%{_mandir}/man8/{authcram,authpam,authpwd,authshadow,authuserdb,authvchkpw,pw2userdb,vchkpw2userdb,authdaemon,authdaemond,authldap,authmysql}.8 \
221 $RPM_BUILD_ROOT%{_sbindir}/{*db,mk*cert}
223 mv -f authlib/README.authmysql.html README.authmysql.html
224 mv -f authlib/README.ldap README.ldap
225 mv -f authlib/README.authmysql.myownquery README.authmysql.myownquery
226 mv -f imap/README README.imap
227 mv -f imap/ChangeLog ChangeLog
228 mv -f maildir/README.maildirquota.txt README.maildirquota
230 install authlib/authdaemonrc $RPM_BUILD_ROOT%{_sysconfdir}
231 install authlib/authldaprc $RPM_BUILD_ROOT%{_sysconfdir}
232 install authlib/authmysqlrc $RPM_BUILD_ROOT%{_sysconfdir}
233 install authlib/authpgsqlrc $RPM_BUILD_ROOT%{_sysconfdir}
235 mv -f $RPM_BUILD_ROOT%{_datadir}/*db \
236 $RPM_BUILD_ROOT%{_sbindir}
237 mv -f $RPM_BUILD_ROOT%{_datadir}/mk*cert \
238 $RPM_BUILD_ROOT%{_sbindir}
240 mv -f tcpd/couriertls.1 $RPM_BUILD_ROOT%{_mandir}/man8/couriertls.8
241 mv -f imap/courierpop3d.8 $RPM_BUILD_ROOT%{_mandir}/man8/courierpop3d.8
243 echo ".so man7/authlib.7" >$RPM_BUILD_ROOT%{_mandir}/man8/authcram.8
244 echo ".so man7/authlib.7" >$RPM_BUILD_ROOT%{_mandir}/man8/authpam.8
245 echo ".so man7/authlib.7" >$RPM_BUILD_ROOT%{_mandir}/man8/authpwd.8
246 echo ".so man7/authlib.7" >$RPM_BUILD_ROOT%{_mandir}/man8/authshadow.8
247 echo ".so man7/authlib.7" >$RPM_BUILD_ROOT%{_mandir}/man8/authuserdb.8
248 echo ".so man7/authlib.7" >$RPM_BUILD_ROOT%{_mandir}/man8/authvchkpw.8
249 echo ".so man7/authlib.7" >$RPM_BUILD_ROOT%{_mandir}/man8/authdaemon.8
250 echo ".so man7/authlib.7" >$RPM_BUILD_ROOT%{_mandir}/man8/authdaemond.8
251 %{?with_pgsql:echo ".so man7/authlib.7" >$RPM_BUILD_ROOT%{_mandir}/man8/authpgsql.8}
252 %{?with_mysql:echo ".so man7/authlib.7" >$RPM_BUILD_ROOT%{_mandir}/man8/authmysql.8}
253 %{?with_ldap:echo ".so man7/authlib.7" >$RPM_BUILD_ROOT%{_mandir}/man8/authldap.8}
254 echo ".so makeuserdb.8" >$RPM_BUILD_ROOT%{_mandir}/man8/pw2userdb.8
255 echo ".so makeuserdb.8" >$RPM_BUILD_ROOT%{_mandir}/man8/vchkpw2userdb.8
257 touch $RPM_BUILD_ROOT/etc/security/blacklist.{pop3,imap}
260 ./sysconftool $RPM_BUILD_ROOT%{_sysconfdir}/*.dist
262 # set yes to start imapd and pop3d
263 sed 's/^POP3DSTART.*/POP3DSTART=YES/' < $RPM_BUILD_ROOT%{_sysconfdir}/pop3d > $RPM_BUILD_ROOT%{_sysconfdir}/pop3d.new
264 mv -f $RPM_BUILD_ROOT%{_sysconfdir}/pop3d.new $RPM_BUILD_ROOT%{_sysconfdir}/pop3d
266 sed 's/^IMAPDSTART.*/IMAPDSTART=YES/' < $RPM_BUILD_ROOT%{_sysconfdir}/imapd > $RPM_BUILD_ROOT%{_sysconfdir}/imapd.new
267 mv -f $RPM_BUILD_ROOT%{_sysconfdir}/imapd.new $RPM_BUILD_ROOT%{_sysconfdir}/imapd
269 # remove unpackaged files
270 rm -f $RPM_BUILD_ROOT%{_sysconfdir}/*.dist
273 rm -rf $RPM_BUILD_ROOT
276 /sbin/chkconfig --add courier-imap
278 if [ -f /var/lock/subsys/courier-imap ]; then
279 /etc/rc.d/init.d/courier-imap restart >&2
281 echo "Run \"/etc/rc.d/init.d/courier-imap start\" to start courier-imap daemon."
285 if [ "$1" = "0" ]; then
286 if [ -f /var/lock/subsys/courier-imap ]; then
287 /etc/rc.d/init.d/courier-imap stop >&2
289 /sbin/chkconfig --del courier-imap
292 %triggerin -- %{name} < 3.0.5
293 if [ -f /var/lib/openssl/certs/imapd.pem ]; then
295 echo imapd.pem has been moved automatically to %{_certsdir}
297 mv -f /var/lib/openssl/certs/imapd.pem %{_certsdir}
299 if [ -f /etc/sysconfig/courier-imap ]; then
300 . /etc/sysconfig/courier-imap
301 for opt in `grep ^[^#] /etc/sysconfig/courier-imap |grep -v TLS_CERTFILE |grep -v MAILDIR|grep -v COURIERTLS |cut -d= -f1`;
304 sed s/^$opt=.*/"$opt=\"$opt2\""/ < %{_sysconfdir}/imapd > %{_sysconfdir}/imapd.new
305 mv -f %{_sysconfdir}/imapd.new %{_sysconfdir}/imapd
306 sed s/^$opt=.*/"$opt=\"$opt2\""/ < %{_sysconfdir}/imapd-ssl > %{_sysconfdir}/imapd-ssl.new
307 mv -f %{_sysconfdir}/imapd-ssl.new %{_sysconfdir}/imapd-ssl
309 sed s/^SSLADDRESS=.*/"SSLADDRESS=$ADDRESS_SSL"/ < %{_sysconfdir}/imapd-ssl > %{_sysconfdir}/imapd-ssl.new
310 sed s/^SSLPORT=.*/"SSLPORT=$PORTS_SSL"/ < %{_sysconfdir}/imapd-ssl.new > %{_sysconfdir}/imapd-ssl
311 rm -f %{_sysconfdir}/imapd-ssl.new
312 chmod 640 %{_sysconfdir}/imapd-ssl
313 chmod 640 %{_sysconfdir}/imapd
315 echo IMAPD config file has been rewriten to %{_sysconfdir}/imapd,imapd-ssl
318 if [ -f /var/lock/subsys/courier-imap ]; then
319 /etc/rc.d/init.d/courier-imap restart >&2
322 %triggerin -n %{name}-common -- %{name}-common < 3.0.5
323 /sbin/chkconfig --del authdaemon
324 if [ -f /var/lock/subsys/authdaemon ]; then
325 kill `cat /var/lib/authdaemon/pid`
326 rm -f /var/lock/subsys/authdaemon
328 if [ -f /etc/sysconfig/authdaemon ]; then
329 . /etc/sysconfig/authdaemon
330 sed s/^version.*/version=authdaemond.$METHOD/ <%{_sysconfdir}/authdaemonrc >%{_sysconfdir}/authdaemonrc.new
331 mv -f %{_sysconfdir}/authdaemonrc.new %{_sysconfdir}/authdaemonrc
332 chmod 640 %{_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 s/^$opt=.*/"$opt=\"$opt2\""/ < %{_sysconfdir}/pop3d > %{_sysconfdir}/pop3d.new
373 mv -f %{_sysconfdir}/pop3d.new %{_sysconfdir}/pop3d
374 sed s/^$opt=.*/"$opt=\"$opt2\""/ < %{_sysconfdir}/pop3d-ssl > %{_sysconfdir}/pop3d-ssl.new
375 mv -f %{_sysconfdir}/pop3d-ssl.new %{_sysconfdir}/pop3d-ssl
377 chmod 640 %{_sysconfdir}/pop3d-ssl
378 chmod 640 %{_sysconfdir}/pop3d
380 echo POP3D config file has been rewriten to %{_sysconfdir}/pop3d,pop3d-ssl
383 if [ -f /var/lock/subsys/courier-pop3 ]; then
384 /etc/rc.d/init.d/courier-pop3 restart >&2
388 if ps -A |grep -q authdaemond.lda; then
389 %{_libexecdir}/authlib/authdaemond stop
390 %{_libexecdir}/authlib/authdaemond start
394 if [ -x %{_libexecdir}/authlib/authdaemond ]; then
395 if ps -A |grep -q authdaemond.lda; then
396 %{_libexecdir}/authlib/authdaemond stop;
397 %{_libexecdir}/authlib/authdaemond start;
402 if ps -A |grep -q authdaemond.mys; then
403 %{_libexecdir}/authlib/authdaemond stop
404 %{_libexecdir}/authlib/authdaemond start
408 if [ -x %{_libexecdir}/authlib/authdaemond ]; then
409 if ps -A |grep -q authdaemond.mys; then
410 %{_libexecdir}/authlib/authdaemond stop;
411 %{_libexecdir}/authlib/authdaemond start;
416 if ps -A |grep -q authdaemond.pgs; then
417 %{_libexecdir}/authlib/authdaemond stop
418 %{_libexecdir}/authlib/authdaemond start
422 if [ -x %{_libexecdir}/authlib/authdaemond ]; then
423 if ps -A |grep -q authdaemond.pgs; then
424 %{_libexecdir}/authlib/authdaemond stop;
425 %{_libexecdir}/authlib/authdaemond start;
430 %defattr(644,root,root,755)
431 %doc maildir/README.sharedfolders.html
432 %attr(640,root,root) %config(noreplace) %verify(not size mtime md5) /etc/pam.d/imap
433 %attr(640,root,root) %config(noreplace) %verify(not size mtime md5) /etc/security/blacklist.imap
434 %attr(640,root,root) %config(noreplace) %verify(not size mtime md5) %{_sysconfdir}/imapd
435 %attr(640,root,root) %config(noreplace) %verify(not size mtime md5) %{_sysconfdir}/imapd-ssl
436 %attr(640,root,root) %config(noreplace) %verify(not size mtime md5) %{_sysconfdir}/imapd.cnf
437 %attr(754,root,root) /etc/rc.d/init.d/courier-imap
438 %attr(750,daemon,daemon) %dir %{_sysconfdir}/shared
439 %attr(755,root,root) %{_bindir}/imapd
440 %attr(755,root,root) %{_bindir}/maildiracl
441 %attr(755,root,root) %{_bindir}/maildirkw
442 %attr(755,root,root) %{_sbindir}/authenumerate
443 %attr(755,root,root) %{_sbindir}/imaplogin
444 %attr(755,root,root) %{_sbindir}/mkimapdcert
445 %attr(755,root,root) %{_sbindir}/sharedindexinstall
446 %attr(755,root,root) %{_sbindir}/sharedindexsplit
447 %attr(755,root,root) %{_libexecdir}/imapd.rc
448 %attr(755,root,root) %{_libexecdir}/imapd-ssl.rc
449 %{_mandir}/man8/imapd*
450 %{_mandir}/man1/maildiracl.1*
451 %{_mandir}/man1/maildirkw.1*
454 %defattr(644,root,root,755)
455 %doc AUTHORS ChangeLog imap/BUGS INSTALL README*
456 %attr(700,root,root) /var/lib/authdaemon
457 %attr(750,root,root) %dir %{_sysconfdir}
458 %attr(750,root,root) %dir %{_certsdir}
460 %dir %{_libexecdir}/authlib
461 %attr(640,root,root) %config(noreplace) %verify(not size mtime md5) %{_sysconfdir}/authdaemonrc
462 %{_sysconfdir}/quotawarnmsg.example
463 %attr(755,root,root) %{_bindir}/couriertls
464 %attr(755,root,root) %{_libexecdir}/authlib/authdaemon
465 %attr(755,root,root) %{_libexecdir}/authlib/authdaemond
466 %attr(755,root,root) %{_libexecdir}/authlib/authdaemond.plain
467 %attr(755,root,root) %{_libexecdir}/couriertcpd
468 %attr(755,root,root) %{_libexecdir}/makedatprog
469 %attr(755,root,root) %{_sbindir}/courierlogger
470 %{_mandir}/man8/auth[cdsuv]*
471 %{_mandir}/man8/authp[aw]*
472 %{_mandir}/man7/authlib*
473 %{_mandir}/man1/courierlogger*
474 %{_mandir}/man1/couriert*
475 %{_mandir}/man8/couriert*
479 %defattr(644,root,root,755)
480 %attr(755,root,root) %{_sbindir}/makeuserdb
481 %attr(755,root,root) %{_sbindir}/pw2userdb
482 %attr(755,root,root) %{_sbindir}/userdb
483 %attr(755,root,root) %{_sbindir}/userdbpw
484 %attr(755,root,root) %{_sbindir}/vchkpw2userdb
485 %{_mandir}/man8/makeuserdb*
486 %{_mandir}/man8/userdb*
487 %{_mandir}/man8/*pw2userdb*
490 %defattr(644,root,root,755)
491 %attr(755,root,root) %{_bindir}/deliverquota
492 %{_mandir}/man8/deliverquota*
495 %defattr(644,root,root,755)
496 %attr(755,root,root) %{_bindir}/maildirmake
497 %{_mandir}/man1/maildirmake*
500 %defattr(644,root,root,755)
501 %attr(640,root,root) %config(noreplace) %verify(not size mtime md5) /etc/pam.d/pop3
502 %attr(640,root,root) %config(noreplace) %verify(not size mtime md5) /etc/security/blacklist.pop3
503 %attr(640,root,root) %config(noreplace) %verify(not size mtime md5) %{_sysconfdir}/pop3d
504 %attr(640,root,root) %config(noreplace) %verify(not size mtime md5) %{_sysconfdir}/pop3d-ssl
505 %attr(640,root,root) %config(noreplace) %verify(not size mtime md5) %{_sysconfdir}/pop3d.cnf
506 %attr(754,root,root) /etc/rc.d/init.d/courier-pop3
507 %attr(755,root,root) %{_bindir}/pop3d
508 %attr(755,root,root) %{_sbindir}/mkpop3dcert
509 %attr(755,root,root) %{_sbindir}/pop3login
510 %attr(755,root,root) %{_libexecdir}/pop3d.rc
511 %attr(755,root,root) %{_libexecdir}/pop3d-ssl.rc
512 %{_mandir}/man8/courierpop*
516 %defattr(644,root,root,755)
517 %attr(640,root,root) %config(noreplace) %verify(not size mtime md5) %{_sysconfdir}/authldaprc
518 %attr(755,root,root) %{_libexecdir}/authlib/authdaemond.ldap
519 %{_mandir}/man8/authldap*
524 %defattr(644,root,root,755)
525 %attr(640,root,root) %config(noreplace) %verify(not size mtime md5) %{_sysconfdir}/authmysqlrc
526 %attr(755,root,root) %{_libexecdir}/authlib/authdaemond.mysql
527 %{_mandir}/man8/authmysql*
532 %defattr(644,root,root,755)
533 %attr(640,root,root) %config(noreplace) %verify(not size mtime md5) %{_sysconfdir}/authpgsqlrc
534 %attr(755,root,root) %{_libexecdir}/authlib/authdaemond.pgsql
535 %{_mandir}/man8/authpgsql*