7 %bcond_without ldap # without LDAP support
8 %bcond_without mysql # without MySQL support
9 %bcond_without pgsql # without PostgreSQL support
10 Summary: Courier-IMAP server
11 Summary(pl): Serwer Courier-IMAP
16 Group: Networking/Daemons
17 Source0: http://dl.sourceforge.net/courier/%{name}-%{version}.tar.bz2
18 # Source0-md5: 8b0c79997905dc46cfe4cc13be74ceaf
20 Source2: %{name}-pop3.init
22 Source4: %{name}-pop3.pamd
23 Patch0: %{name}-dirs.patch
24 Patch1: %{name}-certsdir.patch
25 Patch2: %{name}-maildir.patch
26 URL: http://www.inter7.com/courierimap/
27 BuildRequires: autoconf >= 2.54
28 BuildRequires: automake
29 BuildRequires: gdbm-devel
30 BuildRequires: libstdc++-devel
31 %{?with_mysql:BuildRequires: mysql-devel}
32 %{?with_ldap:BuildRequires: openldap-devel}
33 BuildRequires: openssl-devel >= 0.9.7d
34 %{?with_pgsql:BuildRequires: postgresql-devel}
36 BuildRequires: sysconftool
37 %{?with_mysql:BuildRequires: zlib-devel}
38 PreReq: %{name}-common = %{version}-%{release}
40 Requires(post,preun): /sbin/chkconfig
41 Requires: pam >= 0.77.3
44 Conflicts: cyrus-imapd
46 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
48 %define _libexecdir /usr/%{_lib}/courier-imap
49 %define _sysconfdir /etc/courier-imap
50 %define _certsdir %{_sysconfdir}/certs
53 Courier-IMAP is an IMAP server for Maildir mailboxes.
56 Courier-IMAP jest serwerem IMAP dla skrzynek pocztowych Maildir.
59 Summary: Common files for imap and pop3 daemons
60 Summary(pl): Pliki wspólne dla serwerów imap i pop3
61 Group: Networking/Daemons
63 Requires(post,preun): /sbin/chkconfig
64 Requires: %{name}-deliverquota = %{version}-%{release}
65 Requires: %{name}-maildirmake = %{version}-%{release}
66 Requires: %{name}-userdb = %{version}-%{release}
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
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,sysconfig} \
213 $RPM_BUILD_ROOT{%{_sysconfdir}/shared,%{_certsdir},/var/lib/authdaemon}
216 DESTDIR=$RPM_BUILD_ROOT
218 install courier-imap $RPM_BUILD_ROOT/etc/rc.d/init.d/courier-imap
219 install courier-pop3 $RPM_BUILD_ROOT/etc/rc.d/init.d/courier-pop3
220 install %{SOURCE3} $RPM_BUILD_ROOT/etc/pam.d/imap
221 install %{SOURCE4} $RPM_BUILD_ROOT/etc/pam.d/pop3
223 rm -rf $RPM_BUILD_ROOT%{_mandir}/man8/{authcram,authpam,authpwd,authshadow,authuserdb,authvchkpw,pw2userdb,vchkpw2userdb,authdaemon,authdaemond,authldap,authmysql}.8 \
224 $RPM_BUILD_ROOT%{_sbindir}/{*db,mk*cert}
226 mv -f authlib/README.authmysql.html README.authmysql.html
227 mv -f authlib/README.ldap README.ldap
228 mv -f authlib/README.authmysql.myownquery README.authmysql.myownquery
229 mv -f imap/README README.imap
230 mv -f imap/ChangeLog ChangeLog
231 mv -f maildir/README.maildirquota.txt README.maildirquota
233 install authlib/authdaemonrc $RPM_BUILD_ROOT%{_sysconfdir}
234 install authlib/authldaprc $RPM_BUILD_ROOT%{_sysconfdir}
235 install authlib/authmysqlrc $RPM_BUILD_ROOT%{_sysconfdir}
236 install authlib/authpgsqlrc $RPM_BUILD_ROOT%{_sysconfdir}
238 mv -f $RPM_BUILD_ROOT%{_datadir}/*db \
239 $RPM_BUILD_ROOT%{_sbindir}
240 mv -f $RPM_BUILD_ROOT%{_datadir}/mk*cert \
241 $RPM_BUILD_ROOT%{_sbindir}
243 mv -f tcpd/couriertls.1 $RPM_BUILD_ROOT%{_mandir}/man8/couriertls.8
244 mv -f imap/courierpop3d.8 $RPM_BUILD_ROOT%{_mandir}/man8/courierpop3d.8
246 echo ".so man7/authlib.7" >$RPM_BUILD_ROOT%{_mandir}/man8/authcram.8
247 echo ".so man7/authlib.7" >$RPM_BUILD_ROOT%{_mandir}/man8/authpam.8
248 echo ".so man7/authlib.7" >$RPM_BUILD_ROOT%{_mandir}/man8/authpwd.8
249 echo ".so man7/authlib.7" >$RPM_BUILD_ROOT%{_mandir}/man8/authshadow.8
250 echo ".so man7/authlib.7" >$RPM_BUILD_ROOT%{_mandir}/man8/authuserdb.8
251 echo ".so man7/authlib.7" >$RPM_BUILD_ROOT%{_mandir}/man8/authvchkpw.8
252 echo ".so man7/authlib.7" >$RPM_BUILD_ROOT%{_mandir}/man8/authdaemon.8
253 echo ".so man7/authlib.7" >$RPM_BUILD_ROOT%{_mandir}/man8/authdaemond.8
254 %{?with_pgsql:echo ".so man7/authlib.7" >$RPM_BUILD_ROOT%{_mandir}/man8/authpgsql.8}
255 %{?with_mysql:echo ".so man7/authlib.7" >$RPM_BUILD_ROOT%{_mandir}/man8/authmysql.8}
256 %{?with_ldap:echo ".so man7/authlib.7" >$RPM_BUILD_ROOT%{_mandir}/man8/authldap.8}
257 echo ".so makeuserdb.8" >$RPM_BUILD_ROOT%{_mandir}/man8/pw2userdb.8
258 echo ".so makeuserdb.8" >$RPM_BUILD_ROOT%{_mandir}/man8/vchkpw2userdb.8
260 touch $RPM_BUILD_ROOT/etc/security/blacklist.{pop3,imap}
263 ./sysconftool $RPM_BUILD_ROOT%{_sysconfdir}/*.dist
265 # set yes to start imapd and pop3d
266 sed 's/^POP3DSTART.*/POP3DSTART=YES/' < $RPM_BUILD_ROOT%{_sysconfdir}/pop3d > $RPM_BUILD_ROOT%{_sysconfdir}/pop3d.new
267 mv -f $RPM_BUILD_ROOT%{_sysconfdir}/pop3d.new $RPM_BUILD_ROOT%{_sysconfdir}/pop3d
269 sed 's/^IMAPDSTART.*/IMAPDSTART=YES/' < $RPM_BUILD_ROOT%{_sysconfdir}/imapd > $RPM_BUILD_ROOT%{_sysconfdir}/imapd.new
270 mv -f $RPM_BUILD_ROOT%{_sysconfdir}/imapd.new $RPM_BUILD_ROOT%{_sysconfdir}/imapd
272 # remove unpackaged files
273 rm -f $RPM_BUILD_ROOT%{_sysconfdir}/*.dist
276 rm -rf $RPM_BUILD_ROOT
279 /sbin/chkconfig --add courier-imap
281 if [ -f /var/lock/subsys/courier-imap ]; then
282 /etc/rc.d/init.d/courier-imap restart >&2
284 echo "Run \"/etc/rc.d/init.d/courier-imap start\" to start courier-imap daemon."
288 if [ "$1" = "0" ]; then
289 if [ -f /var/lock/subsys/courier-imap ]; then
290 /etc/rc.d/init.d/courier-imap stop >&2
292 /sbin/chkconfig --del courier-imap
295 %triggerin -- %{name} < 3.0.5
296 if [ -f /var/lib/openssl/certs/imapd.pem ]; then
298 echo imapd.pem has been moved automatically to %{_certsdir}
300 mv -f /var/lib/openssl/certs/imapd.pem %{_certsdir}
303 %triggerin -n %{name}-common -- %{name}-common < 3.0.5
304 /sbin/chkconfig --del authdaemon
305 rm -f /var/lock/subsys/authdaemon
308 /sbin/chkconfig --add courier-pop3
309 /sbin/chkconfig --del courier-imap-pop3 >/dev/null 2>&1 || :
310 if [ -f /var/lock/subsys/courier-imap-pop3 ]; then
311 /etc/rc.d/init.d/courier-imap-pop3 stop >&2
312 /etc/rc.d/init.d/courier-pop3 start >&2
313 elif [ -f /var/lock/subsys/courier-pop3 ]; then
314 /etc/rc.d/init.d/courier-pop3 restart >&2
316 echo "Run \"/etc/rc.d/init.d/courier-pop3 start\" to start courier-pop3 daemon."
318 rm -f /etc/rc.d/init.d/courier-imap-pop3
321 if [ "$1" = "0" ]; then
322 if [ -f /var/lock/subsys/courier-pop3 ]; then
323 /etc/rc.d/init.d/courier-pop3 stop >&2
325 /sbin/chkconfig --del courier-pop3
326 if [ -f /var/lock/subsys/courier-imap-pop3 ]; then
327 /etc/rc.d/init.d/courier-imap-pop3 stop >&2
329 /sbin/chkconfig --del courier-imap-pop3 >/dev/null 2>&1 || :
330 rm -f /etc/rc.d/init.d/courier-imap-pop3
333 %triggerin -n %{name}-pop3 -- %{name}-pop3 < 3.0.5
334 if [ -f /var/lib/openssl/certs/pop3d.pem ]; then
336 echo pop3d.pem has been moved automatically to %{_certsdir}
338 mv -f /var/lib/openssl/certs/pop3d.pem %{_certsdir}
342 if ps -A |grep -q authdaemond.lda; then
343 %{_libexecdir}/authlib/authdaemond stop
344 %{_libexecdir}/authlib/authdaemond start
348 if [ -x %{_libexecdir}/authlib/authdaemond ]; then
349 if ps -A |grep -q authdaemond.lda; then
350 %{_libexecdir}/authlib/authdaemond stop;
351 %{_libexecdir}/authlib/authdaemond start;
356 if ps -A |grep -q authdaemond.mys; then
357 %{_libexecdir}/authlib/authdaemond stop
358 %{_libexecdir}/authlib/authdaemond start
362 if [ -x %{_libexecdir}/authlib/authdaemond ]; then
363 if ps -A |grep -q authdaemond.mys; then
364 %{_libexecdir}/authlib/authdaemond stop;
365 %{_libexecdir}/authlib/authdaemond start;
370 if ps -A |grep -q authdaemond.pgs; then
371 %{_libexecdir}/authlib/authdaemond stop
372 %{_libexecdir}/authlib/authdaemond start
376 if [ -x %{_libexecdir}/authlib/authdaemond ]; then
377 if ps -A |grep -q authdaemond.pgs; then
378 %{_libexecdir}/authlib/authdaemond stop;
379 %{_libexecdir}/authlib/authdaemond start;
384 %defattr(644,root,root,755)
385 %doc maildir/README.sharedfolders.html
386 %attr(640,root,root) %config(noreplace) %verify(not size mtime md5) /etc/pam.d/imap
387 %attr(640,root,root) %config(noreplace) %verify(not size mtime md5) /etc/security/blacklist.imap
388 %attr(640,root,root) %config(noreplace) %verify(not size mtime md5) %{_sysconfdir}/imapd
389 %attr(640,root,root) %config(noreplace) %verify(not size mtime md5) %{_sysconfdir}/imapd-ssl
390 %attr(640,root,root) %config(noreplace) %verify(not size mtime md5) %{_sysconfdir}/imapd.cnf
391 %attr(754,root,root) /etc/rc.d/init.d/courier-imap
392 %attr(750,daemon,daemon) %dir %{_sysconfdir}/shared
393 %attr(755,root,root) %{_bindir}/imapd
394 %attr(755,root,root) %{_bindir}/maildiracl
395 %attr(755,root,root) %{_bindir}/maildirkw
396 %attr(755,root,root) %{_sbindir}/authenumerate
397 %attr(755,root,root) %{_sbindir}/imaplogin
398 %attr(755,root,root) %{_sbindir}/mkimapdcert
399 %attr(755,root,root) %{_sbindir}/sharedindexinstall
400 %attr(755,root,root) %{_sbindir}/sharedindexsplit
401 %attr(755,root,root) %{_libexecdir}/imapd.rc
402 %attr(755,root,root) %{_libexecdir}/imapd-ssl.rc
403 %{_mandir}/man8/imapd*
404 %{_mandir}/man1/maildiracl.1*
405 %{_mandir}/man1/maildirkw.1*
408 %defattr(644,root,root,755)
409 %doc AUTHORS ChangeLog imap/BUGS INSTALL README*
410 %attr(700,root,root) /var/lib/authdaemon
411 %attr(750,root,root) %dir %{_sysconfdir}
412 %attr(750,root,root) %dir %{_certsdir}
414 %dir %{_libexecdir}/authlib
415 %config(noreplace) %verify(not size mtime md5) %{_sysconfdir}/authdaemonrc
416 %{_sysconfdir}/quotawarnmsg.example
417 %attr(755,root,root) %{_bindir}/couriertls
418 %attr(755,root,root) %{_libexecdir}/authlib/authdaemon
419 %attr(755,root,root) %{_libexecdir}/authlib/authdaemond
420 %attr(755,root,root) %{_libexecdir}/authlib/authdaemond.plain
421 %attr(755,root,root) %{_libexecdir}/couriertcpd
422 %attr(755,root,root) %{_libexecdir}/makedatprog
423 %attr(755,root,root) %{_sbindir}/courierlogger
424 %{_mandir}/man8/auth[cdsuv]*
425 %{_mandir}/man8/authp[aw]*
426 %{_mandir}/man7/authlib*
427 %{_mandir}/man1/courierlogger*
428 %{_mandir}/man1/couriert*
429 %{_mandir}/man8/couriert*
433 %defattr(644,root,root,755)
434 %attr(755,root,root) %{_sbindir}/makeuserdb
435 %attr(755,root,root) %{_sbindir}/pw2userdb
436 %attr(755,root,root) %{_sbindir}/userdb
437 %attr(755,root,root) %{_sbindir}/userdbpw
438 %attr(755,root,root) %{_sbindir}/vchkpw2userdb
439 %{_mandir}/man8/makeuserdb*
440 %{_mandir}/man8/userdb*
441 %{_mandir}/man8/*pw2userdb*
444 %defattr(644,root,root,755)
445 %attr(755,root,root) %{_bindir}/deliverquota
446 %{_mandir}/man8/deliverquota*
449 %defattr(644,root,root,755)
450 %attr(755,root,root) %{_bindir}/maildirmake
451 %{_mandir}/man1/maildirmake*
454 %defattr(644,root,root,755)
455 %attr(640,root,root) %config(noreplace) %verify(not size mtime md5) /etc/pam.d/pop3
456 %attr(640,root,root) %config(noreplace) %verify(not size mtime md5) /etc/security/blacklist.pop3
457 %attr(640,root,root) %config(noreplace) %verify(not size mtime md5) %{_sysconfdir}/pop3d
458 %attr(640,root,root) %config(noreplace) %verify(not size mtime md5) %{_sysconfdir}/pop3d-ssl
459 %attr(640,root,root) %config(noreplace) %verify(not size mtime md5) %{_sysconfdir}/pop3d.cnf
460 %attr(754,root,root) /etc/rc.d/init.d/courier-pop3
461 %attr(755,root,root) %{_bindir}/pop3d
462 %attr(755,root,root) %{_sbindir}/mkpop3dcert
463 %attr(755,root,root) %{_sbindir}/pop3login
464 %attr(755,root,root) %{_libexecdir}/pop3d.rc
465 %attr(755,root,root) %{_libexecdir}/pop3d-ssl.rc
466 %{_mandir}/man8/courierpop*
470 %defattr(644,root,root,755)
471 %attr(640,root,root) %config(noreplace) %verify(not size mtime md5) %{_sysconfdir}/authldaprc
472 %attr(755,root,root) %{_libexecdir}/authlib/authdaemond.ldap
473 %{_mandir}/man8/authldap*
478 %defattr(644,root,root,755)
479 %attr(640,root,root) %config(noreplace) %verify(not size mtime md5) %{_sysconfdir}/authmysqlrc
480 %attr(755,root,root) %{_libexecdir}/authlib/authdaemond.mysql
481 %{_mandir}/man8/authmysql*
486 %defattr(644,root,root,755)
487 %attr(640,root,root) %config(noreplace) %verify(not size mtime md5) %{_sysconfdir}/authpgsqlrc
488 %attr(755,root,root) %{_libexecdir}/authlib/authdaemond.pgsql
489 %{_mandir}/man8/authpgsql*