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.3/%{name}-%{version}.tar.gz
20 # Source0-md5: fc89b6130bcc09e99ae21003b474acc2
23 Source3: %{name}.sysconfig
24 Patch0: %{name}-config.patch
25 Patch1: %{name}-rpath.patch
26 URL: http://dovecot.org/
27 BuildRequires: autoconf
28 BuildRequires: automake
29 BuildRequires: bzip2-devel
30 BuildRequires: clucene-core-devel >= 2.3.3.4
31 BuildRequires: curl-devel
32 %{?with_sasl:BuildRequires: cyrus-sasl-devel >= 2.0}
33 BuildRequires: expat-devel
34 BuildRequires: gettext-tools
35 %{?with_gssapi:BuildRequires: heimdal-devel}
36 BuildRequires: libapparmor-devel
37 BuildRequires: libcap-devel
38 BuildRequires: libicu-devel
39 BuildRequires: libstemmer-devel
40 BuildRequires: libexttextcat-devel
41 BuildRequires: libtool
42 BuildRequires: lz4-devel
43 %{?with_mysql:BuildRequires: mysql-devel}
44 %{?with_ldap:BuildRequires: openldap-devel >= 2.3.3}
45 BuildRequires: openssl-devel >= 0.9.7d
46 BuildRequires: pam-devel
47 BuildRequires: pkgconfig
48 %{?with_pgsql:BuildRequires: postgresql-devel}
49 BuildRequires: rpmbuild(macros) >= 1.647
50 BuildRequires: sed >= 4.0
51 %{?with_sqlite:BuildRequires: sqlite3-devel}
52 BuildRequires: xz-devel
53 BuildRequires: zlib-devel
54 Requires(post,preun): /sbin/chkconfig
55 Requires(postun): /usr/sbin/groupdel
56 Requires(postun): /usr/sbin/userdel
57 Requires(pre): /bin/id
58 Requires(pre): /usr/bin/getgid
59 Requires(pre): /usr/sbin/groupadd
60 Requires(pre): /usr/sbin/useradd
61 Requires: %{name}-libs = %{epoch}:%{version}-%{release}
62 Requires: pam >= 0.79.0
63 Provides: group(dovecot)
66 Provides: user(dovecot)
67 %{?with_gssapi:Obsoletes: heimdal-daemons}
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: Dovecot shared libraries
136 Summary(pl.UTF-8): Współdzielone biblioteki Dovecota
137 Group: Development/Libraries
140 Dovecot shared libraries.
142 %description libs -l pl.UTF-8
143 Współdzielone biblioteki Dovecota.
146 Summary: Development package for Dovecot plugins
147 Summary(pl.UTF-8): Pakiet programistyczny do tworzenia wtyczek dla Dovecota
148 Group: Development/Libraries
149 Requires: %{name}-libs = %{epoch}:%{version}-%{release}
152 Development package for Dovecot plugins.
154 %description devel -l pl.UTF-8
155 Pakiet programistyczny do tworzenia wtyczek dla Dovecota.
158 %setup -q -n %{name}-%{version}
162 %{__sed} -i 's,/usr/lib/dovecot,%{_libdir}/dovecot,g' doc/example-config/*.conf doc/example-config/conf.d/*.conf
167 %{__aclocal} -I . -I m4
172 ac_cv_prog_VALGRIND=no \
173 CPPFLAGS="%{rpmcppflags} -I/usr/include/libstemmer -D_LINUX_QUOTA_VERSION=2" \
175 %{?debug:--enable-debug} \
176 %{?with_ldap:--with-ldap=yes} \
177 %{?with_mysql:--with-mysql} \
178 %{?with_pgsql:--with-pgsql} \
179 %{?with_sqlite:--with-sqlite} \
180 %{?with_gssapi:--with-gssapi=plugin} \
190 --with-moduledir=%{_libdir}/%{name}/plugins \
191 --with-ssldir=/var/lib/openssl \
192 --sysconfdir=%{_sysconfdir}
196 %{?with_tests:%{__make} check}
199 rm -rf $RPM_BUILD_ROOT
200 install -d $RPM_BUILD_ROOT/etc/{pam.d,rc.d/init.d,sysconfig,security} \
201 $RPM_BUILD_ROOT{/var/lib/dovecot,/var/run/dovecot/login}
204 DESTDIR=$RPM_BUILD_ROOT
206 mv -f $RPM_BUILD_ROOT%{_datadir}/doc/%{name}/example-config/* $RPM_BUILD_ROOT%{_sysconfdir}/dovecot
208 cp -a %{SOURCE1} $RPM_BUILD_ROOT/etc/pam.d/%{name}
209 install -p %{SOURCE2} $RPM_BUILD_ROOT/etc/rc.d/init.d/%{name}
210 cp -a %{SOURCE3} $RPM_BUILD_ROOT/etc/sysconfig/%{name}
212 touch $RPM_BUILD_ROOT/etc/security/blacklist.imap
214 find $RPM_BUILD_ROOT%{_libdir}/%{name} -name '*.la' | xargs rm
216 %{__rm} -r $RPM_BUILD_ROOT%{_docdir}/%{name}
217 %{__rm} -r $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/README
220 rm -rf $RPM_BUILD_ROOT
223 %groupadd -g 172 dovecot
224 %useradd -u 172 -d /usr/share/empty -s /bin/false -c "Dovecot server" -g dovecot dovecot
225 %groupadd -g 254 dovenull
226 %useradd -u 254 -d /usr/share/empty -s /bin/false -c "Dovecot server" -g dovenull dovenull
229 /sbin/chkconfig --add dovecot
230 %service dovecot restart
233 if [ "$1" = "0" ]; then
234 %service dovecot stop
235 /sbin/chkconfig --del dovecot
239 if [ "$1" = "0" ]; then
243 %groupremove dovenull
246 %post libs -p /sbin/ldconfig
247 %postun libs -p /sbin/ldconfig
250 # restart devocot if pam is upgraded
251 # (dovecot is linked with old libpam but tries to open modules linked with new libpam)
252 if [ "$2" != 1 ]; then
253 %service -q dovecot restart
256 %triggerpostun -- dovecot < 1:2.0.0
257 # upgrading dovecot < 1.1
258 echo "Configuration change default_mail_env -> mail_location"
259 %{__sed} -i -e "s/^default_mail_env/mail_location/" /etc/dovecot/dovecot.conf
260 # upgrading dovecot < 2.0
262 for a in /etc/dovecot/dovecot-db-example.conf \
263 /etc/dovecot/dovecot-dict-sql-example.conf \
264 /etc/dovecot/dovecot-ldap-example.conf \
265 /etc/dovecot/dovecot-sql-example.conf \
266 /etc/dovecot/dovecot.conf; do
268 [ "$i" -eq 0 ] && echo "Read http://wiki2.dovecot.org/Upgrading/2.0"
270 echo "Trying to migrate $a config file to dovecot 2."
271 cp -a "$a" "$a-1.2.org"
274 # convert config and prefix stderr lines with #
275 %{_bindir}/doveconf -n -c "$a-1.2.org" > "$a" 2> "$a.log" || :
278 if [ "$i" -eq 1 ]; then
279 echo "Please verify contents of %{_sysconfdir}/%{name}/* files."
283 %defattr(644,root,root,755)
284 # COPYING contains some notes, not actual LGPL text
285 %doc AUTHORS COPYING ChangeLog NEWS README TODO doc/*.txt doc/*.c*f doc/wiki/*.txt
286 %attr(755,root,root) %{_bindir}/doveadm
287 %attr(755,root,root) %{_bindir}/doveconf
288 %attr(755,root,root) %{_bindir}/dsync
289 %attr(755,root,root) %{_sbindir}/%{name}
290 %attr(751,root,root) %dir %{_sysconfdir}/%{name}
291 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}/%{name}.conf
292 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}/*.ext
293 %attr(751,root,root) %dir %{_sysconfdir}/%{name}/conf.d
294 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}/conf.d/*.conf
295 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}/conf.d/*.ext
296 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/pam.d/%{name}
297 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/security/blacklist.imap
298 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/%{name}
299 %attr(754,root,root) /etc/rc.d/init.d/%{name}
300 %if "%{_libexecdir}" != "%{_libdir}"
301 %dir %{_libexecdir}/%{name}
303 %attr(755,root,root) %{_libexecdir}/%{name}/aggregator
304 %attr(755,root,root) %{_libexecdir}/%{name}/anvil
305 %attr(755,root,root) %{_libexecdir}/%{name}/auth
306 %attr(755,root,root) %{_libexecdir}/%{name}/checkpassword-reply
307 %attr(755,root,root) %{_libexecdir}/%{name}/config
308 %attr(755,root,root) %{_libexecdir}/%{name}/decode2text.sh
309 %attr(755,root,root) %{_libexecdir}/%{name}/deliver
310 %attr(755,root,root) %{_libexecdir}/%{name}/dict
311 %attr(755,root,root) %{_libexecdir}/%{name}/director
312 %attr(755,root,root) %{_libexecdir}/%{name}/dns-client
313 %attr(755,root,root) %{_libexecdir}/%{name}/doveadm-server
314 %attr(755,root,root) %{_libexecdir}/%{name}/dovecot-lda
315 %attr(755,root,root) %{_libexecdir}/%{name}/gdbhelper
316 %attr(755,root,root) %{_libexecdir}/%{name}/imap
317 %attr(755,root,root) %{_libexecdir}/%{name}/imap-hibernate
318 %attr(755,root,root) %{_libexecdir}/%{name}/imap-login
319 %attr(755,root,root) %{_libexecdir}/%{name}/imap-urlauth
320 %attr(755,root,root) %{_libexecdir}/%{name}/imap-urlauth-login
321 %attr(755,root,root) %{_libexecdir}/%{name}/imap-urlauth-worker
322 %attr(755,root,root) %{_libexecdir}/%{name}/indexer
323 %attr(755,root,root) %{_libexecdir}/%{name}/indexer-worker
324 %attr(755,root,root) %{_libexecdir}/%{name}/ipc
325 %attr(755,root,root) %{_libexecdir}/%{name}/lmtp
326 %attr(755,root,root) %{_libexecdir}/%{name}/log
327 %attr(755,root,root) %{_libexecdir}/%{name}/maildirlock
328 %attr(755,root,root) %{_libexecdir}/%{name}/pop3
329 %attr(755,root,root) %{_libexecdir}/%{name}/pop3-login
330 %attr(755,root,root) %{_libexecdir}/%{name}/quota-status
331 %attr(755,root,root) %{_libexecdir}/%{name}/rawlog
332 %attr(755,root,root) %{_libexecdir}/%{name}/replicator
333 %attr(755,root,root) %{_libexecdir}/%{name}/script
334 %attr(755,root,root) %{_libexecdir}/%{name}/script-login
335 %attr(755,root,root) %{_libexecdir}/%{name}/submission
336 %attr(755,root,root) %{_libexecdir}/%{name}/submission-login
337 %attr(755,root,root) %{_libexecdir}/%{name}/stats
338 %attr(755,root,root) %{_libexecdir}/%{name}/old-stats
339 %attr(755,root,root) %{_libexecdir}/%{name}/xml2text
340 %attr(755,root,root) %{_libdir}/%{name}/libdcrypt_openssl.so
341 %dir %{_libdir}/%{name}/plugins
342 %attr(755,root,root) %{_libdir}/%{name}/plugins/*.so
343 %dir %{_libdir}/%{name}/plugins/auth
344 %attr(755,root,root) %{_libdir}/%{name}/plugins/auth/*.so
345 %dir %{_libdir}/%{name}/plugins/dict
346 %attr(755,root,root) %{_libdir}/%{name}/plugins/dict/*.so
347 %dir %{_libdir}/%{name}/plugins/doveadm
348 %attr(755,root,root) %{_libdir}/%{name}/plugins/doveadm/*.so
349 %dir %{_libdir}/%{name}/plugins/old-stats
350 %attr(755,root,root) %{_libdir}/%{name}/plugins/old-stats/*.so
352 %dir /var/lib/dovecot
353 %dir /var/run/dovecot
354 %attr(750,root,dovenull) %dir /var/run/dovecot/login
356 %{_mandir}/man1/deliver.1*
357 %{_mandir}/man1/dove*.1*
358 %{_mandir}/man1/dsync.1*
359 %{_mandir}/man7/doveadm-search-query.7*
362 %defattr(644,root,root,755)
363 %dir %{_libdir}/%{name}
365 %attr(755,root,root) %{_libdir}/%{name}/libdovecot.so.0.0.0
366 %attr(755,root,root) %{_libdir}/%{name}/libdovecot-compression.so.0.0.0
367 %attr(755,root,root) %{_libdir}/%{name}/libdovecot-dsync.so.0.0.0
368 %attr(755,root,root) %{_libdir}/%{name}/libdovecot-fts.so.0.0.0
369 %attr(755,root,root) %{_libdir}/%{name}/libdovecot-lda.so.0.0.0
370 %{?with_ldap:%attr(755,root,root) %{_libdir}/%{name}/libdovecot-ldap.so.0.0.0}
371 %attr(755,root,root) %{_libdir}/%{name}/libdovecot-login.so.0.0.0
372 %attr(755,root,root) %{_libdir}/%{name}/libdovecot-sql.so.0.0.0
373 %attr(755,root,root) %{_libdir}/%{name}/libdovecot-storage.so.0.0.0
374 # Note: we are in %{_libdir}/dovecot, ldconfig does not look into this
375 # directory. This is why the following files are not %ghost
376 %attr(755,root,root) %{_libdir}/%{name}/libdovecot.so.0
377 %attr(755,root,root) %{_libdir}/%{name}/libdovecot-compression.so.0
378 %attr(755,root,root) %{_libdir}/%{name}/libdovecot-dsync.so.0
379 %attr(755,root,root) %{_libdir}/%{name}/libdovecot-fts.so.0
380 %attr(755,root,root) %{_libdir}/%{name}/libdovecot-lda.so.0
381 %{?with_ldap:%attr(755,root,root) %{_libdir}/%{name}/libdovecot-ldap.so.0}
382 %attr(755,root,root) %{_libdir}/%{name}/libdovecot-login.so.0
383 %attr(755,root,root) %{_libdir}/%{name}/libdovecot-sql.so.0
384 %attr(755,root,root) %{_libdir}/%{name}/libdovecot-storage.so.0
387 %defattr(644,root,root,755)
388 %attr(755,root,root) %{_libdir}/%{name}/libdovecot.so
389 %attr(755,root,root) %{_libdir}/%{name}/libdovecot-compression.so
390 %attr(755,root,root) %{_libdir}/%{name}/libdovecot-dsync.so
391 %attr(755,root,root) %{_libdir}/%{name}/libdovecot-fts.so
392 %attr(755,root,root) %{_libdir}/%{name}/libdovecot-lda.so
393 %{?with_ldap:%attr(755,root,root) %{_libdir}/%{name}/libdovecot-ldap.so}
394 %attr(755,root,root) %{_libdir}/%{name}/libdovecot-login.so
395 %attr(755,root,root) %{_libdir}/%{name}/libdovecot-sql.so
396 %attr(755,root,root) %{_libdir}/%{name}/libdovecot-storage.so
397 %{_libdir}/%{name}/%{name}-config
398 %{_includedir}/%{name}
399 %{_aclocaldir}/dovecot.m4