Gentoo Archives: gentoo-commits

From: Eray Aslan <eras@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: net-mail/dovecot/
Date: Thu, 13 Apr 2017 05:53:25
Message-Id: 1492062773.1a67adad3dd7b1825169698b0ed1bb51c687f8b0.eras@gentoo
1 commit: 1a67adad3dd7b1825169698b0ed1bb51c687f8b0
2 Author: Eray Aslan <eras <AT> gentoo <DOT> org>
3 AuthorDate: Thu Apr 13 05:52:53 2017 +0000
4 Commit: Eray Aslan <eras <AT> gentoo <DOT> org>
5 CommitDate: Thu Apr 13 05:52:53 2017 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=1a67adad
7
8 net-mail/dovecot: security bump - bug 615264
9
10 Package-Manager: Portage-2.3.5, Repoman-2.3.2
11
12 net-mail/dovecot/Manifest | 2 +
13 net-mail/dovecot/dovecot-2.2.29.1.ebuild | 307 +++++++++++++++++++++++++++++++
14 2 files changed, 309 insertions(+)
15
16 diff --git a/net-mail/dovecot/Manifest b/net-mail/dovecot/Manifest
17 index 2b80d67a6f7..7d880422d11 100644
18 --- a/net-mail/dovecot/Manifest
19 +++ b/net-mail/dovecot/Manifest
20 @@ -1,6 +1,8 @@
21 DIST dovecot-2.2-pigeonhole-0.4.16.tar.gz 1713634 SHA256 8f0b98f18062d6e241eef74ebe16cc167cd246361cbe6657d94f0ecc5d7d3234 SHA512 5f59fb35dbe638f8ddd19c0fd0f3fbd6fec1fa238f3781b94c50a8f7ce72a53ac1381a6f8ad9bcc90df1edfa2b263a6dfba88521578e55ce4b3d840bed022b79 WHIRLPOOL 5e037d1e271b9c12a111966306c30536035126e9ba1213697804614d8a3d38996b117b37a744cb5b97873e136bddf110177c501d46c5ce0ffd2110932b911f00
22 DIST dovecot-2.2-pigeonhole-0.4.17.tar.gz 1787177 SHA256 74d869c7532cbf4fe41e3cc95a1aa6ce32e98f4d423f0d099da1e0fba022dae3 SHA512 3ea6faebf04154649c32612f204e909aa131582c99867865bff3d3a78a75593d96109586eeb6403bc915046b8b6f02e8bacbf6cb6733ea186d2e1a209a7e2b79 WHIRLPOOL bccf0c679c627cd791af69e8f7efa232b6448d7246af0108c3917ab9f65fc16ca860240c8b69fa8dda23d7b3b485fc9527bfca33bc49b42a10d84a29897a2a3b
23 +DIST dovecot-2.2-pigeonhole-0.4.18.tar.gz 1742357 SHA256 dd871bb57fad22795460f613f3c9484a8bf229272ac00956d837a34444f1c3a9 SHA512 6f49a6a6435b0e4dcbe29f852ce17c016df2f367f5460301a2a2c6bd5f5ba6260b23bfe1c5e78b91c6041554ee67d1ce14ad3adf219505f692c61681d9e70cc4 WHIRLPOOL 809ca6efbdf8688087bbfa48902d7c5467a5313135ce23d621eb84541854140e48c94e7ce8180f9e64816df8c1faf85a8cb42c29bf749da1eb7ebfb125469080
24 DIST dovecot-2.2-pigeonhole-0.4.9.tar.gz 1577127 SHA256 82892f876d26008a076973dfddf1cffaf5a0451825fd44e06287e94b89078649 SHA512 9e7a18b43d59ed955b142d16696ca221822a547ea59ac70c1bb374eedb28b6ed99ea49f34ead1f9a16ded4573605e410a5cc8e038e1bdf5f943a65588b5d3af2 WHIRLPOOL be309436b43af82a7cb8eff205e1638b2c59751927fdab187e6fde72330e4abd99878cbfa94ca50440ec8de1f9b569bf334d426891ddc73d5f647ee2040c193f
25 DIST dovecot-2.2.19.tar.gz 5256627 SHA256 759e1e3f9d907cdaabad1f5fbacc793ca191d234c084bec3bba42966952a4e9f SHA512 1b9d605a6a5862ade9d1ca634a9e0171b7c212ab025fc2059051c3795470685b66516fa9fbe5ad91d84388268ea15795f2dcd70ffdf81736ce4d80fd284835e9 WHIRLPOOL 30dbe70bfeef10dbe414ebf3f091041ad66926a8748cd401ecaf9ed5c7602939e86943d98bfb839f32c0aa1d0081ab71adacf23bb4adba34e828ee296e9a7278
26 DIST dovecot-2.2.27.tar.gz 5794668 SHA256 897f92a87cda4b27b243f8149ce0ba7b7e71a2be8fb7994eb0a025e54cde18e9 SHA512 faab441bb2afa1e6de3e6ec6207c92a333773941bbc10c4761483ef6ccc193d3a4983de1acc73325122c22b197ea25c1e54886cccfb6b060ede90936a69b71f2 WHIRLPOOL dd17a079118a300a56b26c48c152e44267f69a2138af066944a207ca5851c4b430a40c8553a794061321b67b2e5d7f721ba897b7a17826651c884db72e6d4424
27 DIST dovecot-2.2.28.tar.gz 5921992 SHA256 e0288f59e326ab87cb3881fdabadafe542f4dc7ab9996db13863a439ebbc1f25 SHA512 3f40eb52413130dd47da98470d797ede63db3296923c2888b48f1a021e473cfcad064671ad804037d101990457ee57def30f2c27010ede2d758f3d3cfd8ef741 WHIRLPOOL cb92cdafcbfa2d42d9a7c16d20495e3d6828c8f836341a736d740df51e246c40f75417d8959bd5c9a4429f2217790f0edde262806d62a643a8d0da8b76db9600
28 +DIST dovecot-2.2.29.1.tar.gz 5972119 SHA256 ccfa9ffb7eb91e9e87c21c108324b911250c9ffa838bffb64b1caafadcb0f388 SHA512 1e5ea6080ebe7dd4afe6fcfe8e98ed6d2ad2735655a18cc96e439dd044ccc3a1a6a80428bc746b4d6250820895d6a62121562e97e4b46c8b1cf88a19443bc111 WHIRLPOOL 97a3b45191a32e78a08b4113a6e8b34e0bc538ec8359210d0bdf63990246af89be25cdaf9017c46f3107a7ec82758fa25820d61c25eda94f14ce7351d3aaea7a
29
30 diff --git a/net-mail/dovecot/dovecot-2.2.29.1.ebuild b/net-mail/dovecot/dovecot-2.2.29.1.ebuild
31 new file mode 100644
32 index 00000000000..9a32e155bab
33 --- /dev/null
34 +++ b/net-mail/dovecot/dovecot-2.2.29.1.ebuild
35 @@ -0,0 +1,307 @@
36 +# Copyright 1999-2017 Gentoo Foundation
37 +# Distributed under the terms of the GNU General Public License v2
38 +
39 +EAPI=6
40 +inherit ssl-cert systemd user versionator
41 +
42 +MY_P="${P/_/.}"
43 +major_minor="$(get_version_component_range 1-2)"
44 +sieve_version="0.4.18"
45 +if [[ ${PV} == *_rc* ]] ; then
46 + rc_dir="rc/"
47 +else
48 + rc_dir=""
49 +fi
50 +SRC_URI="https://dovecot.org/releases/${major_minor}/${rc_dir}${MY_P}.tar.gz
51 + sieve? (
52 + https://pigeonhole.dovecot.org/releases/${major_minor}/${PN}-${major_minor}-pigeonhole-${sieve_version}.tar.gz
53 + )
54 + managesieve? (
55 + https://pigeonhole.dovecot.org/releases/${major_minor}/${PN}-${major_minor}-pigeonhole-${sieve_version}.tar.gz
56 + ) "
57 +DESCRIPTION="An IMAP and POP3 server written with security primarily in mind"
58 +HOMEPAGE="http://www.dovecot.org/"
59 +
60 +SLOT="0"
61 +LICENSE="LGPL-2.1 MIT"
62 +KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ppc ~ppc64 ~s390 ~x86"
63 +
64 +IUSE_DOVECOT_AUTH="kerberos ldap mysql pam postgres sqlite vpopmail"
65 +IUSE_DOVECOT_STORAGE="cydir imapc +maildir mbox mdbox pop3c sdbox"
66 +IUSE_DOVECOT_COMPRESS="bzip2 lzma lz4 zlib"
67 +IUSE_DOVECOT_OTHER="caps doc ipv6 libressl lucene managesieve selinux sieve solr +ssl static-libs suid tcpd textcat"
68 +
69 +IUSE="${IUSE_DOVECOT_AUTH} ${IUSE_DOVECOT_STORAGE} ${IUSE_DOVECOT_COMPRESS} ${IUSE_DOVECOT_OTHER}"
70 +
71 +DEPEND="bzip2? ( app-arch/bzip2 )
72 + caps? ( sys-libs/libcap )
73 + kerberos? ( virtual/krb5 )
74 + ldap? ( net-nds/openldap )
75 + lucene? ( >=dev-cpp/clucene-2.3 )
76 + lzma? ( app-arch/xz-utils )
77 + lz4? ( app-arch/lz4 )
78 + mysql? ( virtual/mysql )
79 + pam? ( virtual/pam )
80 + postgres? ( dev-db/postgresql:* !dev-db/postgresql[ldap,threads] )
81 + selinux? ( sec-policy/selinux-dovecot )
82 + solr? ( net-misc/curl dev-libs/expat )
83 + sqlite? ( dev-db/sqlite:* )
84 + ssl? (
85 + !libressl? ( dev-libs/openssl:0 )
86 + libressl? ( dev-libs/libressl )
87 + )
88 + tcpd? ( sys-apps/tcp-wrappers )
89 + textcat? ( app-text/libexttextcat )
90 + vpopmail? ( net-mail/vpopmail )
91 + zlib? ( sys-libs/zlib )
92 + virtual/libiconv
93 + dev-libs/icu:="
94 +
95 +RDEPEND="${DEPEND}
96 + net-mail/mailbase"
97 +
98 +S=${WORKDIR}/${MY_P}
99 +
100 +pkg_setup() {
101 + if use managesieve && ! use sieve; then
102 + ewarn "managesieve USE flag selected but sieve USE flag unselected"
103 + ewarn "sieve USE flag will be turned on"
104 + fi
105 + # default internal user
106 + enewgroup dovecot 97
107 + enewuser dovecot 97 -1 /dev/null dovecot
108 + # default login user
109 + enewuser dovenull -1 -1 /dev/null
110 + # add "mail" group for suid'ing. Better security isolation.
111 + if use suid; then
112 + enewgroup mail
113 + fi
114 +}
115 +
116 +src_prepare() {
117 + eapply -p0 "${FILESDIR}/${PN}-10-ssl.patch"
118 + eapply_user
119 +}
120 +
121 +src_configure() {
122 + local conf=""
123 +
124 + if use postgres || use mysql || use sqlite; then
125 + conf="${conf} --with-sql"
126 + fi
127 +
128 + local storages=""
129 + for storage in ${IUSE_DOVECOT_STORAGE//+/}; do
130 + use ${storage} && storages="${storage} ${storages}"
131 + done
132 + [ "${storages}" ] || storages="maildir"
133 +
134 + # turn valgrind tests off. Bug #340791
135 + VALGRIND=no econf \
136 + --localstatedir="${EPREFIX}/var" \
137 + --runstatedir="${EPREFIX}/run" \
138 + --with-moduledir="${EPREFIX}/usr/$(get_libdir)/dovecot" \
139 + --without-stemmer \
140 + --with-storages="${storages}" \
141 + --disable-rpath \
142 + --with-icu \
143 + --with-systemdsystemunitdir="$(systemd_get_systemunitdir)" \
144 + $( use_with bzip2 bzlib ) \
145 + $( use_with caps libcap ) \
146 + $( use_with kerberos gssapi ) \
147 + $( use_with ldap ) \
148 + $( use_with lucene ) \
149 + $( use_with lz4 ) \
150 + $( use_with lzma ) \
151 + $( use_with mysql ) \
152 + $( use_with pam ) \
153 + $( use_with postgres pgsql ) \
154 + $( use_with sqlite ) \
155 + $( use_with solr ) \
156 + $( use_with ssl ) \
157 + $( use_with tcpd libwrap ) \
158 + $( use_with textcat ) \
159 + $( use_with vpopmail ) \
160 + $( use_with zlib ) \
161 + $( use_enable static-libs static ) \
162 + ${conf}
163 +
164 + if use sieve || use managesieve ; then
165 + # The sieve plugin needs this file to be build to determine the plugin
166 + # directory and the list of libraries to link to.
167 + emake dovecot-config
168 + cd "../dovecot-${major_minor}-pigeonhole-${sieve_version}" || die "cd failed"
169 + econf \
170 + $( use_enable static-libs static ) \
171 + --localstatedir="${EPREFIX}/var" \
172 + --enable-shared \
173 + --with-dovecot="../${MY_P}" \
174 + $( use_with managesieve )
175 + fi
176 +}
177 +
178 +src_compile() {
179 + default
180 + if use sieve || use managesieve ; then
181 + cd "../dovecot-${major_minor}-pigeonhole-${sieve_version}" || die "cd failed"
182 + emake CC="$(tc-getCC)" CFLAGS="${CFLAGS}"
183 + fi
184 +}
185 +
186 +src_test() {
187 + default
188 + if use sieve || use managesieve ; then
189 + cd "../dovecot-${major_minor}-pigeonhole-${sieve_version}" || die "cd failed"
190 + default
191 + fi
192 +}
193 +
194 +src_install () {
195 + default
196 +
197 + # insecure:
198 + # use suid && fperms u+s /usr/libexec/dovecot/deliver
199 + # better:
200 + if use suid;then
201 + einfo "Changing perms to allow deliver to be suided"
202 + fowners root:mail "${EPREFIX}/usr/libexec/dovecot/dovecot-lda"
203 + fperms 4750 "${EPREFIX}/usr/libexec/dovecot/dovecot-lda"
204 + fi
205 +
206 + newinitd "${FILESDIR}"/dovecot.init-r4 dovecot
207 +
208 + rm -rf "${ED}"/usr/share/doc/dovecot
209 +
210 + dodoc AUTHORS NEWS README TODO
211 + dodoc doc/*.{txt,cnf,xml,sh}
212 + docinto example-config
213 + dodoc doc/example-config/*.{conf,ext}
214 + docinto example-config/conf.d
215 + dodoc doc/example-config/conf.d/*.{conf,ext}
216 + docinto wiki
217 + dodoc doc/wiki/*
218 + doman doc/man/*.{1,7}
219 +
220 + # Create the dovecot.conf file from the dovecot-example.conf file that
221 + # the dovecot folks nicely left for us....
222 + local conf="${ED}/etc/dovecot/dovecot.conf"
223 + local confd="${ED}/etc/dovecot/conf.d"
224 +
225 + insinto /etc/dovecot
226 + doins doc/example-config/*.{conf,ext}
227 + insinto /etc/dovecot/conf.d
228 + doins doc/example-config/conf.d/*.{conf,ext}
229 + fperms 0600 "${EPREFIX}"/etc/dovecot/dovecot-{ldap,sql}.conf.ext
230 + rm -f "${confd}/../README"
231 +
232 + # .maildir is the Gentoo default
233 + local mail_location="maildir:~/.maildir"
234 + if ! use maildir; then
235 + if use mbox; then
236 + mail_location="mbox:/var/spool/mail/%u:INDEX=/var/dovecot/%u"
237 + keepdir /var/dovecot
238 + sed -i -e 's|#mail_privileged_group =|mail_privileged_group = mail|' \
239 + "${confd}/10-mail.conf" || die "sed failed"
240 + elif use mdbox ; then
241 + mail_location="mdbox:~/.mdbox"
242 + elif use sdbox ; then
243 + mail_location="sdbox:~/.sdbox"
244 + fi
245 + fi
246 + sed -i -e \
247 + "s|#mail_location =|mail_location = ${mail_location}|" \
248 + "${confd}/10-mail.conf" \
249 + || die "failed to update mail location settings in 10-mail.conf"
250 +
251 + # We're using pam files (imap and pop3) provided by mailbase
252 + if use pam; then
253 + sed -i -e '/driver = pam/,/^[ \t]*}/ s|#args = dovecot|args = "\*"|' \
254 + "${confd}/auth-system.conf.ext" \
255 + || die "failed to update PAM settings in auth-system.conf.ext"
256 + # mailbase does not provide a sieve pam file
257 + use managesieve && dosym imap /etc/pam.d/sieve
258 + sed -i -e \
259 + 's/#!include auth-system.conf.ext/!include auth-system.conf.ext/' \
260 + "${confd}/10-auth.conf" \
261 + || die "failed to update PAM settings in 10-auth.conf"
262 + fi
263 +
264 + # Disable ipv6 if necessary
265 + if ! use ipv6; then
266 + sed -i -e 's/^#listen = \*, ::/listen = \*/g' "${conf}" \
267 + || die "failed to update listen settings in dovecot.conf"
268 + fi
269 +
270 + # Update ssl cert locations
271 + if use ssl; then
272 + sed -i -e 's:^#ssl = yes:ssl = yes:' "${confd}/10-ssl.conf" \
273 + || die "ssl conf failed"
274 + sed -i -e 's:^ssl_cert =.*:ssl_cert = </etc/ssl/dovecot/server.pem:' \
275 + -e 's:^ssl_key =.*:ssl_key = </etc/ssl/dovecot/server.key:' \
276 + "${confd}/10-ssl.conf" || die "failed to update SSL settings in 10-ssl.conf"
277 + fi
278 +
279 + # Install SQL configuration
280 + if use mysql || use postgres; then
281 + sed -i -e \
282 + 's/#!include auth-sql.conf.ext/!include auth-sql.conf.ext/' \
283 + "${confd}/10-auth.conf" || die "failed to update SQL settings in \
284 + 10-auth.conf"
285 + fi
286 +
287 + # Install LDAP configuration
288 + if use ldap; then
289 + sed -i -e \
290 + 's/#!include auth-ldap.conf.ext/!include auth-ldap.conf.ext/' \
291 + "${confd}/10-auth.conf" \
292 + || die "failed to update ldap settings in 10-auth.conf"
293 + fi
294 +
295 + if use vpopmail; then
296 + sed -i -e \
297 + 's/#!include auth-vpopmail.conf.ext/!include auth-vpopmail.conf.ext/' \
298 + "${confd}/10-auth.conf" \
299 + || die "failed to update vpopmail settings in 10-auth.conf"
300 + fi
301 +
302 + if use sieve || use managesieve ; then
303 + cd "../dovecot-${major_minor}-pigeonhole-${sieve_version}" || die "cd failed"
304 + emake DESTDIR="${ED}" install
305 + sed -i -e \
306 + 's/^[[:space:]]*#mail_plugins = $mail_plugins/mail_plugins = sieve/' "${confd}/15-lda.conf" \
307 + || die "failed to update sieve settings in 15-lda.conf"
308 + rm -rf "${ED}"/usr/share/doc/dovecot
309 + docinto example-config/conf.d
310 + dodoc doc/example-config/conf.d/*.conf
311 + insinto /etc/dovecot/conf.d
312 + doins doc/example-config/conf.d/90-sieve{,-extprograms}.conf
313 + use managesieve && doins doc/example-config/conf.d/20-managesieve.conf
314 + docinto sieve/rfc
315 + dodoc doc/rfc/*.txt
316 + docinto sieve/devel
317 + dodoc doc/devel/DESIGN
318 + docinto plugins
319 + dodoc doc/plugins/*.txt
320 + docinto extensions
321 + dodoc doc/extensions/*.txt
322 + docinto locations
323 + dodoc doc/locations/*.txt
324 + doman doc/man/*.{1,7}
325 + fi
326 +
327 + use static-libs || find "${ED}"/usr/lib* -name '*.la' -delete
328 +}
329 +
330 +pkg_postinst() {
331 + if use ssl; then
332 + # Let's not make a new certificate if we already have one
333 + if ! [[ -e "${ROOT}"/etc/ssl/dovecot/server.pem && \
334 + -e "${ROOT}"/etc/ssl/dovecot/server.key ]]; then
335 + einfo "Creating SSL certificate"
336 + SSL_ORGANIZATION="${SSL_ORGANIZATION:-Dovecot IMAP Server}"
337 + install_cert /etc/ssl/dovecot/server
338 + fi
339 + fi
340 +
341 + elog "Please read http://wiki2.dovecot.org/Upgrading/ for upgrade notes."
342 +}