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