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
10 Summary: IMAP and POP3 server written with security primarily in mind
11 Summary(pl.UTF-8): Serwer IMAP i POP3 pisany głównie z myślą o bezpieczeństwie
16 License: MIT (libraries), LGPL v2.1 (the rest)
17 Group: Networking/Daemons
18 Source0: http://dovecot.org/releases/2.2/%{name}-%{version}.tar.gz
19 # Source0-md5: a3eb1c0b1822c4f2b0fe9247776baa71
22 Source3: %{name}.sysconfig
23 Source4: %{name}.tmpfiles
24 Patch0: %{name}-config.patch
25 Patch1: %{name}-rpath.patch
26 Patch2: %{name}-auth-settings.patch
27 URL: http://dovecot.org/
28 BuildRequires: autoconf
29 BuildRequires: automake
30 BuildRequires: bzip2-devel
31 %{?with_sasl:BuildRequires: cyrus-sasl-devel >= 2.0}
32 BuildRequires: gettext-devel
33 %{?with_gssapi:BuildRequires: heimdal-devel}
34 BuildRequires: libcap-devel
35 BuildRequires: libtool
36 %{?with_mysql:BuildRequires: mysql-devel}
37 %{?with_ldap:BuildRequires: openldap-devel >= 2.3.3}
38 BuildRequires: openssl-devel >= 0.9.7d
39 BuildRequires: pam-devel
40 BuildRequires: pkgconfig
41 %{?with_pgsql:BuildRequires: postgresql-devel}
42 BuildRequires: rpmbuild(macros) >= 1.647
43 BuildRequires: sed >= 4.0
44 %{?with_sqlite:BuildRequires: sqlite3-devel}
45 BuildRequires: zlib-devel
46 Requires(post,preun): /sbin/chkconfig
47 Requires(postun): /usr/sbin/groupdel
48 Requires(postun): /usr/sbin/userdel
49 Requires(pre): /bin/id
50 Requires(pre): /usr/bin/getgid
51 Requires(pre): /usr/sbin/groupadd
52 Requires(pre): /usr/sbin/useradd
53 Requires: %{name}-libs = %{epoch}:%{version}-%{release}
54 Requires: pam >= 0.79.0
55 Provides: group(dovecot)
57 Provides: user(dovecot)
58 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
60 %define no_install_post_check_so 1
63 Dovecot is an IMAP and POP3 server for Linux/UNIX-like systems,
64 written with security primarily in mind. Although it's written with C,
65 it uses several coding techniques to avoid most of the common
68 Dovecot can work with standard mbox and maildir formats and it's fully
69 compatible with UW-IMAP and Courier IMAP servers as well as mail
70 clients accessing the mailboxes directly. It's also planned to support
71 storing mails in SQL databases.
73 Dovecot is easy to set up and doesn't require special maintenance.
74 Only thing you need is to get the authentication working properly - if
75 your users are in /etc/passwd there's hardly anything you have to do.
77 Dovecot should be pretty fast, mostly because of index files that
78 Dovecot maintains; instead of having to scan through all the data in
79 mailbox, Dovecot can get most of the wanted information from index
83 - should be quite ready for use with normal IMAP clients
84 - complete IMAP4rev1 and POP3 support
85 - supports THREAD, SORT and IDLE extensions, required by many IMAP
87 - complete TLS/SSL support
89 - shared mailboxes aren't yet supported
90 - Maildir++ quota is supported, bad hard filesystem quota can be
93 %description -l pl.UTF-8
94 Dovecot to serwer IMAP i POP3 dla systemów linuksowych/uniksowych,
95 pisany głównie z myślą o bezpieczeństwie. Chociaż jest pisany w C,
96 używa kilku technik kodowania zapobiegających większości popularnych
99 Dovecot może działać ze standardowymi formatami mbox i maildir, jest
100 całkowicie kompatybilny z serwerami UW-IMAP i Courier IMAP, a także z
101 klientami pocztowymi bezpośrednio dostającymi się do skrzynek.
102 Planowana jest także obsługa przechowywania listów w bazach SQL.
104 Dovecot jest łatwy do skonfigurowania i nie wymaga specjalnego
105 nadzoru. Wystarczy tylko doprowadzić do działania uwierzytelnianie -
106 jeśli użytkownicy są w /etc/passwd, to właściwie nie trzeba nic
109 Dovecot powinien być w miarę szybki, głównie z powodu plików
110 indeksowych utrzymywanych przez serwer; zamiast potrzeby skanowania
111 wszystkich danych w skrzynce, Dovecot może małym kosztem uzyskać
112 większość potrzebnych informacji z indeksu.
115 - powinien być gotowy do użycia ze zwykłymi klientami IMAP
116 - pełna obsługa IMAP4rev1 i POP3
117 - obsługa rozszerzeń THREAD, SORT i IDLE, wymaganych przez wiele
120 - pełna obsługa TLS/SSL
121 - quota Maildir++ jest obsługiwana, ale twarda quota na systemach
122 plików może być problematyczna
125 Summary: Development package for Dovecot plugins
126 Summary(pl.UTF-8): Pakiet programistyczny do tworzenia wtyczek dla Dovecota
127 Group: Development/Libraries
128 Requires: %{name}-libs = %{epoch}:%{version}-%{release}
131 Development package for Dovecot plugins.
133 %description devel -l pl.UTF-8
134 Pakiet programistyczny do tworzenia wtyczek dla Dovecota.
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.
153 %{__sed} -i 's,/usr/lib/dovecot,%{_libdir}/dovecot,g' doc/example-config/*.conf doc/example-config/conf.d/*.conf
164 %{?debug:--enable-debug} \
165 %{?with_ldap:--with-ldap=yes} \
166 %{?with_mysql:--with-mysql} \
167 %{?with_pgsql:--with-pgsql} \
168 %{?with_sqlite:--with-sqlite} \
169 %{?with_gssapi:--with-gssapi=plugin} \
176 --with-moduledir=%{_libdir}/%{name}/plugins \
177 --with-ssldir=/var/lib/openssl \
178 --sysconfdir=%{_sysconfdir} \
179 --with-systemdsystemunitdir=%{systemdunitdir}
184 rm -rf $RPM_BUILD_ROOT
185 install -d $RPM_BUILD_ROOT/etc/{pam.d,rc.d/init.d,sysconfig,security} \
186 $RPM_BUILD_ROOT{/var/lib/dovecot,/var/run/dovecot/login} \
187 $RPM_BUILD_ROOT/usr/lib/tmpfiles.d
190 DESTDIR=$RPM_BUILD_ROOT
192 mv -f $RPM_BUILD_ROOT%{_datadir}/doc/%{name}/example-config/* $RPM_BUILD_ROOT%{_sysconfdir}/dovecot
194 cp -a %{SOURCE1} $RPM_BUILD_ROOT/etc/pam.d/%{name}
195 install -p %{SOURCE2} $RPM_BUILD_ROOT/etc/rc.d/init.d/%{name}
196 cp -a %{SOURCE3} $RPM_BUILD_ROOT/etc/sysconfig/%{name}
197 install %{SOURCE4} $RPM_BUILD_ROOT/usr/lib/tmpfiles.d/%{name}.conf
199 touch $RPM_BUILD_ROOT/etc/security/blacklist.imap
201 find $RPM_BUILD_ROOT%{_libdir}/%{name} -name '*.la' | xargs rm
203 %{__rm} -r $RPM_BUILD_ROOT%{_docdir}/%{name}
204 %{__rm} -r $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/README
207 rm -rf $RPM_BUILD_ROOT
210 %groupadd -g 172 dovecot
211 %useradd -u 172 -d /usr/share/empty -s /bin/false -c "Dovecot server" -g dovecot dovecot
212 %groupadd -g 254 dovenull
213 %useradd -u 254 -d /usr/share/empty -s /bin/false -c "Dovecot server" -g dovenull dovenull
216 /sbin/chkconfig --add dovecot
217 %service dovecot restart
218 %systemd_post dovecot.socket dovecot.service
221 if [ "$1" = "0" ]; then
222 %service dovecot stop
223 /sbin/chkconfig --del dovecot
225 %systemd_preun dovecot.service dovecot.socket
228 if [ "$1" = "0" ]; then
232 %groupremove dovenull
236 %post libs -p /sbin/ldconfig
237 %postun libs -p /sbin/ldconfig
240 # restart devocot if pam is upgraded
241 # (dovecot is linked with old libpam but tries to open modules linked with new libpam)
242 if [ "$2" != 1 ]; then
243 %service -q dovecot restart
246 %triggerpostun -- dovecot < 1:2.0.0
247 # upgrading dovecot < 1.1
248 echo "Configuration change default_mail_env -> mail_location"
249 %{__sed} -i -e "s/^default_mail_env/mail_location/" /etc/dovecot/dovecot.conf
250 # upgrading dovecot < 2.0
252 for a in /etc/dovecot/dovecot-db-example.conf \
253 /etc/dovecot/dovecot-dict-sql-example.conf \
254 /etc/dovecot/dovecot-ldap-example.conf \
255 /etc/dovecot/dovecot-sql-example.conf \
256 /etc/dovecot/dovecot.conf; do
258 [ "$i" -eq 0 ] && echo "Read http://wiki2.dovecot.org/Upgrading/2.0"
260 echo "Trying to migrate $a config file to dovecot 2."
261 cp -a "$a" "$a-1.2.org"
264 # convert config and prefix stderr lines with #
265 %{_bindir}/doveconf -n -c "$a-1.2.org" > "$a" 2> "$a.log" || :
268 if [ "$i" -eq 1 ]; then
269 echo "Please verify contents of %{_sysconfdir}/%{name}/* files."
272 %triggerpostun -- %{name} < 1:2.2.4-2
273 %systemd_trigger dovecot.service dovecot.socket
276 %defattr(644,root,root,755)
277 # COPYING contains some notes, not actual LGPL text
278 %doc AUTHORS COPYING ChangeLog NEWS README TODO doc/*.txt doc/*.c*f doc/wiki/*.txt
279 %attr(755,root,root) %{_bindir}/doveadm
280 %attr(755,root,root) %{_bindir}/doveconf
281 %attr(755,root,root) %{_bindir}/dsync
282 %attr(755,root,root) %{_sbindir}/%{name}
283 %attr(751,root,root) %dir %{_sysconfdir}/%{name}
284 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}/%{name}.conf
285 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}/*.ext
286 %attr(751,root,root) %dir %{_sysconfdir}/%{name}/conf.d
287 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}/conf.d/*.conf
288 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}/conf.d/*.ext
289 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/pam.d/%{name}
290 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/security/blacklist.imap
291 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/%{name}
292 %attr(754,root,root) /etc/rc.d/init.d/%{name}
293 %attr(755,root,root) %{_libdir}/%{name}/aggregator
294 %attr(755,root,root) %{_libdir}/%{name}/anvil
295 %attr(755,root,root) %{_libdir}/%{name}/auth
296 %attr(755,root,root) %{_libdir}/%{name}/checkpassword-reply
297 %attr(755,root,root) %{_libdir}/%{name}/config
298 %attr(755,root,root) %{_libdir}/%{name}/decode2text.sh
299 %attr(755,root,root) %{_libdir}/%{name}/deliver
300 %attr(755,root,root) %{_libdir}/%{name}/dict
301 %attr(755,root,root) %{_libdir}/%{name}/director
302 %attr(755,root,root) %{_libdir}/%{name}/dns-client
303 %attr(755,root,root) %{_libdir}/%{name}/doveadm-server
304 %attr(755,root,root) %{_libdir}/%{name}/dovecot-lda
305 %attr(755,root,root) %{_libdir}/%{name}/gdbhelper
306 %attr(755,root,root) %{_libdir}/%{name}/imap
307 %attr(755,root,root) %{_libdir}/%{name}/imap-login
308 %attr(755,root,root) %{_libdir}/%{name}/imap-urlauth
309 %attr(755,root,root) %{_libdir}/%{name}/imap-urlauth-login
310 %attr(755,root,root) %{_libdir}/%{name}/imap-urlauth-worker
311 %attr(755,root,root) %{_libdir}/%{name}/indexer
312 %attr(755,root,root) %{_libdir}/%{name}/indexer-worker
313 %attr(755,root,root) %{_libdir}/%{name}/ipc
314 %attr(755,root,root) %{_libdir}/%{name}/lmtp
315 %attr(755,root,root) %{_libdir}/%{name}/log
316 %attr(755,root,root) %{_libdir}/%{name}/maildirlock
317 %attr(755,root,root) %{_libdir}/%{name}/pop3
318 %attr(755,root,root) %{_libdir}/%{name}/pop3-login
319 %attr(755,root,root) %{_libdir}/%{name}/quota-status
320 %attr(755,root,root) %{_libdir}/%{name}/rawlog
321 %attr(755,root,root) %{_libdir}/%{name}/replicator
322 %attr(755,root,root) %{_libdir}/%{name}/script
323 %attr(755,root,root) %{_libdir}/%{name}/script-login
324 %attr(755,root,root) %{_libdir}/%{name}/ssl-params
325 %attr(755,root,root) %{_libdir}/%{name}/stats
326 %attr(755,root,root) %{_libdir}/%{name}/xml2text
327 %dir %{_libdir}/%{name}/plugins
328 %attr(755,root,root) %{_libdir}/%{name}/plugins/*.so
329 %dir %{_libdir}/%{name}/plugins/auth
330 %attr(755,root,root) %{_libdir}/%{name}/plugins/auth/*.so
331 %dir %{_libdir}/%{name}/plugins/dict
332 %attr(755,root,root) %{_libdir}/%{name}/plugins/dict/*.so
333 %dir %{_libdir}/%{name}/plugins/doveadm
334 %attr(755,root,root) %{_libdir}/%{name}/plugins/doveadm/*.so
335 %{systemdunitdir}/dovecot.service
336 %{systemdunitdir}/dovecot.socket
337 /usr/lib/tmpfiles.d/%{name}.conf
338 %dir /var/lib/dovecot
339 %dir /var/run/dovecot
340 %attr(750,root,dovenull) %dir /var/run/dovecot/login
342 %{_mandir}/man1/deliver.1*
343 %{_mandir}/man1/dove*.1*
344 %{_mandir}/man1/dsync.1*
345 %{_mandir}/man7/doveadm-search-query.7*
348 %defattr(644,root,root,755)
349 %attr(755,root,root) %{_libdir}/%{name}/libdovecot.so
350 %attr(755,root,root) %{_libdir}/%{name}/libdovecot-compression.so
351 %attr(755,root,root) %{_libdir}/%{name}/libdovecot-lda.so
352 %attr(755,root,root) %{_libdir}/%{name}/libdovecot-login.so
353 %attr(755,root,root) %{_libdir}/%{name}/libdovecot-sql.so
354 %attr(755,root,root) %{_libdir}/%{name}/libdovecot-storage.so
355 %{_libdir}/%{name}/%{name}-config
356 %{_includedir}/%{name}
357 %{_aclocaldir}/dovecot.m4
360 %defattr(644,root,root,755)
361 %dir %{_libdir}/%{name}
362 %attr(755,root,root) %{_libdir}/%{name}/libdovecot.so.0.0.0
363 %attr(755,root,root) %{_libdir}/%{name}/libdovecot-compression.so.0.0.0
364 %attr(755,root,root) %{_libdir}/%{name}/libdovecot-lda.so.0.0.0
365 %attr(755,root,root) %{_libdir}/%{name}/libdovecot-login.so.0.0.0
366 %attr(755,root,root) %{_libdir}/%{name}/libdovecot-sql.so.0.0.0
367 %attr(755,root,root) %{_libdir}/%{name}/libdovecot-storage.so.0.0.0
368 # Note: we are in %{_libdir}/dovecot, ldconfig does not look into this
369 # directory. This is why the following files are not %ghost
370 %attr(755,root,root) %{_libdir}/%{name}/libdovecot.so.0
371 %attr(755,root,root) %{_libdir}/%{name}/libdovecot-compression.so.0
372 %attr(755,root,root) %{_libdir}/%{name}/libdovecot-lda.so.0
373 %attr(755,root,root) %{_libdir}/%{name}/libdovecot-login.so.0
374 %attr(755,root,root) %{_libdir}/%{name}/libdovecot-sql.so.0
375 %attr(755,root,root) %{_libdir}/%{name}/libdovecot-storage.so.0