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: 9b67ec4f21e5ecfcfb32fd5f412b511b
23 Source3: %{name}.sysconfig
24 Patch0: %{name}-config.patch
25 Patch1: %{name}-rpath.patch
26 Patch2: %{name}-shebang.patch
27 Patch3: %{name}-mysql.patch
28 URL: http://dovecot.org/
29 BuildRequires: autoconf
30 BuildRequires: automake
31 BuildRequires: bzip2-devel
32 BuildRequires: clucene-core-devel >= 2.3.3.4
33 BuildRequires: curl-devel
34 %{?with_sasl:BuildRequires: cyrus-sasl-devel >= 2.0}
35 BuildRequires: expat-devel
36 BuildRequires: gettext-tools
37 %{?with_gssapi:BuildRequires: heimdal-devel}
38 BuildRequires: libapparmor-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)
68 Provides: user(dovecot)
69 %{?with_gssapi:Obsoletes: heimdal-daemons}
70 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
72 %define no_install_post_check_so 1
75 Dovecot is an IMAP and POP3 server for Linux/UNIX-like systems,
76 written with security primarily in mind. Although it's written with C,
77 it uses several coding techniques to avoid most of the common
80 Dovecot can work with standard mbox and maildir formats and it's fully
81 compatible with UW-IMAP and Courier IMAP servers as well as mail
82 clients accessing the mailboxes directly. It's also planned to support
83 storing mails in SQL databases.
85 Dovecot is easy to set up and doesn't require special maintenance.
86 Only thing you need is to get the authentication working properly - if
87 your users are in /etc/passwd there's hardly anything you have to do.
89 Dovecot should be pretty fast, mostly because of index files that
90 Dovecot maintains; instead of having to scan through all the data in
91 mailbox, Dovecot can get most of the wanted information from index
95 - should be quite ready for use with normal IMAP clients
96 - complete IMAP4rev1 and POP3 support
97 - supports THREAD, SORT and IDLE extensions, required by many IMAP
99 - complete TLS/SSL support
101 - shared mailboxes aren't yet supported
102 - Maildir++ quota is supported, bad hard filesystem quota can be
105 %description -l pl.UTF-8
106 Dovecot to serwer IMAP i POP3 dla systemów linuksowych/uniksowych,
107 pisany głównie z myślą o bezpieczeństwie. Chociaż jest pisany w C,
108 używa kilku technik kodowania zapobiegających większości popularnych
111 Dovecot może działać ze standardowymi formatami mbox i maildir, jest
112 całkowicie kompatybilny z serwerami UW-IMAP i Courier IMAP, a także z
113 klientami pocztowymi bezpośrednio dostającymi się do skrzynek.
114 Planowana jest także obsługa przechowywania listów w bazach SQL.
116 Dovecot jest łatwy do skonfigurowania i nie wymaga specjalnego
117 nadzoru. Wystarczy tylko doprowadzić do działania uwierzytelnianie -
118 jeśli użytkownicy są w /etc/passwd, to właściwie nie trzeba nic
121 Dovecot powinien być w miarę szybki, głównie z powodu plików
122 indeksowych utrzymywanych przez serwer; zamiast potrzeby skanowania
123 wszystkich danych w skrzynce, Dovecot może małym kosztem uzyskać
124 większość potrzebnych informacji z indeksu.
127 - powinien być gotowy do użycia ze zwykłymi klientami IMAP
128 - pełna obsługa IMAP4rev1 i POP3
129 - obsługa rozszerzeń THREAD, SORT i IDLE, wymaganych przez wiele
132 - pełna obsługa TLS/SSL
133 - quota Maildir++ jest obsługiwana, ale twarda quota na systemach
134 plików może być problematyczna
137 Summary: Dovecot shared libraries
138 Summary(pl.UTF-8): Współdzielone biblioteki Dovecota
139 Group: Development/Libraries
142 Dovecot shared libraries.
144 %description libs -l pl.UTF-8
145 Współdzielone biblioteki Dovecota.
148 Summary: Development package for Dovecot plugins
149 Summary(pl.UTF-8): Pakiet programistyczny do tworzenia wtyczek dla Dovecota
150 Group: Development/Libraries
151 Requires: %{name}-libs = %{epoch}:%{version}-%{release}
154 Development package for Dovecot plugins.
156 %description devel -l pl.UTF-8
157 Pakiet programistyczny do tworzenia wtyczek dla Dovecota.
166 %{__sed} -i 's,/usr/lib/dovecot,%{_libdir}/dovecot,g' doc/example-config/*.conf doc/example-config/conf.d/*.conf
171 %{__aclocal} -I . -I m4
176 ac_cv_prog_VALGRIND=no \
177 CPPFLAGS="%{rpmcppflags} -I/usr/include/libstemmer -D_LINUX_QUOTA_VERSION=2" \
179 %{?debug:--enable-debug} \
180 %{?with_ldap:--with-ldap=yes} \
181 %{?with_mysql:--with-mysql} \
182 %{?with_pgsql:--with-pgsql} \
183 %{?with_sqlite:--with-sqlite} \
184 %{?with_gssapi:--with-gssapi=plugin} \
194 --with-moduledir=%{_libdir}/%{name}/plugins \
195 --with-ssldir=/var/lib/openssl \
196 --sysconfdir=%{_sysconfdir}
200 %{?with_tests:%{__make} check}
203 rm -rf $RPM_BUILD_ROOT
204 install -d $RPM_BUILD_ROOT/etc/{pam.d,rc.d/init.d,sysconfig,security} \
205 $RPM_BUILD_ROOT{/var/lib/dovecot,/var/run/dovecot/login}
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}
216 touch $RPM_BUILD_ROOT/etc/security/blacklist.imap
218 find $RPM_BUILD_ROOT%{_libdir}/%{name} -name '*.la' | xargs rm
220 %{__rm} -r $RPM_BUILD_ROOT%{_docdir}/%{name}
221 %{__rm} -r $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/README
224 rm -rf $RPM_BUILD_ROOT
227 %groupadd -g 172 dovecot
228 %useradd -u 172 -d /usr/share/empty -s /bin/false -c "Dovecot server" -g dovecot dovecot
229 %groupadd -g 254 dovenull
230 %useradd -u 254 -d /usr/share/empty -s /bin/false -c "Dovecot server" -g dovenull dovenull
233 /sbin/chkconfig --add dovecot
234 %service dovecot restart
237 if [ "$1" = "0" ]; then
238 %service dovecot stop
239 /sbin/chkconfig --del dovecot
243 if [ "$1" = "0" ]; then
247 %groupremove dovenull
250 %post libs -p /sbin/ldconfig
251 %postun libs -p /sbin/ldconfig
254 # restart devocot if pam is upgraded
255 # (dovecot is linked with old libpam but tries to open modules linked with new libpam)
256 if [ "$2" != 1 ]; then
257 %service -q dovecot restart
260 %triggerpostun -- dovecot < 1:2.0.0
261 # upgrading dovecot < 1.1
262 echo "Configuration change default_mail_env -> mail_location"
263 %{__sed} -i -e "s/^default_mail_env/mail_location/" /etc/dovecot/dovecot.conf
264 # upgrading dovecot < 2.0
266 for a in /etc/dovecot/dovecot-db-example.conf \
267 /etc/dovecot/dovecot-dict-sql-example.conf \
268 /etc/dovecot/dovecot-ldap-example.conf \
269 /etc/dovecot/dovecot-sql-example.conf \
270 /etc/dovecot/dovecot.conf; do
272 [ "$i" -eq 0 ] && echo "Read http://wiki2.dovecot.org/Upgrading/2.0"
274 echo "Trying to migrate $a config file to dovecot 2."
275 cp -a "$a" "$a-1.2.org"
278 # convert config and prefix stderr lines with #
279 %{_bindir}/doveconf -n -c "$a-1.2.org" > "$a" 2> "$a.log" || :
282 if [ "$i" -eq 1 ]; then
283 echo "Please verify contents of %{_sysconfdir}/%{name}/* files."
287 %defattr(644,root,root,755)
288 # COPYING contains some notes, not actual LGPL text
289 %doc AUTHORS COPYING ChangeLog NEWS README TODO doc/*.txt doc/*.c*f doc/wiki/*.txt
290 %attr(755,root,root) %{_bindir}/doveadm
291 %attr(755,root,root) %{_bindir}/doveconf
292 %attr(755,root,root) %{_bindir}/dovecot-sysreport
293 %attr(755,root,root) %{_bindir}/dsync
294 %attr(755,root,root) %{_sbindir}/%{name}
295 %attr(751,root,root) %dir %{_sysconfdir}/%{name}
296 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}/%{name}.conf
297 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}/*.ext
298 %attr(751,root,root) %dir %{_sysconfdir}/%{name}/conf.d
299 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}/conf.d/*.conf
300 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}/conf.d/*.ext
301 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/pam.d/%{name}
302 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/security/blacklist.imap
303 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/%{name}
304 %attr(754,root,root) /etc/rc.d/init.d/%{name}
305 %if "%{_libexecdir}" != "%{_libdir}"
306 %dir %{_libexecdir}/%{name}
308 %attr(755,root,root) %{_libexecdir}/%{name}/aggregator
309 %attr(755,root,root) %{_libexecdir}/%{name}/anvil
310 %attr(755,root,root) %{_libexecdir}/%{name}/auth
311 %attr(755,root,root) %{_libexecdir}/%{name}/checkpassword-reply
312 %attr(755,root,root) %{_libexecdir}/%{name}/config
313 %attr(755,root,root) %{_libexecdir}/%{name}/decode2text.sh
314 %attr(755,root,root) %{_libexecdir}/%{name}/deliver
315 %attr(755,root,root) %{_libexecdir}/%{name}/dict
316 %attr(755,root,root) %{_libexecdir}/%{name}/director
317 %attr(755,root,root) %{_libexecdir}/%{name}/dns-client
318 %attr(755,root,root) %{_libexecdir}/%{name}/doveadm-server
319 %attr(755,root,root) %{_libexecdir}/%{name}/dovecot-lda
320 %attr(755,root,root) %{_libexecdir}/%{name}/gdbhelper
321 %attr(755,root,root) %{_libexecdir}/%{name}/health-check.sh
322 %attr(755,root,root) %{_libexecdir}/%{name}/imap
323 %attr(755,root,root) %{_libexecdir}/%{name}/imap-hibernate
324 %attr(755,root,root) %{_libexecdir}/%{name}/imap-login
325 %attr(755,root,root) %{_libexecdir}/%{name}/imap-urlauth
326 %attr(755,root,root) %{_libexecdir}/%{name}/imap-urlauth-login
327 %attr(755,root,root) %{_libexecdir}/%{name}/imap-urlauth-worker
328 %attr(755,root,root) %{_libexecdir}/%{name}/indexer
329 %attr(755,root,root) %{_libexecdir}/%{name}/indexer-worker
330 %attr(755,root,root) %{_libexecdir}/%{name}/ipc
331 %attr(755,root,root) %{_libexecdir}/%{name}/lmtp
332 %attr(755,root,root) %{_libexecdir}/%{name}/log
333 %attr(755,root,root) %{_libexecdir}/%{name}/maildirlock
334 %attr(755,root,root) %{_libexecdir}/%{name}/old-stats
335 %attr(755,root,root) %{_libexecdir}/%{name}/pop3
336 %attr(755,root,root) %{_libexecdir}/%{name}/pop3-login
337 %attr(755,root,root) %{_libexecdir}/%{name}/quota-status
338 %attr(755,root,root) %{_libexecdir}/%{name}/rawlog
339 %attr(755,root,root) %{_libexecdir}/%{name}/replicator
340 %attr(755,root,root) %{_libexecdir}/%{name}/script
341 %attr(755,root,root) %{_libexecdir}/%{name}/script-login
342 %attr(755,root,root) %{_libexecdir}/%{name}/stats
343 %attr(755,root,root) %{_libexecdir}/%{name}/submission
344 %attr(755,root,root) %{_libexecdir}/%{name}/submission-login
345 %attr(755,root,root) %{_libexecdir}/%{name}/xml2text
346 %attr(755,root,root) %{_libdir}/%{name}/libdcrypt_openssl.so
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/old-stats
356 %attr(755,root,root) %{_libdir}/%{name}/plugins/old-stats/*.so
358 %dir /var/lib/dovecot
359 %dir /var/run/dovecot
360 %attr(750,root,dovenull) %dir /var/run/dovecot/login
362 %{_mandir}/man1/deliver.1*
363 %{_mandir}/man1/dove*.1*
364 %{_mandir}/man1/dsync.1*
365 %{_mandir}/man7/doveadm-search-query.7*
368 %defattr(644,root,root,755)
369 %dir %{_libdir}/%{name}
371 %attr(755,root,root) %{_libdir}/%{name}/libdovecot.so.0.0.0
372 %attr(755,root,root) %{_libdir}/%{name}/libdovecot-compression.so.0.0.0
373 %attr(755,root,root) %{_libdir}/%{name}/libdovecot-dsync.so.0.0.0
374 %attr(755,root,root) %{_libdir}/%{name}/libdovecot-fts.so.0.0.0
375 %attr(755,root,root) %{_libdir}/%{name}/libdovecot-lda.so.0.0.0
376 %{?with_ldap:%attr(755,root,root) %{_libdir}/%{name}/libdovecot-ldap.so.0.0.0}
377 %attr(755,root,root) %{_libdir}/%{name}/libdovecot-login.so.0.0.0
378 %attr(755,root,root) %{_libdir}/%{name}/libdovecot-sql.so.0.0.0
379 %attr(755,root,root) %{_libdir}/%{name}/libdovecot-storage.so.0.0.0
380 # Note: we are in %{_libdir}/dovecot, ldconfig does not look into this
381 # directory. This is why the following files are not %ghost
382 %attr(755,root,root) %{_libdir}/%{name}/libdovecot.so.0
383 %attr(755,root,root) %{_libdir}/%{name}/libdovecot-compression.so.0
384 %attr(755,root,root) %{_libdir}/%{name}/libdovecot-dsync.so.0
385 %attr(755,root,root) %{_libdir}/%{name}/libdovecot-fts.so.0
386 %attr(755,root,root) %{_libdir}/%{name}/libdovecot-lda.so.0
387 %{?with_ldap:%attr(755,root,root) %{_libdir}/%{name}/libdovecot-ldap.so.0}
388 %attr(755,root,root) %{_libdir}/%{name}/libdovecot-login.so.0
389 %attr(755,root,root) %{_libdir}/%{name}/libdovecot-sql.so.0
390 %attr(755,root,root) %{_libdir}/%{name}/libdovecot-storage.so.0
393 %defattr(644,root,root,755)
394 %attr(755,root,root) %{_libdir}/%{name}/libdovecot.so
395 %attr(755,root,root) %{_libdir}/%{name}/libdovecot-compression.so
396 %attr(755,root,root) %{_libdir}/%{name}/libdovecot-dsync.so
397 %attr(755,root,root) %{_libdir}/%{name}/libdovecot-fts.so
398 %attr(755,root,root) %{_libdir}/%{name}/libdovecot-lda.so
399 %{?with_ldap:%attr(755,root,root) %{_libdir}/%{name}/libdovecot-ldap.so}
400 %attr(755,root,root) %{_libdir}/%{name}/libdovecot-login.so
401 %attr(755,root,root) %{_libdir}/%{name}/libdovecot-sql.so
402 %attr(755,root,root) %{_libdir}/%{name}/libdovecot-storage.so
403 %{_libdir}/%{name}/%{name}-config
404 %{_includedir}/%{name}
405 %{_aclocaldir}/dovecot.m4