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