3 %bcond_without gssapi # without GSSAPI support
4 %bcond_without ldap # without LDAP auth
5 %bcond_without lua # without Lua auth
6 %bcond_without mysql # without MySQL auth
7 %bcond_without pgsql # without PostgreSQL auth
8 %bcond_without sqlite # without SQLite3 auth
9 %bcond_without sasl # without SASL auth
10 %bcond_without tests # tests
12 Summary: IMAP and POP3 server written with security primarily in mind
13 Summary(pl.UTF-8): Serwer IMAP i POP3 pisany głównie z myślą o bezpieczeństwie
18 License: MIT (libraries), LGPL v2.1 (the rest)
19 Group: Networking/Daemons
20 Source0: http://dovecot.org/releases/2.3/%{name}-%{version}.tar.gz
21 # Source0-md5: f06f2272fad04e7b0207f8d00a291f66
24 Source3: %{name}.sysconfig
25 Source4: %{name}.tmpfiles
26 Patch0: %{name}-config.patch
27 Patch1: %{name}-rpath.patch
28 Patch2: %{name}-shebang.patch
30 URL: http://dovecot.org/
31 BuildRequires: autoconf
32 BuildRequires: automake
33 BuildRequires: bzip2-devel
34 BuildRequires: clucene-core-devel >= 2.3.3.4
35 BuildRequires: curl-devel
36 %{?with_sasl:BuildRequires: cyrus-sasl-devel >= 2.0}
37 BuildRequires: expat-devel
38 BuildRequires: gettext-tools
39 %{?with_gssapi:BuildRequires: heimdal-devel}
40 BuildRequires: libapparmor-devel
41 BuildRequires: libcap-devel
42 BuildRequires: libicu-devel
43 BuildRequires: libstemmer-devel
44 BuildRequires: libexttextcat-devel
45 BuildRequires: libtool
46 %{?with_lua:BuildRequires: lua53-devel}
47 BuildRequires: lz4-devel
48 %{?with_mysql:BuildRequires: mysql-devel}
49 %{?with_ldap:BuildRequires: openldap-devel >= 2.3.3}
50 BuildRequires: openssl-devel >= 0.9.7d
51 BuildRequires: pam-devel
52 BuildRequires: pkgconfig
53 %{?with_pgsql:BuildRequires: postgresql-devel}
54 BuildRequires: rpmbuild(macros) >= 1.647
55 BuildRequires: sed >= 4.0
56 %{?with_sqlite:BuildRequires: sqlite3-devel}
57 BuildRequires: xz-devel
58 BuildRequires: zlib-devel
59 Requires(post,preun): /sbin/chkconfig
60 Requires(postun): /usr/sbin/groupdel
61 Requires(postun): /usr/sbin/userdel
62 Requires(pre): /bin/id
63 Requires(pre): /usr/bin/getgid
64 Requires(pre): /usr/sbin/groupadd
65 Requires(pre): /usr/sbin/useradd
66 Requires: %{name}-libs = %{epoch}:%{version}-%{release}
67 Requires: pam >= 0.79.0
68 Provides: group(dovecot)
71 Provides: user(dovecot)
72 # heimdal-daemons in PLD contained only "popper" (kerberized POP3 daemon)
73 %{?with_gssapi:Obsoletes: heimdal-daemons}
74 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
76 %define no_install_post_check_so 1
79 Dovecot is an IMAP and POP3 server for Linux/UNIX-like systems,
80 written with security primarily in mind. Although it's written with C,
81 it uses several coding techniques to avoid most of the common
84 Dovecot can work with standard mbox and maildir formats and it's fully
85 compatible with UW-IMAP and Courier IMAP servers as well as mail
86 clients accessing the mailboxes directly. It's also planned to support
87 storing mails in SQL databases.
89 Dovecot is easy to set up and doesn't require special maintenance.
90 Only thing you need is to get the authentication working properly - if
91 your users are in /etc/passwd there's hardly anything you have to do.
93 Dovecot should be pretty fast, mostly because of index files that
94 Dovecot maintains; instead of having to scan through all the data in
95 mailbox, Dovecot can get most of the wanted information from index
99 - should be quite ready for use with normal IMAP clients
100 - complete IMAP4rev1 and POP3 support
101 - supports THREAD, SORT and IDLE extensions, required by many IMAP
103 - complete TLS/SSL support
105 - shared mailboxes aren't yet supported
106 - Maildir++ quota is supported, bad hard filesystem quota can be
109 %description -l pl.UTF-8
110 Dovecot to serwer IMAP i POP3 dla systemów linuksowych/uniksowych,
111 pisany głównie z myślą o bezpieczeństwie. Chociaż jest pisany w C,
112 używa kilku technik kodowania zapobiegających większości popularnych
115 Dovecot może działać ze standardowymi formatami mbox i maildir, jest
116 całkowicie kompatybilny z serwerami UW-IMAP i Courier IMAP, a także z
117 klientami pocztowymi bezpośrednio dostającymi się do skrzynek.
118 Planowana jest także obsługa przechowywania listów w bazach SQL.
120 Dovecot jest łatwy do skonfigurowania i nie wymaga specjalnego
121 nadzoru. Wystarczy tylko doprowadzić do działania uwierzytelnianie -
122 jeśli użytkownicy są w /etc/passwd, to właściwie nie trzeba nic
125 Dovecot powinien być w miarę szybki, głównie z powodu plików
126 indeksowych utrzymywanych przez serwer; zamiast potrzeby skanowania
127 wszystkich danych w skrzynce, Dovecot może małym kosztem uzyskać
128 większość potrzebnych informacji z indeksu.
131 - powinien być gotowy do użycia ze zwykłymi klientami IMAP
132 - pełna obsługa IMAP4rev1 i POP3
133 - obsługa rozszerzeń THREAD, SORT i IDLE, wymaganych przez wiele
136 - pełna obsługa TLS/SSL
137 - quota Maildir++ jest obsługiwana, ale twarda quota na systemach
138 plików może być problematyczna
141 Summary: Dovecot shared libraries
142 Summary(pl.UTF-8): Współdzielone biblioteki Dovecota
143 Group: Development/Libraries
146 Dovecot shared libraries.
148 %description libs -l pl.UTF-8
149 Współdzielone biblioteki Dovecota.
152 Summary: Development package for Dovecot plugins
153 Summary(pl.UTF-8): Pakiet programistyczny do tworzenia wtyczek dla Dovecota
154 Group: Development/Libraries
155 Requires: %{name}-libs = %{epoch}:%{version}-%{release}
158 Development package for Dovecot plugins.
160 %description devel -l pl.UTF-8
161 Pakiet programistyczny do tworzenia wtyczek dla Dovecota.
170 %{__sed} -i 's,/usr/lib/dovecot,%{_libdir}/dovecot,g' doc/example-config/*.conf doc/example-config/conf.d/*.conf
172 %{__sed} -i 's,#!/usr/bin/env bash,#!/bin/bash,' src/util/health-check.sh
177 %{__aclocal} -I . -I m4
182 ac_cv_prog_VALGRIND=no \
183 CPPFLAGS="%{rpmcppflags} -I/usr/include/libstemmer -D_LINUX_QUOTA_VERSION=2" \
186 %{?debug:--enable-debug} \
187 %{?with_ldap:--with-ldap=yes} \
188 %{?with_mysql:--with-mysql} \
189 %{?with_pgsql:--with-pgsql} \
190 %{?with_sqlite:--with-sqlite} \
191 %{?with_gssapi:--with-gssapi=plugin} \
192 %{?with_lua:--with-lua=plugin} \
203 --without-libunwind \
205 --with-moduledir=%{_libdir}/%{name}/plugins \
206 --with-ssldir=/var/lib/openssl \
207 --sysconfdir=%{_sysconfdir} \
208 --with-systemdsystemunitdir=%{systemdunitdir}
212 %{?with_tests:%{__make} check}
215 rm -rf $RPM_BUILD_ROOT
216 install -d $RPM_BUILD_ROOT/etc/{pam.d,rc.d/init.d,sysconfig,security} \
217 $RPM_BUILD_ROOT{/var/lib/dovecot,/var/run/dovecot/login} \
218 $RPM_BUILD_ROOT/usr/lib/tmpfiles.d
221 DESTDIR=$RPM_BUILD_ROOT
223 mv -f $RPM_BUILD_ROOT%{_datadir}/doc/%{name}/example-config/* $RPM_BUILD_ROOT%{_sysconfdir}/dovecot
225 cp -a %{SOURCE1} $RPM_BUILD_ROOT/etc/pam.d/%{name}
226 install -p %{SOURCE2} $RPM_BUILD_ROOT/etc/rc.d/init.d/%{name}
227 cp -a %{SOURCE3} $RPM_BUILD_ROOT/etc/sysconfig/%{name}
228 install %{SOURCE4} $RPM_BUILD_ROOT/usr/lib/tmpfiles.d/%{name}.conf
230 touch $RPM_BUILD_ROOT/etc/security/blacklist.imap
232 find $RPM_BUILD_ROOT%{_libdir}/%{name} -name '*.la' | xargs rm
234 %{__rm} -r $RPM_BUILD_ROOT%{_docdir}/%{name}
235 %{__rm} -r $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/README
238 rm -rf $RPM_BUILD_ROOT
241 %groupadd -g 172 dovecot
242 %useradd -u 172 -d /usr/share/empty -s /bin/false -c "Dovecot server" -g dovecot dovecot
243 %groupadd -g 254 dovenull
244 %useradd -u 254 -d /usr/share/empty -s /bin/false -c "Dovecot server" -g dovenull dovenull
247 /sbin/chkconfig --add dovecot
248 %service dovecot restart
249 %systemd_post dovecot.socket dovecot.service
252 if [ "$1" = "0" ]; then
253 %service dovecot stop
254 /sbin/chkconfig --del dovecot
256 %systemd_preun dovecot.service dovecot.socket
259 if [ "$1" = "0" ]; then
263 %groupremove dovenull
267 %post libs -p /sbin/ldconfig
268 %postun libs -p /sbin/ldconfig
271 # restart devocot if pam is upgraded
272 # (dovecot is linked with old libpam but tries to open modules linked with new libpam)
273 if [ "$2" != 1 ]; then
274 %service -q dovecot restart
277 %triggerpostun -- dovecot < 1:2.0.0
278 # upgrading dovecot < 1.1
279 echo "Configuration change default_mail_env -> mail_location"
280 %{__sed} -i -e "s/^default_mail_env/mail_location/" /etc/dovecot/dovecot.conf
281 # upgrading dovecot < 2.0
283 for a in /etc/dovecot/dovecot-db-example.conf \
284 /etc/dovecot/dovecot-dict-sql-example.conf \
285 /etc/dovecot/dovecot-ldap-example.conf \
286 /etc/dovecot/dovecot-sql-example.conf \
287 /etc/dovecot/dovecot.conf; do
289 [ "$i" -eq 0 ] && echo "Read http://wiki2.dovecot.org/Upgrading/2.0"
291 echo "Trying to migrate $a config file to dovecot 2."
292 cp -a "$a" "$a-1.2.org"
295 # convert config and prefix stderr lines with #
296 %{_bindir}/doveconf -n -c "$a-1.2.org" > "$a" 2> "$a.log" || :
299 if [ "$i" -eq 1 ]; then
300 echo "Please verify contents of %{_sysconfdir}/%{name}/* files."
303 %triggerpostun -- %{name} < 1:2.2.4-2
304 %systemd_trigger dovecot.service dovecot.socket
307 %defattr(644,root,root,755)
308 # COPYING contains some notes, not actual LGPL text
309 %doc AUTHORS COPYING ChangeLog NEWS README TODO doc/*.txt doc/*.c*f doc/wiki/*.txt
310 %attr(755,root,root) %{_bindir}/doveadm
311 %attr(755,root,root) %{_bindir}/doveconf
312 %attr(755,root,root) %{_bindir}/dovecot-sysreport
313 %attr(755,root,root) %{_bindir}/dsync
314 %attr(755,root,root) %{_sbindir}/%{name}
315 %attr(751,root,root) %dir %{_sysconfdir}/%{name}
316 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}/%{name}.conf
317 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}/*.ext
318 %attr(751,root,root) %dir %{_sysconfdir}/%{name}/conf.d
319 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}/conf.d/*.conf
320 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}/conf.d/*.ext
321 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/pam.d/%{name}
322 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/security/blacklist.imap
323 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/%{name}
324 %attr(754,root,root) /etc/rc.d/init.d/%{name}
325 %if "%{_libexecdir}" != "%{_libdir}"
326 %dir %{_libexecdir}/%{name}
328 %attr(755,root,root) %{_libexecdir}/%{name}/aggregator
329 %attr(755,root,root) %{_libexecdir}/%{name}/anvil
330 %attr(755,root,root) %{_libexecdir}/%{name}/auth
331 %attr(755,root,root) %{_libexecdir}/%{name}/checkpassword-reply
332 %attr(755,root,root) %{_libexecdir}/%{name}/config
333 %attr(755,root,root) %{_libexecdir}/%{name}/decode2text.sh
334 %attr(755,root,root) %{_libexecdir}/%{name}/deliver
335 %attr(755,root,root) %{_libexecdir}/%{name}/dict
336 %attr(755,root,root) %{_libexecdir}/%{name}/director
337 %attr(755,root,root) %{_libexecdir}/%{name}/dns-client
338 %attr(755,root,root) %{_libexecdir}/%{name}/doveadm-server
339 %attr(755,root,root) %{_libexecdir}/%{name}/dovecot-lda
340 %attr(755,root,root) %{_libexecdir}/%{name}/gdbhelper
341 %attr(755,root,root) %{_libexecdir}/%{name}/health-check.sh
342 %attr(755,root,root) %{_libexecdir}/%{name}/imap
343 %attr(755,root,root) %{_libexecdir}/%{name}/imap-hibernate
344 %attr(755,root,root) %{_libexecdir}/%{name}/imap-login
345 %attr(755,root,root) %{_libexecdir}/%{name}/imap-urlauth
346 %attr(755,root,root) %{_libexecdir}/%{name}/imap-urlauth-login
347 %attr(755,root,root) %{_libexecdir}/%{name}/imap-urlauth-worker
348 %attr(755,root,root) %{_libexecdir}/%{name}/indexer
349 %attr(755,root,root) %{_libexecdir}/%{name}/indexer-worker
350 %attr(755,root,root) %{_libexecdir}/%{name}/ipc
351 %attr(755,root,root) %{_libexecdir}/%{name}/lmtp
352 %attr(755,root,root) %{_libexecdir}/%{name}/log
353 %attr(755,root,root) %{_libexecdir}/%{name}/maildirlock
354 %attr(755,root,root) %{_libexecdir}/%{name}/old-stats
355 %attr(755,root,root) %{_libexecdir}/%{name}/pop3
356 %attr(755,root,root) %{_libexecdir}/%{name}/pop3-login
357 %attr(755,root,root) %{_libexecdir}/%{name}/quota-status
358 %attr(755,root,root) %{_libexecdir}/%{name}/rawlog
359 %attr(755,root,root) %{_libexecdir}/%{name}/replicator
360 %attr(755,root,root) %{_libexecdir}/%{name}/script
361 %attr(755,root,root) %{_libexecdir}/%{name}/script-login
362 %attr(755,root,root) %{_libexecdir}/%{name}/stats
363 %attr(755,root,root) %{_libexecdir}/%{name}/submission
364 %attr(755,root,root) %{_libexecdir}/%{name}/submission-login
365 %attr(755,root,root) %{_libexecdir}/%{name}/xml2text
366 %attr(755,root,root) %{_libdir}/%{name}/libdcrypt_openssl.so
367 %dir %{_libdir}/%{name}/plugins
368 %attr(755,root,root) %{_libdir}/%{name}/plugins/*.so
369 %dir %{_libdir}/%{name}/plugins/auth
370 %attr(755,root,root) %{_libdir}/%{name}/plugins/auth/*.so
371 %dir %{_libdir}/%{name}/plugins/dict
372 %attr(755,root,root) %{_libdir}/%{name}/plugins/dict/*.so
373 %dir %{_libdir}/%{name}/plugins/doveadm
374 %attr(755,root,root) %{_libdir}/%{name}/plugins/doveadm/*.so
375 %dir %{_libdir}/%{name}/plugins/old-stats
376 %attr(755,root,root) %{_libdir}/%{name}/plugins/old-stats/*.so
378 %{systemdunitdir}/dovecot.service
379 %{systemdunitdir}/dovecot.socket
380 /usr/lib/tmpfiles.d/%{name}.conf
381 %dir /var/lib/dovecot
382 %dir /var/run/dovecot
383 %attr(750,root,dovenull) %dir /var/run/dovecot/login
385 %{_mandir}/man1/deliver.1*
386 %{_mandir}/man1/dove*.1*
387 %{_mandir}/man1/dsync.1*
388 %{_mandir}/man7/doveadm-search-query.7*
391 %defattr(644,root,root,755)
392 %dir %{_libdir}/%{name}
394 %attr(755,root,root) %{_libdir}/%{name}/libdovecot.so.0.0.0
395 %attr(755,root,root) %{_libdir}/%{name}/libdovecot-compression.so.0.0.0
396 %attr(755,root,root) %{_libdir}/%{name}/libdovecot-dsync.so.0.0.0
397 %attr(755,root,root) %{_libdir}/%{name}/libdovecot-fts.so.0.0.0
398 %attr(755,root,root) %{_libdir}/%{name}/libdovecot-lda.so.0.0.0
399 %{?with_ldap:%attr(755,root,root) %{_libdir}/%{name}/libdovecot-ldap.so.0.0.0}
400 %attr(755,root,root) %{_libdir}/%{name}/libdovecot-login.so.0.0.0
401 %attr(755,root,root) %{_libdir}/%{name}/libdovecot-sql.so.0.0.0
402 %attr(755,root,root) %{_libdir}/%{name}/libdovecot-storage.so.0.0.0
403 # Note: we are in %{_libdir}/dovecot, ldconfig does not look into this
404 # directory. This is why the following files are not %ghost
405 %attr(755,root,root) %{_libdir}/%{name}/libdovecot.so.0
406 %attr(755,root,root) %{_libdir}/%{name}/libdovecot-compression.so.0
407 %attr(755,root,root) %{_libdir}/%{name}/libdovecot-dsync.so.0
408 %attr(755,root,root) %{_libdir}/%{name}/libdovecot-fts.so.0
409 %attr(755,root,root) %{_libdir}/%{name}/libdovecot-lda.so.0
410 %{?with_ldap:%attr(755,root,root) %{_libdir}/%{name}/libdovecot-ldap.so.0}
411 %attr(755,root,root) %{_libdir}/%{name}/libdovecot-login.so.0
412 %attr(755,root,root) %{_libdir}/%{name}/libdovecot-sql.so.0
413 %attr(755,root,root) %{_libdir}/%{name}/libdovecot-storage.so.0
416 %defattr(644,root,root,755)
417 %attr(755,root,root) %{_libdir}/%{name}/libdovecot.so
418 %attr(755,root,root) %{_libdir}/%{name}/libdovecot-compression.so
419 %attr(755,root,root) %{_libdir}/%{name}/libdovecot-dsync.so
420 %attr(755,root,root) %{_libdir}/%{name}/libdovecot-fts.so
421 %attr(755,root,root) %{_libdir}/%{name}/libdovecot-lda.so
422 %{?with_ldap:%attr(755,root,root) %{_libdir}/%{name}/libdovecot-ldap.so}
423 %attr(755,root,root) %{_libdir}/%{name}/libdovecot-login.so
424 %attr(755,root,root) %{_libdir}/%{name}/libdovecot-sql.so
425 %attr(755,root,root) %{_libdir}/%{name}/libdovecot-storage.so
426 %{_libdir}/%{name}/%{name}-config
427 %{_includedir}/%{name}
428 %{_aclocaldir}/dovecot.m4