3 %bcond_without gssapi # without GSSAPI support
4 %bcond_without ldap # without LDAP auth
5 %bcond_without mysql # without MySQL auth
6 %bcond_without pgsql # without PostgreSQL auth
7 %bcond_without sqlite # without SQLite3 auth
8 %bcond_without sasl # without SASL auth
9 %bcond_without tests # tests
11 Summary: IMAP and POP3 server written with security primarily in mind
12 Summary(pl.UTF-8): Serwer IMAP i POP3 pisany głównie z myślą o bezpieczeństwie
17 License: MIT (libraries), LGPL v2.1 (the rest)
18 Group: Networking/Daemons
19 Source0: http://dovecot.org/releases/2.2/%{name}-%{version}.tar.gz
20 # Source0-md5: 8f62ea76489c47c369cbbe0b19818448
23 Source3: %{name}.sysconfig
24 Source4: %{name}.tmpfiles
25 Patch0: %{name}-config.patch
26 Patch1: %{name}-rpath.patch
27 Patch2: %{name}-local-name.patch
28 Patch3: %{name}-disableSSLv3.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: libcap-devel
40 BuildRequires: libicu-devel
41 BuildRequires: libstemmer-devel
42 BuildRequires: libexttextcat-devel
43 BuildRequires: libtool
44 BuildRequires: lz4-devel
45 %{?with_mysql:BuildRequires: mysql-devel}
46 %{?with_ldap:BuildRequires: openldap-devel >= 2.3.3}
47 BuildRequires: openssl-devel >= 0.9.7d
48 BuildRequires: pam-devel
49 BuildRequires: pkgconfig
50 %{?with_pgsql:BuildRequires: postgresql-devel}
51 BuildRequires: rpmbuild(macros) >= 1.647
52 BuildRequires: sed >= 4.0
53 %{?with_sqlite:BuildRequires: sqlite3-devel}
54 BuildRequires: xz-devel
55 BuildRequires: zlib-devel
56 Requires(post,preun): /sbin/chkconfig
57 Requires(postun): /usr/sbin/groupdel
58 Requires(postun): /usr/sbin/userdel
59 Requires(pre): /bin/id
60 Requires(pre): /usr/bin/getgid
61 Requires(pre): /usr/sbin/groupadd
62 Requires(pre): /usr/sbin/useradd
63 Requires: %{name}-libs = %{epoch}:%{version}-%{release}
64 Requires: pam >= 0.79.0
65 Provides: group(dovecot)
67 Provides: user(dovecot)
68 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
70 %define no_install_post_check_so 1
73 Dovecot is an IMAP and POP3 server for Linux/UNIX-like systems,
74 written with security primarily in mind. Although it's written with C,
75 it uses several coding techniques to avoid most of the common
78 Dovecot can work with standard mbox and maildir formats and it's fully
79 compatible with UW-IMAP and Courier IMAP servers as well as mail
80 clients accessing the mailboxes directly. It's also planned to support
81 storing mails in SQL databases.
83 Dovecot is easy to set up and doesn't require special maintenance.
84 Only thing you need is to get the authentication working properly - if
85 your users are in /etc/passwd there's hardly anything you have to do.
87 Dovecot should be pretty fast, mostly because of index files that
88 Dovecot maintains; instead of having to scan through all the data in
89 mailbox, Dovecot can get most of the wanted information from index
93 - should be quite ready for use with normal IMAP clients
94 - complete IMAP4rev1 and POP3 support
95 - supports THREAD, SORT and IDLE extensions, required by many IMAP
97 - complete TLS/SSL support
99 - shared mailboxes aren't yet supported
100 - Maildir++ quota is supported, bad hard filesystem quota can be
103 %description -l pl.UTF-8
104 Dovecot to serwer IMAP i POP3 dla systemów linuksowych/uniksowych,
105 pisany głównie z myślą o bezpieczeństwie. Chociaż jest pisany w C,
106 używa kilku technik kodowania zapobiegających większości popularnych
109 Dovecot może działać ze standardowymi formatami mbox i maildir, jest
110 całkowicie kompatybilny z serwerami UW-IMAP i Courier IMAP, a także z
111 klientami pocztowymi bezpośrednio dostającymi się do skrzynek.
112 Planowana jest także obsługa przechowywania listów w bazach SQL.
114 Dovecot jest łatwy do skonfigurowania i nie wymaga specjalnego
115 nadzoru. Wystarczy tylko doprowadzić do działania uwierzytelnianie -
116 jeśli użytkownicy są w /etc/passwd, to właściwie nie trzeba nic
119 Dovecot powinien być w miarę szybki, głównie z powodu plików
120 indeksowych utrzymywanych przez serwer; zamiast potrzeby skanowania
121 wszystkich danych w skrzynce, Dovecot może małym kosztem uzyskać
122 większość potrzebnych informacji z indeksu.
125 - powinien być gotowy do użycia ze zwykłymi klientami IMAP
126 - pełna obsługa IMAP4rev1 i POP3
127 - obsługa rozszerzeń THREAD, SORT i IDLE, wymaganych przez wiele
130 - pełna obsługa TLS/SSL
131 - quota Maildir++ jest obsługiwana, ale twarda quota na systemach
132 plików może być problematyczna
135 Summary: Development package for Dovecot plugins
136 Summary(pl.UTF-8): Pakiet programistyczny do tworzenia wtyczek dla Dovecota
137 Group: Development/Libraries
138 Requires: %{name}-libs = %{epoch}:%{version}-%{release}
141 Development package for Dovecot plugins.
143 %description devel -l pl.UTF-8
144 Pakiet programistyczny do tworzenia wtyczek dla Dovecota.
147 Summary: Dovecot shared libraries
148 Summary(pl.UTF-8): Współdzielone biblioteki Dovecota
149 Group: Development/Libraries
152 Dovecot shared libraries.
154 %description libs -l pl.UTF-8
155 Współdzielone biblioteki Dovecota.
164 %{__sed} -i 's,/usr/lib/dovecot,%{_libdir}/dovecot,g' doc/example-config/*.conf doc/example-config/conf.d/*.conf
174 ac_cv_prog_VALGRIND=no \
175 CPPFLAGS="%{rpmcppflags} -I/usr/include/libstemmer" \
177 %{?debug:--enable-debug} \
178 %{?with_ldap:--with-ldap=yes} \
179 %{?with_mysql:--with-mysql} \
180 %{?with_pgsql:--with-pgsql} \
181 %{?with_sqlite:--with-sqlite} \
182 %{?with_gssapi:--with-gssapi=plugin} \
192 --with-moduledir=%{_libdir}/%{name}/plugins \
193 --with-ssldir=/var/lib/openssl \
194 --sysconfdir=%{_sysconfdir} \
195 --with-systemdsystemunitdir=%{systemdunitdir}
199 %{?with_tests:%{__make} check}
202 rm -rf $RPM_BUILD_ROOT
203 install -d $RPM_BUILD_ROOT/etc/{pam.d,rc.d/init.d,sysconfig,security} \
204 $RPM_BUILD_ROOT{/var/lib/dovecot,/var/run/dovecot/login} \
205 $RPM_BUILD_ROOT/usr/lib/tmpfiles.d
208 DESTDIR=$RPM_BUILD_ROOT
210 mv -f $RPM_BUILD_ROOT%{_datadir}/doc/%{name}/example-config/* $RPM_BUILD_ROOT%{_sysconfdir}/dovecot
212 cp -a %{SOURCE1} $RPM_BUILD_ROOT/etc/pam.d/%{name}
213 install -p %{SOURCE2} $RPM_BUILD_ROOT/etc/rc.d/init.d/%{name}
214 cp -a %{SOURCE3} $RPM_BUILD_ROOT/etc/sysconfig/%{name}
215 install %{SOURCE4} $RPM_BUILD_ROOT/usr/lib/tmpfiles.d/%{name}.conf
217 touch $RPM_BUILD_ROOT/etc/security/blacklist.imap
219 find $RPM_BUILD_ROOT%{_libdir}/%{name} -name '*.la' | xargs rm
221 %{__rm} -r $RPM_BUILD_ROOT%{_docdir}/%{name}
222 %{__rm} -r $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/README
225 rm -rf $RPM_BUILD_ROOT
228 %groupadd -g 172 dovecot
229 %useradd -u 172 -d /usr/share/empty -s /bin/false -c "Dovecot server" -g dovecot dovecot
230 %groupadd -g 254 dovenull
231 %useradd -u 254 -d /usr/share/empty -s /bin/false -c "Dovecot server" -g dovenull dovenull
234 /sbin/chkconfig --add dovecot
235 %service dovecot restart
236 %systemd_post dovecot.socket dovecot.service
239 if [ "$1" = "0" ]; then
240 %service dovecot stop
241 /sbin/chkconfig --del dovecot
243 %systemd_preun dovecot.service dovecot.socket
246 if [ "$1" = "0" ]; then
250 %groupremove dovenull
254 %post libs -p /sbin/ldconfig
255 %postun libs -p /sbin/ldconfig
258 # restart devocot if pam is upgraded
259 # (dovecot is linked with old libpam but tries to open modules linked with new libpam)
260 if [ "$2" != 1 ]; then
261 %service -q dovecot restart
264 %triggerpostun -- dovecot < 1:2.0.0
265 # upgrading dovecot < 1.1
266 echo "Configuration change default_mail_env -> mail_location"
267 %{__sed} -i -e "s/^default_mail_env/mail_location/" /etc/dovecot/dovecot.conf
268 # upgrading dovecot < 2.0
270 for a in /etc/dovecot/dovecot-db-example.conf \
271 /etc/dovecot/dovecot-dict-sql-example.conf \
272 /etc/dovecot/dovecot-ldap-example.conf \
273 /etc/dovecot/dovecot-sql-example.conf \
274 /etc/dovecot/dovecot.conf; do
276 [ "$i" -eq 0 ] && echo "Read http://wiki2.dovecot.org/Upgrading/2.0"
278 echo "Trying to migrate $a config file to dovecot 2."
279 cp -a "$a" "$a-1.2.org"
282 # convert config and prefix stderr lines with #
283 %{_bindir}/doveconf -n -c "$a-1.2.org" > "$a" 2> "$a.log" || :
286 if [ "$i" -eq 1 ]; then
287 echo "Please verify contents of %{_sysconfdir}/%{name}/* files."
290 %triggerpostun -- %{name} < 1:2.2.4-2
291 %systemd_trigger dovecot.service dovecot.socket
294 %defattr(644,root,root,755)
295 # COPYING contains some notes, not actual LGPL text
296 %doc AUTHORS COPYING ChangeLog NEWS README TODO doc/*.txt doc/*.c*f doc/wiki/*.txt
297 %attr(755,root,root) %{_bindir}/doveadm
298 %attr(755,root,root) %{_bindir}/doveconf
299 %attr(755,root,root) %{_bindir}/dsync
300 %attr(755,root,root) %{_sbindir}/%{name}
301 %attr(751,root,root) %dir %{_sysconfdir}/%{name}
302 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}/%{name}.conf
303 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}/*.ext
304 %attr(751,root,root) %dir %{_sysconfdir}/%{name}/conf.d
305 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}/conf.d/*.conf
306 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}/conf.d/*.ext
307 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/pam.d/%{name}
308 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/security/blacklist.imap
309 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/%{name}
310 %attr(754,root,root) /etc/rc.d/init.d/%{name}
311 %attr(755,root,root) %{_libdir}/%{name}/aggregator
312 %attr(755,root,root) %{_libdir}/%{name}/anvil
313 %attr(755,root,root) %{_libdir}/%{name}/auth
314 %attr(755,root,root) %{_libdir}/%{name}/checkpassword-reply
315 %attr(755,root,root) %{_libdir}/%{name}/config
316 %attr(755,root,root) %{_libdir}/%{name}/decode2text.sh
317 %attr(755,root,root) %{_libdir}/%{name}/deliver
318 %attr(755,root,root) %{_libdir}/%{name}/dict
319 %attr(755,root,root) %{_libdir}/%{name}/director
320 %attr(755,root,root) %{_libdir}/%{name}/dns-client
321 %attr(755,root,root) %{_libdir}/%{name}/doveadm-server
322 %attr(755,root,root) %{_libdir}/%{name}/dovecot-lda
323 %attr(755,root,root) %{_libdir}/%{name}/gdbhelper
324 %attr(755,root,root) %{_libdir}/%{name}/imap
325 %attr(755,root,root) %{_libdir}/%{name}/imap-hibernate
326 %attr(755,root,root) %{_libdir}/%{name}/imap-login
327 %attr(755,root,root) %{_libdir}/%{name}/imap-urlauth
328 %attr(755,root,root) %{_libdir}/%{name}/imap-urlauth-login
329 %attr(755,root,root) %{_libdir}/%{name}/imap-urlauth-worker
330 %attr(755,root,root) %{_libdir}/%{name}/indexer
331 %attr(755,root,root) %{_libdir}/%{name}/indexer-worker
332 %attr(755,root,root) %{_libdir}/%{name}/ipc
333 %attr(755,root,root) %{_libdir}/%{name}/libdcrypt_openssl.so
334 %attr(755,root,root) %{_libdir}/%{name}/lmtp
335 %attr(755,root,root) %{_libdir}/%{name}/log
336 %attr(755,root,root) %{_libdir}/%{name}/maildirlock
337 %attr(755,root,root) %{_libdir}/%{name}/pop3
338 %attr(755,root,root) %{_libdir}/%{name}/pop3-login
339 %attr(755,root,root) %{_libdir}/%{name}/quota-status
340 %attr(755,root,root) %{_libdir}/%{name}/rawlog
341 %attr(755,root,root) %{_libdir}/%{name}/replicator
342 %attr(755,root,root) %{_libdir}/%{name}/script
343 %attr(755,root,root) %{_libdir}/%{name}/script-login
344 %attr(755,root,root) %{_libdir}/%{name}/ssl-params
345 %attr(755,root,root) %{_libdir}/%{name}/stats
346 %attr(755,root,root) %{_libdir}/%{name}/xml2text
347 %dir %{_libdir}/%{name}/plugins
348 %attr(755,root,root) %{_libdir}/%{name}/plugins/*.so
349 %dir %{_libdir}/%{name}/plugins/auth
350 %attr(755,root,root) %{_libdir}/%{name}/plugins/auth/*.so
351 %dir %{_libdir}/%{name}/plugins/dict
352 %attr(755,root,root) %{_libdir}/%{name}/plugins/dict/*.so
353 %dir %{_libdir}/%{name}/plugins/doveadm
354 %attr(755,root,root) %{_libdir}/%{name}/plugins/doveadm/*.so
355 %dir %{_libdir}/%{name}/plugins/stats
356 %attr(755,root,root) %{_libdir}/%{name}/plugins/stats/*.so
358 %{systemdunitdir}/dovecot.service
359 %{systemdunitdir}/dovecot.socket
360 /usr/lib/tmpfiles.d/%{name}.conf
361 %dir /var/lib/dovecot
362 %dir /var/run/dovecot
363 %attr(750,root,dovenull) %dir /var/run/dovecot/login
365 %{_mandir}/man1/deliver.1*
366 %{_mandir}/man1/dove*.1*
367 %{_mandir}/man1/dsync.1*
368 %{_mandir}/man7/doveadm-search-query.7*
371 %defattr(644,root,root,755)
372 %attr(755,root,root) %{_libdir}/%{name}/libdovecot.so
373 %attr(755,root,root) %{_libdir}/%{name}/libdovecot-compression.so
374 %attr(755,root,root) %{_libdir}/%{name}/libdovecot-dsync.so
375 %attr(755,root,root) %{_libdir}/%{name}/libdovecot-fts.so
376 %attr(755,root,root) %{_libdir}/%{name}/libdovecot-lda.so
377 %{?with_ldap:%attr(755,root,root) %{_libdir}/%{name}/libdovecot-ldap.so}
378 %attr(755,root,root) %{_libdir}/%{name}/libdovecot-login.so
379 %attr(755,root,root) %{_libdir}/%{name}/libdovecot-sql.so
380 %attr(755,root,root) %{_libdir}/%{name}/libdovecot-storage.so
381 %{_libdir}/%{name}/%{name}-config
382 %{_includedir}/%{name}
383 %{_aclocaldir}/dovecot.m4
386 %defattr(644,root,root,755)
387 %dir %{_libdir}/%{name}
389 %attr(755,root,root) %{_libdir}/%{name}/libdovecot.so.0.0.0
390 %attr(755,root,root) %{_libdir}/%{name}/libdovecot-compression.so.0.0.0
391 %attr(755,root,root) %{_libdir}/%{name}/libdovecot-dsync.so.0.0.0
392 %attr(755,root,root) %{_libdir}/%{name}/libdovecot-fts.so.0.0.0
393 %attr(755,root,root) %{_libdir}/%{name}/libdovecot-lda.so.0.0.0
394 %{?with_ldap:%attr(755,root,root) %{_libdir}/%{name}/libdovecot-ldap.so.0.0.0}
395 %attr(755,root,root) %{_libdir}/%{name}/libdovecot-login.so.0.0.0
396 %attr(755,root,root) %{_libdir}/%{name}/libdovecot-sql.so.0.0.0
397 %attr(755,root,root) %{_libdir}/%{name}/libdovecot-storage.so.0.0.0
398 # Note: we are in %{_libdir}/dovecot, ldconfig does not look into this
399 # directory. This is why the following files are not %ghost
400 %attr(755,root,root) %{_libdir}/%{name}/libdovecot.so.0
401 %attr(755,root,root) %{_libdir}/%{name}/libdovecot-compression.so.0
402 %attr(755,root,root) %{_libdir}/%{name}/libdovecot-dsync.so.0
403 %attr(755,root,root) %{_libdir}/%{name}/libdovecot-fts.so.0
404 %attr(755,root,root) %{_libdir}/%{name}/libdovecot-lda.so.0
405 %{?with_ldap:%attr(755,root,root) %{_libdir}/%{name}/libdovecot-ldap.so.0}
406 %attr(755,root,root) %{_libdir}/%{name}/libdovecot-login.so.0
407 %attr(755,root,root) %{_libdir}/%{name}/libdovecot-sql.so.0
408 %attr(755,root,root) %{_libdir}/%{name}/libdovecot-storage.so.0