6 %bcond_without ldap # without LDAP support
7 %bcond_without mysql # without MySQL support
8 %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: 8b0c79997905dc46cfe4cc13be74ceaf
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.inter7.com/courierimap/
26 BuildRequires: autoconf >= 2.54
27 BuildRequires: automake
28 BuildRequires: gdbm-devel
29 BuildRequires: libstdc++-devel
30 %{?with_mysql:BuildRequires: mysql-devel}
31 %{?with_ldap:BuildRequires: openldap-devel}
32 BuildRequires: openssl-devel >= 0.9.7d
33 %{?with_pgsql:BuildRequires: postgresql-devel}
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
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 --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,sysconfig} \
212 $RPM_BUILD_ROOT{%{_sysconfdir}/shared,%{_certsdir},/var/lib/authdaemon}
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 's/^POP3DSTART.*/POP3DSTART=YES/' < $RPM_BUILD_ROOT%{_sysconfdir}/pop3d > $RPM_BUILD_ROOT%{_sysconfdir}/pop3d.new
266 mv -f $RPM_BUILD_ROOT%{_sysconfdir}/pop3d.new $RPM_BUILD_ROOT%{_sysconfdir}/pop3d
268 sed 's/^IMAPDSTART.*/IMAPDSTART=YES/' < $RPM_BUILD_ROOT%{_sysconfdir}/imapd > $RPM_BUILD_ROOT%{_sysconfdir}/imapd.new
269 mv -f $RPM_BUILD_ROOT%{_sysconfdir}/imapd.new $RPM_BUILD_ROOT%{_sysconfdir}/imapd
271 # remove unpackaged files
272 rm -f $RPM_BUILD_ROOT%{_sysconfdir}/*.dist
275 rm -rf $RPM_BUILD_ROOT
278 /sbin/chkconfig --add courier-imap
280 if [ -f /var/lock/subsys/courier-imap ]; then
281 /etc/rc.d/init.d/courier-imap restart >&2
283 echo "Run \"/etc/rc.d/init.d/courier-imap start\" to start courier-imap daemon."
287 if [ "$1" = "0" ]; then
288 if [ -f /var/lock/subsys/courier-imap ]; then
289 /etc/rc.d/init.d/courier-imap stop >&2
291 /sbin/chkconfig --del courier-imap
294 %triggerin -- %{name} < 3.0.5
295 if [ -f /var/lib/openssl/certs/imapd.pem ]; then
297 echo imapd.pem has been moved automatically to %{_certsdir}
299 mv -f /var/lib/openssl/certs/imapd.pem %{_certsdir}
301 if [ -f /etc/sysconfig/courier-imap ]; then
302 . /etc/sysconfig/courier-imap
303 for opt in `grep ^[^#] /etc/sysconfig/courier-imap |grep -v TLS_CERTFILE |grep -v MAILDIR|grep -v COURIERTLS |cut -d= -f1`;
306 sed s/^$opt=.*/"$opt=\"$opt2\""/ < %{_sysconfdir}/imapd > %{_sysconfdir}/imapd.new
307 mv -f %{_sysconfdir}/imapd.new %{_sysconfdir}/imapd
308 sed s/^$opt=.*/"$opt=\"$opt2\""/ < %{_sysconfdir}/imapd-ssl > %{_sysconfdir}/imapd-ssl.new
309 mv -f %{_sysconfdir}/imapd-ssl.new %{_sysconfdir}/imapd-ssl
312 sed s/^SSLADDRESS=.*/"SSLADDRESS=$ADDRESS_SSL"/ < %{_sysconfdir}/imapd-ssl > %{_sysconfdir}/imapd-ssl.new
313 sed s/^SSLPORT=.*/"SSLPORT=$PORTS_SSL"/ < %{_sysconfdir}/imapd-ssl.new > %{_sysconfdir}/imapd-ssl
315 echo IMAPD config file has been rewriten to %{_sysconfdir}/imapd,imapd-ssl
317 if [ -f /var/lock/subsys/courier-imap ]; then
318 /etc/rc.d/init.d/courier-imap restart >&2
321 %triggerin -n %{name}-common -- %{name}-common < 3.0.5
322 /sbin/chkconfig --del authdaemon
323 rm -f /var/lock/subsys/authdaemon
324 if [ -f /etc/sysconfig/authdaemon ]; then
325 . /etc/sysconfig/authdaemon
326 sed s/^version.*/version=authdaemon.$METHOD/ <%{_sysconfdir}/authdaemonrc >%{_sysconfdir}/authdaemonrc.new
327 mv -f %{_sysconfdir}/authdaemonrc.new %{_sysconfdir}/authdaemonrc
330 echo Changes to version 3.0.5 :
331 echo - config files has been splited and moved to %{_sysconfdir}
332 echo - certificates directory has changed to %{_certsdir}
336 /sbin/chkconfig --add courier-pop3
337 /sbin/chkconfig --del courier-imap-pop3 >/dev/null 2>&1 || :
338 if [ -f /var/lock/subsys/courier-imap-pop3 ]; then
339 /etc/rc.d/init.d/courier-imap-pop3 stop >&2
340 /etc/rc.d/init.d/courier-pop3 start >&2
341 elif [ -f /var/lock/subsys/courier-pop3 ]; then
342 /etc/rc.d/init.d/courier-pop3 restart >&2
344 echo "Run \"/etc/rc.d/init.d/courier-pop3 start\" to start courier-pop3 daemon."
348 if [ "$1" = "0" ]; then
349 if [ -f /var/lock/subsys/courier-pop3 ]; then
350 /etc/rc.d/init.d/courier-pop3 stop >&2
352 /sbin/chkconfig --del courier-pop3
355 %triggerin -n %{name}-pop3 -- %{name}-pop3 < 3.0.5
356 if [ -f /var/lib/openssl/certs/pop3d.pem ]; then
358 echo pop3d.pem has been moved automatically to %{_certsdir}
360 mv -f /var/lib/openssl/certs/pop3d.pem %{_certsdir}
362 if [ -f /etc/sysconfig/courier-pop3 ]; then
363 . /etc/sysconfig/courier-pop3
364 for opt in `grep ^[^#] /etc/sysconfig/courier-pop3 |grep -v TLS_CERTFILE |grep -v MAILDIR|grep -v COURIERTLS |cut -d= -f1`;
367 sed s/^$opt=.*/"$opt=\"$opt2\""/ < %{_sysconfdir}/pop3d > %{_sysconfdir}/pop3d.new
368 mv -f %{_sysconfdir}/pop3d.new %{_sysconfdir}/pop3d
369 sed s/^$opt=.*/"$opt=\"$opt2\""/ < %{_sysconfdir}/pop3d-ssl > %{_sysconfdir}/pop3d-ssl.new
370 mv -f %{_sysconfdir}/pop3d-ssl.new %{_sysconfdir}/pop3d-ssl
374 echo POP3D config file has been rewriten to %{_sysconfdir}/pop3d,pop3d-ssl
376 if [ -f /var/lock/subsys/courier-pop3 ]; then
377 /etc/rc.d/init.d/courier-pop3 restart >&2
381 if ps -A |grep -q authdaemond.lda; then
382 %{_libexecdir}/authlib/authdaemond stop
383 %{_libexecdir}/authlib/authdaemond start
387 if [ -x %{_libexecdir}/authlib/authdaemond ]; then
388 if ps -A |grep -q authdaemond.lda; then
389 %{_libexecdir}/authlib/authdaemond stop;
390 %{_libexecdir}/authlib/authdaemond start;
395 if ps -A |grep -q authdaemond.mys; then
396 %{_libexecdir}/authlib/authdaemond stop
397 %{_libexecdir}/authlib/authdaemond start
401 if [ -x %{_libexecdir}/authlib/authdaemond ]; then
402 if ps -A |grep -q authdaemond.mys; then
403 %{_libexecdir}/authlib/authdaemond stop;
404 %{_libexecdir}/authlib/authdaemond start;
409 if ps -A |grep -q authdaemond.pgs; then
410 %{_libexecdir}/authlib/authdaemond stop
411 %{_libexecdir}/authlib/authdaemond start
415 if [ -x %{_libexecdir}/authlib/authdaemond ]; then
416 if ps -A |grep -q authdaemond.pgs; then
417 %{_libexecdir}/authlib/authdaemond stop;
418 %{_libexecdir}/authlib/authdaemond start;
423 %defattr(644,root,root,755)
424 %doc maildir/README.sharedfolders.html
425 %attr(640,root,root) %config(noreplace) %verify(not size mtime md5) /etc/pam.d/imap
426 %attr(640,root,root) %config(noreplace) %verify(not size mtime md5) /etc/security/blacklist.imap
427 %attr(640,root,root) %config(noreplace) %verify(not size mtime md5) %{_sysconfdir}/imapd
428 %attr(640,root,root) %config(noreplace) %verify(not size mtime md5) %{_sysconfdir}/imapd-ssl
429 %attr(640,root,root) %config(noreplace) %verify(not size mtime md5) %{_sysconfdir}/imapd.cnf
430 %attr(754,root,root) /etc/rc.d/init.d/courier-imap
431 %attr(750,daemon,daemon) %dir %{_sysconfdir}/shared
432 %attr(755,root,root) %{_bindir}/imapd
433 %attr(755,root,root) %{_bindir}/maildiracl
434 %attr(755,root,root) %{_bindir}/maildirkw
435 %attr(755,root,root) %{_sbindir}/authenumerate
436 %attr(755,root,root) %{_sbindir}/imaplogin
437 %attr(755,root,root) %{_sbindir}/mkimapdcert
438 %attr(755,root,root) %{_sbindir}/sharedindexinstall
439 %attr(755,root,root) %{_sbindir}/sharedindexsplit
440 %attr(755,root,root) %{_libexecdir}/imapd.rc
441 %attr(755,root,root) %{_libexecdir}/imapd-ssl.rc
442 %{_mandir}/man8/imapd*
443 %{_mandir}/man1/maildiracl.1*
444 %{_mandir}/man1/maildirkw.1*
447 %defattr(644,root,root,755)
448 %doc AUTHORS ChangeLog imap/BUGS INSTALL README*
449 %attr(700,root,root) /var/lib/authdaemon
450 %attr(750,root,root) %dir %{_sysconfdir}
451 %attr(750,root,root) %dir %{_certsdir}
453 %dir %{_libexecdir}/authlib
454 %config(noreplace) %verify(not size mtime md5) %{_sysconfdir}/authdaemonrc
455 %{_sysconfdir}/quotawarnmsg.example
456 %attr(755,root,root) %{_bindir}/couriertls
457 %attr(755,root,root) %{_libexecdir}/authlib/authdaemon
458 %attr(755,root,root) %{_libexecdir}/authlib/authdaemond
459 %attr(755,root,root) %{_libexecdir}/authlib/authdaemond.plain
460 %attr(755,root,root) %{_libexecdir}/couriertcpd
461 %attr(755,root,root) %{_libexecdir}/makedatprog
462 %attr(755,root,root) %{_sbindir}/courierlogger
463 %{_mandir}/man8/auth[cdsuv]*
464 %{_mandir}/man8/authp[aw]*
465 %{_mandir}/man7/authlib*
466 %{_mandir}/man1/courierlogger*
467 %{_mandir}/man1/couriert*
468 %{_mandir}/man8/couriert*
472 %defattr(644,root,root,755)
473 %attr(755,root,root) %{_sbindir}/makeuserdb
474 %attr(755,root,root) %{_sbindir}/pw2userdb
475 %attr(755,root,root) %{_sbindir}/userdb
476 %attr(755,root,root) %{_sbindir}/userdbpw
477 %attr(755,root,root) %{_sbindir}/vchkpw2userdb
478 %{_mandir}/man8/makeuserdb*
479 %{_mandir}/man8/userdb*
480 %{_mandir}/man8/*pw2userdb*
483 %defattr(644,root,root,755)
484 %attr(755,root,root) %{_bindir}/deliverquota
485 %{_mandir}/man8/deliverquota*
488 %defattr(644,root,root,755)
489 %attr(755,root,root) %{_bindir}/maildirmake
490 %{_mandir}/man1/maildirmake*
493 %defattr(644,root,root,755)
494 %attr(640,root,root) %config(noreplace) %verify(not size mtime md5) /etc/pam.d/pop3
495 %attr(640,root,root) %config(noreplace) %verify(not size mtime md5) /etc/security/blacklist.pop3
496 %attr(640,root,root) %config(noreplace) %verify(not size mtime md5) %{_sysconfdir}/pop3d
497 %attr(640,root,root) %config(noreplace) %verify(not size mtime md5) %{_sysconfdir}/pop3d-ssl
498 %attr(640,root,root) %config(noreplace) %verify(not size mtime md5) %{_sysconfdir}/pop3d.cnf
499 %attr(754,root,root) /etc/rc.d/init.d/courier-pop3
500 %attr(755,root,root) %{_bindir}/pop3d
501 %attr(755,root,root) %{_sbindir}/mkpop3dcert
502 %attr(755,root,root) %{_sbindir}/pop3login
503 %attr(755,root,root) %{_libexecdir}/pop3d.rc
504 %attr(755,root,root) %{_libexecdir}/pop3d-ssl.rc
505 %{_mandir}/man8/courierpop*
509 %defattr(644,root,root,755)
510 %attr(640,root,root) %config(noreplace) %verify(not size mtime md5) %{_sysconfdir}/authldaprc
511 %attr(755,root,root) %{_libexecdir}/authlib/authdaemond.ldap
512 %{_mandir}/man8/authldap*
517 %defattr(644,root,root,755)
518 %attr(640,root,root) %config(noreplace) %verify(not size mtime md5) %{_sysconfdir}/authmysqlrc
519 %attr(755,root,root) %{_libexecdir}/authlib/authdaemond.mysql
520 %{_mandir}/man8/authmysql*
525 %defattr(644,root,root,755)
526 %attr(640,root,root) %config(noreplace) %verify(not size mtime md5) %{_sysconfdir}/authpgsqlrc
527 %attr(755,root,root) %{_libexecdir}/authlib/authdaemond.pgsql
528 %{_mandir}/man8/authpgsql*