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