Merge ~paelzer/ubuntu/+source/dovecot:merge into ~usd-import-team/ubuntu/+source/dovecot:debian/sid

Proposed by ChristianEhrhardt on 2016-06-21
Status: Merged
Merge reported by: Robie Basak
Merged at revision: not available
Proposed branch: ~paelzer/ubuntu/+source/dovecot:merge
Merge into: ~usd-import-team/ubuntu/+source/dovecot:debian/sid
Diff against target: 1569 lines (+1309/-23)
18 files modified
debian/99-mail-stack-delivery.conf (+48/-0)
debian/changelog (+519/-0)
debian/control (+23/-19)
debian/dovecot-core.dirs (+2/-0)
debian/dovecot-core.lintian-overrides (+0/-1)
debian/dovecot-core.maintscript (+1/-0)
debian/dovecot-core.ufw.profile (+23/-0)
debian/mail-stack-delivery.README.Debian (+24/-0)
debian/mail-stack-delivery.dirs (+2/-0)
debian/mail-stack-delivery.postinst (+91/-0)
debian/mail-stack-delivery.postrm (+35/-0)
debian/mail-stack-delivery.preinst (+56/-0)
debian/rules (+9/-3)
debian/source_dovecot.py (+39/-0)
debian/tests/control (+6/-0)
debian/tests/general (+218/-0)
debian/tests/testlib.py (+101/-0)
debian/tests/testlib_dovecot.py (+112/-0)
Reviewer Review Type Date Requested Status
Robie Basak 2016-06-21 Approve on 2016-08-18
Review via email: mp+298040@code.launchpad.net

Description of the Change

Merge of Dovecot from Debian

Along that I also provided a no change rebuild of a depending package dovecot-antispam at bug 1524526. Once review approves and uploads this it would be great to pick that one up on top.

Changelog as in the Upload:
  * Merge with Debian; Remaining Changes:
    + Add mail-stack-delivery
      - add package in d/rules, d/control
      - add d/*mail-stack-delivery* maintainer scripts and default conf
      - d/mail-stack-delivery.preinst: Move previously installed backups and
        config files to a new package namespace.
    + Drop build dependency on libstemmer-dev (universe)
    + Use Snakeoil SSL certificates by default
      - d/control: Depend on ssl-cert
      - add lsb base dependency
    + Add autopkgtest to debian/tests/*.
      - also fixup the tests we had to work with recent dovecot versions
    + Add ufw integration:
      - d/dovecot-core.ufw.prol-stack-deliveryfile: new ufw profile.
      - d/rules: install profile in dovecot-core.
      - d/control: dovecot-core - suggest ufw.
    + Add apport hook:
      - d/rules, d/source_dovecot.py
    + Remove lintian override for drac
  * Added Changes:
    - Disable dovecot-lucene plugin as it had various issues, has universe
      dependencies and is deprecated in favor of solr anyway (LP: #1524526).
  * Dropped Changes:
    - Add upstart job (that means we no more add it now)
    - no more needed upgrade hangling of mail-stack-delivery related to
      2.1.7-7 and 1.2.9-1ubuntu8 (both out of scope of any possible
      paths now)
    - d/dovecot-core.dirs: Added usr/share/doc/dovecot-core (was only left
      in changelog)
    - ntpdate Recommends (was missing in former Changelog, now superseeded
      by timesyncd which is available by default)

Note: the importer helped a lot to find changelog-only and missing-in-changelog modifications.

To post a comment you must log in.
Robie Basak (racb) wrote :

Thank you for tackling a really challenging merge!

You've done a good job of following the process with reconstruct, deconstruct and logical deltas, and this made it much easier for me to review.

Please note that our convention is to use {reconstruct,deconstruct,logical}/<version> (with standard dep14 substitutions). This allows us to store multiple tags associated with multiple versions for archival purposes. I've also written my lint tool to expect these tags so it breaks otherwise. Temporarily I just created the tags locally based on what you already had (you had the right tags, just not with the standard names). I hope to publish my lint tool soon, so it can be run before submitting a merge proposal.

A second note that has not occurred to me before: it would be helpful if the ordering of changelog entries matched the order of the git commits in the proposed branch. This would make it easier to review, but I appreciate that re-ordering can be quite painful because of merge conflicts, so I'm not sure if it's reasonable to require this in our process.

Further comments inline, with some required fixes. I haven't checked if this passes dep8, but will do that before uploading.

I think some of the delta we're applying is relevant to Debian and should be sent there or dropped. I also want to propose the deprecation of the mail-stack-delivery stuff, and then for us to drop that delta too to make the package simpler. But I'm not proposing to do any of this for this particular merge. You've cleaned this package up considerably, and I think it's OK to finish everything off in later iterations rather than trying to do everything all at once.

review: Needs Fixing
43baf2d... by ChristianEhrhardt on 2016-06-28

changelog: correct reason to have lsb base dependency

8be1eed... by ChristianEhrhardt on 2016-06-28

changelog: clarify that the fixes to autopackagetests were added

dce051a... by ChristianEhrhardt on 2016-06-28

changelog: fix name of dovecot-core.ufw.profile

800699a... by ChristianEhrhardt on 2016-06-28

d/control drop build dependency to libclucene-dev

b93ebfa... by ChristianEhrhardt on 2016-06-28

changelog: fix typos

4a3e003... by ChristianEhrhardt on 2016-06-28

drop d/docs as it is not needed

087b554... by ChristianEhrhardt on 2016-06-28

changelog: add dropping of d/docs as delta

0b88d95... by ChristianEhrhardt on 2016-06-28

changelog: clarified use of configuration files for mail-stack-delivery

94ebfd6... by ChristianEhrhardt on 2016-06-28

handle conffile removal of /etc/init/dovecot.conf

ChristianEhrhardt (paelzer) wrote :

Hi Robie,
thanks a lot for the thorough review, going to address and fix them one by one.
Challenging is always good to learn, even if it means we might have a few rounds of review iteration.

Yeah integrating that lint check before submission will surely help to be on the same page.
Be sure to mention it in https://wiki.ubuntu.com/UbuntuDevelopment/Merging/GitWorkflow once available.

Back last year it still was the release at least in the repo I still had on disk and the doc said <ubuntu version>. Which is correct as I did use <ubuntu release>, but that said I not only fixed my tags but also added an explanation to the wiki for documentation.
I renamed my tags and hope that goes well without conflict with your locals or so when pushing for merge next time.

I see the benefit of having the changelog and the commits in order.
It is probably too much pain to do so for the logical split for the merge conflicts you already pointed out.
But at least we could - if that helps you - define to have the final merge changelog ordered.
First all "Remaining Changes" with changelog in order to the commits.
Second all "Added Changes" with changelog in order to the commits.
Because reordering text in the changelog is easy that could be done easily.
Would that help you as well or were you particularly interested in the logical split to be ordered?

For Dep8 I can tell you that it went through adt nicely for me, but double check is always better.

You are right about submitting to debian. I'll look into the delta after I addressed your feedback and will submit accordingly.

I already worked on addressing all your great inline feedbacks ...
But I put some tests on my list before uploading again.

P.S. also I run out of power and need to buy a new power adapter first :-/

Robie Basak (racb) wrote :

On Tue, Jun 28, 2016 at 07:19:45AM -0000, ChristianEhrhardt wrote:
> I see the benefit of having the changelog and the commits in order.
> It is probably too much pain to do so for the logical split for the merge conflicts you already pointed out.
> But at least we could - if that helps you - define to have the final merge changelog ordered.
> First all "Remaining Changes" with changelog in order to the commits.
> Second all "Added Changes" with changelog in order to the commits.
> Because reordering text in the changelog is easy that could be done easily.
> Would that help you as well or were you particularly interested in the logical split to be ordered?

This would help I think. Shall we try it and see? I end up looking at
three things side-by-side: the old logical delta, the new logical delta,
and the new changelog. Perhaps my pain is that all three were in
different orders. If "Remaining Changes" were in the same order as the
new logical delta order, that would make it easier to review.

> You are right about submitting to debian. I'll look into the delta
> after I addressed your feedback and will submit accordingly.

Sure, but don't worry about it this time. We can do it on the next
merge. As long as we're making incremental improvements each time, I
don't mind not doing it all at once.

> Thanks, I misinterpreted where this belongs to, but right now I think you as well :-)
>
> Due to your feedback I thought more about it.
> I think what is needed for d/p/dovecot_name.patch is lsb-release which is already in the build dependencies (and it is only used at build time in configure.ac).
>
> I think I found what this is really for, see:
> debian/dovecot-core.dovecot.init:46:# Depend on lsb-base (>= 3.0-6) to ensure that this file is present.
> debian/dovecot-core.dovecot.init:47:. /lib/lsb/init-functions

Ah right, sorry. I wonder though if it is still needed now? Sometimes
it's a transitional thing. But now that sourcing init-functions is
standard, I'd expect something in Debian at a deeper level to depend on
the right thing so every single package doesn't have to do it (or, at
least, for dh_installinit to automatically add it). But I haven't
looked.

c204b18... by ChristianEhrhardt on 2016-06-28

changelog: handling of conffile removal for /etc/init/dovecot.conf

ChristianEhrhardt (paelzer) wrote :

> > Thanks, I misinterpreted where this belongs to, but right now I think you as
> well :-)
> >
> > Due to your feedback I thought more about it.
> > I think what is needed for d/p/dovecot_name.patch is lsb-release which is
> already in the build dependencies (and it is only used at build time in
> configure.ac).
> >
> > I think I found what this is really for, see:
> > debian/dovecot-core.dovecot.init:46:# Depend on lsb-base (>= 3.0-6) to
> ensure that this file is present.
> > debian/dovecot-core.dovecot.init:47:. /lib/lsb/init-functions
>
> Ah right, sorry. I wonder though if it is still needed now? Sometimes
> it's a transitional thing. But now that sourcing init-functions is
> standard, I'd expect something in Debian at a deeper level to depend on
> the right thing so every single package doesn't have to do it (or, at
> least, for dh_installinit to automatically add it). But I haven't
> looked.

While I agree that one would think it is always there it not necessarily is.
It is not auto-added to the list of dependencies in debian-sid.
I was able to leave the init script disfunctional in a debian-sid container by running
"apt-get remove lsb-base cron logrotate"
So I think it is a valid fix to add - as well as to pass to debian.

With all my breaks today I have a hard time to make progress, but I hope to get the testing done until this evening for a new push to the MP.

9903570... by ChristianEhrhardt on 2016-06-28

changelog: order changelog in commit order

ChristianEhrhardt (paelzer) wrote :

Ok, now I tested it once more plus the new conffile handling in modified and unmodified case.
I think I'm ready to push the updated merge branch.

Please let me know if the tags arrived as they should

ChristianEhrhardt (paelzer) wrote :

pushed all changes, ready for the next round of review

Robie Basak (racb) wrote :

Here's a quick review. Just a couple of inline points. Sorry, I may never have told you about dh_builddeb(1) and maintscript files.

I want to finish for the day now, but am not quite finished reviewing. But I thought it might be useful to give you this now.

review: Needs Fixing
ChristianEhrhardt (paelzer) wrote :

Hi Robie,
it is clearly not your fault for not telling, maybe mine for not knowing, but in this case especially googles fault for "debian remove conffile" hitting plain dpkg-maintscript-helper in like place 1-5 for me.

6d94694... by ChristianEhrhardt on 2016-07-01

rework conffile handling to use dh_installdebs package.maintscript

ChristianEhrhardt (paelzer) wrote :

Hi,
almost forgot to push that, but just found in a console that also the adt completed in the meantime.
Before I already tested in a container that conffile removal/backup is still working.

ChristianEhrhardt (paelzer) wrote :

Ping on this review, I checked but as far as I could see all open issues were resolved.
It seems we just were both too busy in the meantime.

Robie Basak (racb) wrote :

Uploaded. Thanks!

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/debian/99-mail-stack-delivery.conf b/debian/99-mail-stack-delivery.conf
2new file mode 100644
3index 0000000..e69c518
4--- /dev/null
5+++ b/debian/99-mail-stack-delivery.conf
6@@ -0,0 +1,48 @@
7+# Some general options
8+protocols = imap pop3 sieve
9+disable_plaintext_auth = yes
10+ssl = yes
11+ssl_cert = </etc/dovecot/dovecot.pem
12+ssl_key = </etc/dovecot/private/dovecot.pem
13+ssl_cipher_list = ALL:!LOW:!SSLv2:ALL:!aNULL:!ADH:!eNULL:!EXP:RC4+RSA:+HIGH:+MEDIUM
14+mail_location = maildir:~/Maildir
15+auth_username_chars = abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ01234567890.-_@
16+
17+# IMAP configuration
18+protocol imap {
19+ mail_max_userip_connections = 10
20+ imap_client_workarounds = delay-newmail
21+}
22+
23+# POP3 configuration
24+protocol pop3 {
25+ mail_max_userip_connections = 10
26+ pop3_client_workarounds = outlook-no-nuls oe-ns-eoh
27+}
28+
29+# LDA configuration
30+protocol lda {
31+ postmaster_address = postmaster
32+ mail_plugins = sieve
33+ quota_full_tempfail = yes
34+ deliver_log_format = msgid=%m: %$
35+ rejection_reason = Your message to <%t> was automatically rejected:%n%r
36+}
37+
38+# Plugins configuration
39+plugin {
40+ sieve=~/.dovecot.sieve
41+ sieve_dir=~/sieve
42+}
43+
44+# Authentication configuration
45+auth_mechanisms = plain login
46+
47+service auth {
48+ # Postfix smtp-auth
49+ unix_listener /var/spool/postfix/private/dovecot-auth {
50+ mode = 0660
51+ user = postfix
52+ group = postfix
53+ }
54+}
55diff --git a/debian/changelog b/debian/changelog
56index 84c9b37..b36a058 100644
57--- a/debian/changelog
58+++ b/debian/changelog
59@@ -1,3 +1,44 @@
60+dovecot (1:2.2.24-1ubuntu1) yakkety; urgency=medium
61+
62+ * Merge with Debian; Remaining Changes:
63+ + Add autopkgtest to debian/tests/*.
64+ + Drop build dependency on libstemmer-dev (universe)
65+ + Use Snakeoil SSL certificates by default
66+ - d/control: Depend on ssl-cert
67+ + add lsb base dependency to ensure debian/dovecot-core.dovecot.init is
68+ working correctly
69+ + Add ufw integration:
70+ - d/dovecot-core.ufw.profile: new ufw profile.
71+ - d/rules: install profile in dovecot-core.
72+ - d/control: dovecot-core - suggest ufw.
73+ + Add apport hook:
74+ - d/rules, d/source_dovecot.py
75+ + Remove lintian override for drac
76+ + Add mail-stack-delivery
77+ - add package in d/rules, d/control
78+ - add d/*mail-stack-delivery* maintainer scripts and default conf
79+ - d/mail-stack-delivery.preinst: Move previously installed backups and
80+ config files to a new package namespace.
81+ * Added Changes:
82+ - Disable dovecot-lucene plugin as it had various issues, has universe
83+ dependencies and is deprecated in favor of solr anyway (LP: #1524526).
84+ - Fixup the autopkgtests we add to work with recent dovecot versions
85+ - d/mail-stack-delivery.README.Debian clarified use of configuration files
86+ - handle conffile removal of /etc/init/dovecot.conf (due to dropping
87+ upstart). Can be removed once no upgrade path from <yakkety is left.
88+ * Dropped Changes:
89+ - Add upstart job (that means we no more add it now)
90+ - no more needed upgrade handling of mail-stack-delivery related to
91+ 2.1.7-7 and 1.2.9-1ubuntu8 (both out of scope of any possible
92+ paths now)
93+ - d/dovecot-core.dirs: Added usr/share/doc/dovecot-core (was only left
94+ in changelog)
95+ - ntpdate Recommends (was missing in former Changelog, now superseded
96+ by timesyncd which is available by default)
97+ - adding of d/docs for dh_installdocs
98+
99+ -- Christian Ehrhardt <christian.ehrhardt@canonical.com> Tue, 21 Jun 2016 16:31:29 +0200
100+
101 dovecot (1:2.2.24-1) unstable; urgency=medium
102
103 * [26020b6] Imported Upstream version 2.2.24 (Closes: #818652)
104@@ -14,6 +55,61 @@ dovecot (1:2.2.23-1) unstable; urgency=medium
105
106 -- Apollon Oikonomopoulos <apoikos@debian.org> Tue, 12 Apr 2016 17:30:03 +0300
107
108+dovecot (1:2.2.22-1ubuntu4) xenial; urgency=medium
109+
110+ * Urgh. Previous upload added a runtime dependency on libstemmer0d to
111+ dovecot-core that I missed. Revert it, and reopen LP: 1524526.
112+
113+ -- Christopher James Halse Rogers <raof@ubuntu.com> Thu, 21 Apr 2016 09:59:28 +1000
114+
115+dovecot (1:2.2.22-1ubuntu3) xenial; urgency=medium
116+
117+ * Re-add build dependency on libstemmer-dev
118+ - In universe, but only adds runtime dependencies to packages already in
119+ universe.
120+ - Fixes crash with missing symbol when enabling fts-lucene plugin
121+ (LP: #1524526)
122+
123+ -- Christopher James Halse Rogers <raof@ubuntu.com> Wed, 20 Apr 2016 12:44:08 +1000
124+
125+dovecot (1:2.2.22-1ubuntu2) xenial; urgency=medium
126+
127+ * Rebuild against libmysqlclient20.
128+
129+ -- Robie Basak <robie.basak@ubuntu.com> Tue, 05 Apr 2016 12:19:25 +0000
130+
131+dovecot (1:2.2.22-1ubuntu1) xenial; urgency=medium
132+
133+ * Merge with Debian; remaining changes:
134+ + Add mail-stack-delivery package:
135+ - Update d/rules
136+ - d/control: convert existing dovecot-postfix package to a dummy
137+ package and add new mail-stack-delivery package.
138+ - Update maintainer scripts.
139+ - Rename d/dovecot-postfix.* to debian/mail-stack-delivery.*
140+ - d/mail-stack-delivery.preinst: Move previously installed backups and
141+ config files to a new package namespace.
142+ - d/mail-stack-delivery.prerm: Added to handle downgrades.
143+ + Use Snakeoil SSL certificates by default:
144+ - d/control: Depend on ssl-cert.
145+ + Add autopkgtest to debian/tests/*.
146+ + Add ufw integration:
147+ - d/dovecot-core.ufw.profile: new ufw profile.
148+ - d/rules: install profile in dovecot-core.
149+ - d/control: dovecot-core - suggest ufw.
150+ + d/dovecot-core.dirs: Added usr/share/doc/dovecot-core
151+ + Add apport hook:
152+ - d/rules, d/source_dovecot.py
153+ + Add upstart job:
154+ - d/rules, d/dovecot-core.dovecot.upstart, d/control,
155+ d/dovecot-core.dirs, dovecot-imapd.{postrm, postinst, prerm},
156+ d/dovecot-pop3d.{postinst, postrm, prerm}.
157+ d/mail-stack-deliver.postinst: Convert init script to upstart.
158+ + d/control: Drop dovecot-postfix package as its no longer required.
159+ + Drop build dependency on libstemmer-dev (universe).
160+
161+ -- Matthias Klose <doko@ubuntu.com> Mon, 21 Mar 2016 19:44:11 +0100
162+
163 dovecot (1:2.2.22-1) unstable; urgency=medium
164
165 [ Jaldhar H. Vyas ]
166@@ -75,6 +171,40 @@ dovecot (1:2.2.19-1) UNRELEASED; urgency=medium
167
168 -- Jaldhar H. Vyas <jaldhar@debian.org> Sun, 13 Dec 2015 09:41:56 -0500
169
170+dovecot (1:2.2.18-2ubuntu2) wily; urgency=medium
171+
172+ * Merge with Debian (after 552 days); remaining changes:
173+ + Add mail-stack-delivery package:
174+ - Update d/rules
175+ - d/control: convert existing dovecot-postfix package to a dummy
176+ package and add new mail-stack-delivery package.
177+ - Update maintainer scripts.
178+ - Rename d/dovecot-postfix.* to debian/mail-stack-delivery.*
179+ - d/mail-stack-delivery.preinst: Move previously installed backups and
180+ config files to a new package namespace.
181+ - d/mail-stack-delivery.prerm: Added to handle downgrades.
182+ + Use Snakeoil SSL certificates by default:
183+ - d/control: Depend on ssl-cert.
184+ + Add autopkgtest to debian/tests/*.
185+ + Add ufw integration:
186+ - d/dovecot-core.ufw.profile: new ufw profile.
187+ - d/rules: install profile in dovecot-core.
188+ - d/control: dovecot-core - suggest ufw.
189+ + d/dovecot-core.dirs: Added usr/share/doc/dovecot-core
190+ + Add apport hook:
191+ - d/rules, d/source_dovecot.py
192+ + Add upstart job:
193+ - d/rules, d/dovecot-core.dovecot.upstart, d/control,
194+ d/dovecot-core.dirs, dovecot-imapd.{postrm, postinst, prerm},
195+ d/dovecot-pop3d.{postinst, postrm, prerm}.
196+ d/mail-stack-deliver.postinst: Convert init script to upstart.
197+ + d/control: Drop dovecot-postfix package as its no longer required.
198+ + Rename init.d script to work with the dh_installinit --name option, so
199+ that it comes back.
200+ * Drop build dependency on libstemmer-dev (universe).
201+
202+ -- Matthias Klose <doko@ubuntu.com> Mon, 14 Sep 2015 13:58:42 +0200
203+
204 dovecot (1:2.2.18-2) unstable; urgency=high
205
206 * [3f3bf71] Updated pigeonhole patch to 0.4.8 (Closes: #792669)
207@@ -256,6 +386,76 @@ dovecot (1:2.2.10-1) unstable; urgency=low
208
209 -- Jaldhar H. Vyas <jaldhar@debian.org> Thu, 06 Mar 2014 02:51:34 -0500
210
211+dovecot (1:2.2.9-1ubuntu5) utopic; urgency=medium
212+
213+ * No-change rebuild against current debhelper to drop unnecessary upstart
214+ dependency. (LP: #1351306)
215+
216+ -- Martin Pitt <martin.pitt@ubuntu.com> Wed, 03 Sep 2014 09:50:41 +0200
217+
218+dovecot (1:2.2.9-1ubuntu4) utopic; urgency=medium
219+
220+ * Rename init.d script to work with the dh_installinit --name option, so
221+ that it comes back. (LP: #1323274)
222+
223+ -- Martin Pitt <martin.pitt@ubuntu.com> Mon, 26 May 2014 14:24:43 +0200
224+
225+dovecot (1:2.2.9-1ubuntu3) utopic; urgency=medium
226+
227+ * SECURITY UPDATE: denial of service via SSL connection exhaustion
228+ - debian/patches/CVE-2014-3430.patch: properly close connections in
229+ src/login-common/client-common.c,
230+ src/login-common/ssl-proxy-openssl.c,
231+ src/login-common/ssl-proxy.h.
232+ - CVE-2014-3430
233+
234+ -- Marc Deslauriers <marc.deslauriers@ubuntu.com> Thu, 15 May 2014 10:19:29 -0400
235+
236+dovecot (1:2.2.9-1ubuntu2) trusty; urgency=medium
237+
238+ * d/dovecot-core.config: Drop db_input for ssl-cert-exists; this message
239+ not actually an error, is documented in the README.Debian, and blocks
240+ automated upgrades (LP: #1278897).
241+
242+ -- James Page <james.page@ubuntu.com> Fri, 07 Mar 2014 12:42:58 +0000
243+
244+dovecot (1:2.2.9-1ubuntu1) trusty; urgency=medium
245+
246+ * Merge from Debian unstable, remaining changes:
247+ + Add mail-stack-delivery package:
248+ - Update d/rules
249+ - d/control: convert existing dovecot-postfix package to a dummy
250+ package and add new mail-stack-delivery package.
251+ - Update maintainer scripts.
252+ - Rename d/dovecot-postfix.* to debian/mail-stack-delivery.*
253+ - d/mail-stack-delivery.preinst: Move previously installed backups and
254+ config files to a new package namespace.
255+ - d/mail-stack-delivery.prerm: Added to handle downgrades.
256+ + Use Snakeoil SSL certificates by default:
257+ - d/control: Depend on ssl-cert.
258+ - d/dovecot-core.postinst: Relax grep for SSL_* a bit.
259+ + Add autopkgtest to debian/tests/*.
260+ + Add ufw integration:
261+ - d/dovecot-core.ufw.profile: new ufw profile.
262+ - d/rules: install profile in dovecot-core.
263+ - d/control: dovecot-core - suggest ufw.
264+ + d/dovecot-core.dirs: Added usr/share/doc/dovecot-core
265+ + Add apport hook:
266+ - d/rules, d/source_dovecot.py
267+ + Add upstart job:
268+ - d/rules, d/dovecot-core.dovecot.upstart, d/control,
269+ d/dovecot-core.dirs, dovecot-imapd.{postrm, postinst, prerm},
270+ d/dovecot-pop3d.{postinst, postrm, prerm}.
271+ d/mail-stack-deliver.postinst: Convert init script to upstart.
272+ + Use the autotools-dev dh addon to update config.guess/config.sub for
273+ arm64.
274+ * Dropped changes, included in Debian:
275+ - Update Dovecot name to reflect distribution in login greeting.
276+ - Update Drac plugin for >= 2.0.0 support.
277+ * d/control: Drop dovecot-postfix package as its no longer required.
278+
279+ -- James Page <james.page@ubuntu.com> Wed, 08 Jan 2014 09:35:49 +0000
280+
281 dovecot (1:2.2.9-1) unstable; urgency=low
282
283 [ Jaldhar H. Vyas ]
284@@ -337,6 +537,78 @@ dovecot (1:2.1.7-8) experimental; urgency=low
285
286 -- Jaldhar H. Vyas <jaldhar@debian.org> Thu, 13 Jun 2013 16:14:21 -0400
287
288+dovecot (1:2.1.7-7ubuntu3) saucy; urgency=low
289+
290+ * Use the autotools-dev dh addon to update config.guess/config.sub for
291+ arm64.
292+
293+ -- Colin Watson <cjwatson@ubuntu.com> Thu, 10 Oct 2013 11:55:27 +0100
294+
295+dovecot (1:2.1.7-7ubuntu2) saucy; urgency=low
296+
297+ * debian/patches/dovecot_name.patch: updated Dovecot name to reflect
298+ distribution in login greeting
299+ * debian/control: added lsb-release as build-dependency
300+ * debian/rules: added autoconf in config-stamp
301+
302+ -- Yolanda Robla <yolanda.robla@canonical.com> Wed, 26 Jun 2013 08:34:42 +0200
303+
304+dovecot (1:2.1.7-7ubuntu1) raring; urgency=low
305+
306+ [ James Page ]
307+ * Merge from Debian unstable (LP: #1117613, #1075456), remaining changes:
308+ + Add mail-stack-delivery package:
309+ - Update d/rules
310+ - d/control: convert existing dovecot-postfix package to a dummy
311+ package and add new mail-stack-delivery package.
312+ - Update maintainer scripts.
313+ - Rename d/dovecot-postfix.* to debian/mail-stack-delivery.*
314+ - d/mail-stack-delivery.preinst: Move previously installed backups and
315+ config files to a new package namespace.
316+ - d/mail-stack-delivery.prerm: Added to handle downgrades.
317+ + Use Snakeoil SSL certificates by default:
318+ - d/control: Depend on ssl-cert.
319+ - d/dovecot-core.postinst: Relax grep for SSL_* a bit.
320+ + Add autopkgtest to debian/tests/*.
321+ + Add ufw integration:
322+ - d/dovecot-core.ufw.profile: new ufw profile.
323+ - d/rules: install profile in dovecot-core.
324+ - d/control: dovecot-core - suggest ufw.
325+ + d/dovecot-core.dirs: Added usr/share/doc/dovecot-core
326+ + Add apport hook:
327+ - d/rules, d/source_dovecot.py
328+ + Add upstart job:
329+ - d/rules, d/dovecot-core.dovecot.upstart, d/control,
330+ d/dovecot-core.dirs, dovecot-imapd.{postrm, postinst, prerm},
331+ d/dovecot-pop3d.{postinst, postrm, prerm}.
332+ d/mail-stack-deliver.postinst: Convert init script to upstart.
333+ + d/control: Added Pre-Depends: dpkg (>= 1.15.6) to dovecot-dbg to support
334+ xz compression in Ubuntu.
335+ + d/control: Demote dovecot-common Recommends: to Suggests: to prevent
336+ install of extra packages on upgrade.
337+ + d/patches/dovecot-drac.patch: Updated with version for dovecot >= 2.0.0.
338+ * Dropped changes, included in Debian:
339+ + d/{control,rules}: enable PIE hardening.
340+ + d/control: Drop B-D on systemd.
341+ * d/p/mail-stack-delivery.postinst: Updated to ensure that configured SSL
342+ cert and key locations are used when configuring postfix, sorted out
343+ formatting.
344+ * d/p/dovecot-core.postinst: Create compat links to old style, existing
345+ SSL cert and key if found.
346+ * d/rules: Don't pass hardening flags for DRAC plugin.
347+ * d/dovecot-{pop3d,imapd}.prerm: Re-sync with Debian.
348+ * d/dovecot-core.lintian-overrides: Drop override for DRAC plugin as not
349+ required in Ubuntu.
350+ * d/01-mail-stack-delivery: Renamed 99-mail-stack-delivery to ensure that
351+ the mail-stack-delivery configuration overrides configuration options
352+ set elsewhere, updated with new cert/key file locations.
353+
354+ [ Ante Karamatic ]
355+ * Change configuration file for LDA on new installs and upgrades
356+ (LP: #671065).
357+
358+ -- James Page <james.page@ubuntu.com> Mon, 11 Feb 2013 12:41:24 +0000
359+
360 dovecot (1:2.1.7-7) unstable; urgency=high
361
362 * If you are upgrading from stable or earlier versions of this package
363@@ -432,6 +704,53 @@ dovecot (1:2.1.7-2) unstable; urgency=low
364
365 -- Jaldhar H. Vyas <jaldhar@debian.org> Thu, 21 Jun 2012 23:54:47 -0400
366
367+dovecot (1:2.1.7-1ubuntu2) quantal; urgency=low
368+
369+ * d/dovecot-core.dovecot.upstart: Respawn to handle unexpected but
370+ recoverable problems. (LP: #718188)
371+
372+ -- Clint Byrum <clint@ubuntu.com> Thu, 09 Aug 2012 12:22:52 -0700
373+
374+dovecot (1:2.1.7-1ubuntu1) quantal; urgency=low
375+
376+ * Merge from Debian unstable, remaining changes:
377+ + Add mail-stack-delivery package:
378+ - Update d/rules
379+ - d/control: convert existing dovecot-postfix package to a dummy
380+ package and add new mail-stack-delivery package.
381+ - Update maintainer scripts.
382+ - Rename d/dovecot-postfix.* to debian/mail-stack-delivery.*
383+ - d/mail-stack-delivery.preinst: Move previously installed backups and
384+ config files to a new package namespace.
385+ - d/mail-stack-delivery.prerm: Added to handle downgrades.
386+ + Use Snakeoil SSL certificates by default:
387+ - d/control: Depend on ssl-cert.
388+ - d/dovecot-core.postinst: Relax grep for SSL_* a bit.
389+ + Add autopkgtest to debian/tests/*.
390+ + Add ufw integration:
391+ - d/dovecot-core.ufw.profile: new ufw profile.
392+ - d/rules: install profile in dovecot-core.
393+ - d/control: dovecot-core - suggest ufw.
394+ + d/{control,rules}: enable PIE hardening.
395+ + d/dovecot-core.dirs: Added usr/share/doc/dovecot-core
396+ + Add apport hook:
397+ - d/rules, d/source_dovecot.py
398+ + Add upstart job:
399+ - d/rules, d/dovecot-core.dovecot.upstart, d/control,
400+ d/dovecot-core.dirs, dovecot-imapd.{postrm, postinst, prerm},
401+ d/dovecot-pop3d.{postinst, postrm, prerm}.
402+ d/mail-stack-deliver.postinst: Convert init script to upstart.
403+ + d/control: Added Pre-Depends: dpkg (>= 1.15.6) to dovecot-dbg to support
404+ xz compression in Ubuntu.
405+ + d/control: Demote dovecot-common Recommends: to Suggests: to prevent
406+ install of extra packages on upgrade.
407+ + d/patches/dovecot-drac.patch: Updated with version for dovecot >= 2.0.0.
408+ + d/control: Drop B-D on systemd.
409+ * Dropped changes:
410+ + d/patches/fix-racey-restart.patch: part of 2.1.x, no longer required.
411+
412+ -- James Page <james.page@ubuntu.com> Mon, 11 Jun 2012 11:11:54 +0100
413+
414 dovecot (1:2.1.7-1) unstable; urgency=low
415
416 * [7668742] Imported upstream 2.1.7 (Closes: #663243)
417@@ -470,6 +789,49 @@ dovecot (1:2.1.1-1) experimental; urgency=low
418
419 -- Micah Anderson <micah@debian.org> Tue, 13 Mar 2012 23:08:06 -0400
420
421+dovecot (1:2.0.19-0ubuntu1) precise; urgency=low
422+
423+ * New upstream release (LP: #970782).
424+ * Merge from Debian testing, remaining changes:
425+ + Add mail-stack-delivery package:
426+ - Update d/rules
427+ - d/control: convert existing dovecot-postfix package to a dummy
428+ package and add new mail-stack-delivery package.
429+ - Update maintainer scripts.
430+ - Rename d/dovecot-postfix.* to debian/mail-stack-delivery.*
431+ - d/mail-stack-delivery.preinst: Move previously installed backups and
432+ config files to a new package namespace.
433+ - d/mail-stack-delivery.prerm: Added to handle downgrades.
434+ + Use Snakeoil SSL certificates by default:
435+ - d/control: Depend on ssl-cert.
436+ - d/dovecot-core.postinst: Relax grep for SSL_* a bit.
437+ + Add autopkgtest to debian/tests/*.
438+ + Add ufw integration:
439+ - d/dovecot-core.ufw.profile: new ufw profile.
440+ - d/rules: install profile in dovecot-core.
441+ - d/control: dovecot-core - suggest ufw.
442+ + d/{control,rules}: enable PIE hardening.
443+ + d/dovecot-core.dirs: Added usr/share/doc/dovecot-core
444+ + Add apport hook:
445+ - d/rules, d/source_dovecot.py
446+ + Add upstart job:
447+ - d/rules, d/dovecot-core.dovecot.upstart, d/control,
448+ d/dovecot-core.dirs, dovecot-imapd.{postrm, postinst, prerm},
449+ d/dovecot-pop3d.{postinst, postrm, prerm}.
450+ d/mail-stack-deliver.postinst:
451+ Convert init script to upstart.
452+ + d/patches/fix-racey-restart.patch: Backported patch from current
453+ development release which ensures all child processes terminate prior
454+ to the main dovecot process.
455+ + debian/patches/CVE-2011-4318.patch: Dropped - applied upstream
456+ + d/control: Added Pre-Depends: dpkg (>= 1.15.6) to dovecot-dbg to support
457+ xz compression in Ubuntu.
458+ + d/control: Demote dovecot-common Recommends: to Suggests: to prevent
459+ install of extra packages on upgrade.
460+ * d/patches/dovecot-drac.patch: Updated with version for dovecot >= 2.0.0.
461+
462+ -- James Page <james.page@ubuntu.com> Wed, 04 Apr 2012 14:56:38 +0100
463+
464 dovecot (1:2.0.18-1) unstable; urgency=low
465
466 * [85ae320] Imported Upstream version 2.0.18
467@@ -483,6 +845,78 @@ dovecot (1:2.0.18-1) unstable; urgency=low
468
469 -- Jaldhar H. Vyas <jaldhar@debian.org> Fri, 09 Mar 2012 00:55:13 -0500
470
471+dovecot (1:2.0.15-1ubuntu5) precise; urgency=low
472+
473+ * SECURITY UPDATE: Incorrect cert Common Name verification when proxying
474+ - debian/patches/CVE-2011-4318.patch: correctly validate Common Name
475+ when a hostname is specified in src/login-common/{login-proxy.c,
476+ ssl-proxy.*,ssl-proxy-openssl.c}.
477+ - CVE-2011-4318
478+
479+ -- Marc Deslauriers <marc.deslauriers@ubuntu.com> Thu, 08 Dec 2011 14:34:36 -0500
480+
481+dovecot (1:2.0.15-1ubuntu4) precise; urgency=low
482+
483+ * No-change rebuild to drop spurious libsfgcc1 dependency on armhf.
484+
485+ -- Adam Conrad <adconrad@ubuntu.com> Fri, 02 Dec 2011 17:39:55 -0700
486+
487+dovecot (1:2.0.15-1ubuntu3) precise; urgency=low
488+
489+ * Rebuild for libmysqlclient transition.
490+
491+ -- Clint Byrum <clint@ubuntu.com> Wed, 23 Nov 2011 16:38:01 -0800
492+
493+dovecot (1:2.0.15-1ubuntu2) precise; urgency=low
494+
495+ * Resolve issue with intermittent restart failures (LP: #873390):
496+ - d/patches/fix-racey-restart.patch: Backported patch from current
497+ development release which ensures all child processes terminate prior
498+ to the main dovecot process.
499+
500+ -- James Page <james.page@ubuntu.com> Fri, 11 Nov 2011 14:38:41 +0000
501+
502+dovecot (1:2.0.15-1ubuntu1) precise; urgency=low
503+
504+ * Merge from Debian Testing, remaining changes:
505+ + Add mail-stack-delivery package:
506+ - Update d/rules
507+ - d/control: convert existing dovecot-postfix package to a dummy
508+ package and add new mail-stack-delivery package.
509+ - Update maintainer scripts.
510+ - Rename d/dovecot-postfix.* to debian/mail-stack-delivery.*
511+ - d/mail-stack-delivery.preinst: Move previously installed backups and
512+ config files to a new package namespace.
513+ - d/mail-stack-delivery.prerm: Added to handle downgrades.
514+ + Use Snakeoil SSL certificates by default:
515+ - d/control: Depend on ssl-cert.
516+ - d/dovecot-core.postinst: Relax grep for SSL_* a bit.
517+ + Add autopkgtest to debian/tests/*.
518+ + Add ufw integration:
519+ - d/dovecot-core.ufw.profile: new ufw profile.
520+ - d/rules: install profile in dovecot-core.
521+ - d/control: dovecot-core - suggest ufw.
522+ + d/{control,rules}: enable PIE hardening.
523+ + d/dovecot-core.dirs: Added usr/share/doc/dovecot-core
524+ + Add apport hook:
525+ - d/rules, d/source_dovecot.py
526+ + Add upstart job:
527+ - d/rules, d/dovecot-core.dovecot.upstart, d/control,
528+ d/dovecot-core.dirs, dovecot-imapd.{postrm, postinst, prerm},
529+ d/dovecot-pop3d.{postinst, postrm, prerm}.
530+ d/mail-stack-deliver.postinst:
531+ Convert init script to upstart.
532+ * d/01-mail-stack-delivery.conf: Add postfix->dovecot auth listener
533+ to mail-stack-delivery configuration (LP: #874135).
534+ * d/mail-stack-delivery.{postinst,postrm}: Restart dovecot to pickup/drop
535+ mail-stack-delivery configuration (LP: #870244).
536+ * d/control: Added Pre-Depends: dpkg (>= 1.15.6) to dovecot-dbg to support
537+ xz compression in Ubuntu.
538+ * d/control: Demote dovecot-common Recommends: to Suggests: to prevent
539+ install of extra packages on upgrade.
540+
541+ -- James Page <james.page@ubuntu.com> Wed, 19 Oct 2011 15:54:40 +0100
542+
543 dovecot (1:2.0.15-1) unstable; urgency=low
544
545 * [a22575a] New upstream version 2.0.15: (Closes: #642045)
546@@ -577,6 +1011,60 @@ dovecot (1:2.0.13-1.1) unstable; urgency=low
547
548 -- Luk Claes <luk@debian.org> Sat, 18 Jun 2011 12:31:28 +0200
549
550+dovecot (1:2.0.13-1ubuntu3) oneiric; urgency=medium
551+
552+ [ Ben Howard ]
553+ * debian/dovecot-common.dovecot.upstart: changed start to runlevel [2345]
554+ (LP: #820685)
555+
556+ [ James Page ]
557+ * Make mail-stack-delivery work with new version of dovecot (LP: #860336):
558+ - debian/control: Added dovecot-managesieved to mail-stack-delivery Depends.
559+ - debian/01-mail-stack-delivery.conf: Renamed mangesieve protocol -> sieve.
560+ Tidied up obsolete and changed configuration stanzas.
561+ - debian/mail-stack-delivery.postinst: drop -n flag from dovecot deliver
562+ command in postfix configuration.
563+
564+ -- Ben Howard <ben.howard@canonical.com> Mon, 19 Sep 2011 14:44:56 -0600
565+
566+dovecot (1:2.0.13-1ubuntu2) oneiric; urgency=low
567+
568+ * debian/dovecot-common.postinst: fix ssl cert typos that prevent
569+ certs from being generated (LP: #792557)
570+
571+ -- Steve Beattie <sbeattie@ubuntu.com> Fri, 03 Jun 2011 14:02:53 -0700
572+
573+dovecot (1:2.0.13-1ubuntu1) oneiric; urgency=low
574+
575+ * Merge from Debian Unstable, remaining changes:
576+ + Add mail-stack-delivery as per server-maverick-mail-integration spec:
577+ - Update debian/rules
578+ - Convert existing package to a dummy package and new binary in debian/control.
579+ - Update maintainer scripts.
580+ - Move previously installed backups and config files to a new package namespace in preinst.
581+ - Add new debian/mail-stack-delivery.prerm to handle downgrades.
582+ - Rename debian/dovecot-postfix.* to debian/mail-stack-delivery.*
583+ + Use Snakeoil SSL certifications by default:
584+ - debian/control: Depend on ssl-cert.
585+ - debian/dovecot-common.postinst: Relax grep for SSL_* a bit.
586+ + Add autopkgtest to debian/tests/*.
587+ + Add ufw integration:
588+ - Create debian/dovecot-common.ufw.profile.
589+ - debian/rules: install profile
590+ - debian/control: suggest ufw.
591+ + debian/{control,rules}: enable PIE hardening.
592+ + debian/dovecot-common.dirs: Added usr/share/doc/dovecot-common
593+ + Add apport hook:
594+ - debian/rules, debian/source_dovecot.py
595+ + Add upstart job:
596+ - debian/rules, debian/dovecot-common.dovecot.upstart, debian/control,
597+ debian/dovecot-common.dirs, dovecot-imapd.{postrm, postinst, prerm},
598+ debian/dovecot-pop3d.{postinst, postrm, prerm}. mail-stack-deliver.postinst:
599+ Convert init script to upstart. Apart of the server-maverick-upstart-conversion
600+ specification.
601+
602+ -- Chuck Short <zulcss@ubuntu.com> Wed, 01 Jun 2011 13:32:07 -0400
603+
604 dovecot (1:2.0.13-1) unstable; urgency=high
605
606 [ Marco Nenciarini ]
607@@ -601,6 +1089,37 @@ dovecot (1:2.0.13-1) unstable; urgency=high
608
609 -- Marco Nenciarini <mnencia@debian.org> Sat, 21 May 2011 23:58:06 +0200
610
611+dovecot (1:2.0.12-1ubuntu1) oneiric; urgency=low
612+
613+ * Merge from Debian Unstable, remaining changes are:
614+ + Add mail-stack-delivery as per server-maverick-mail-integration spec:
615+ - Update debian/rules
616+ - Convert existing package to a dummy package and new binary in debian/control.
617+ - Update maintainer scripts.
618+ - Move previously installed backups and config files to a new package namespace in preinst.
619+ - Add new debian/mail-stack-delivery.prerm to handle downgrades.
620+ - Rename debian/dovecot-postfix.* to debian/mail-stack-delivery.*
621+ + Use Snakeoil SSL certifications by default:
622+ - debian/control: Depend on ssl-cert.
623+ - debian/dovecot-common.postinst: Relax grep for SSL_* a bit.
624+ + Add autopkgtest to debian/tests/*.
625+ + Add ufw integration:
626+ - Create debian/dovecot-common.ufw.profile.
627+ - debian/rules: install profile
628+ - debian/control: suggest ufw.
629+ + debian/{control,rules}: enable PIE hardening.
630+ + debian/dovecot-common.dirs: Added usr/share/doc/dovecot-common
631+ + Add apport hook:
632+ - debian/rules, debian/source_dovecot.py
633+ + Add upstart job:
634+ - debian/rules, debian/dovecot-common.dovecot.upstart, debian/control,
635+ debian/dovecot-common.dirs, dovecot-imapd.{postrm, postinst, prerm},
636+ debian/dovecot-pop3d.{postinst, postrm, prerm}. mail-stack-deliver.postinst:
637+ Convert init script to upstart. Apart of the server-maverick-upstart-conversion
638+ specification.
639+
640+ -- Chuck Short <zulcss@ubuntu.com> Mon, 16 May 2011 10:18:41 -0400
641+
642 dovecot (1:2.0.12-1) unstable; urgency=low
643
644 [ Jaldhar H. Vyas ]
645diff --git a/debian/control b/debian/control
646index f361853..8b4a42b 100644
647--- a/debian/control
648+++ b/debian/control
649@@ -1,7 +1,8 @@
650 Source: dovecot
651 Section: mail
652 Priority: optional
653-Maintainer: Dovecot Maintainers <jaldhar-dovecot@debian.org>
654+Maintainer: Ubuntu Developers <ubuntu-devel-discuss@lists.ubuntu.com>
655+XSBC-Original-Maintainer: Dovecot Maintainers <jaldhar-dovecot@debian.org>
656 Uploaders: Jaldhar H. Vyas <jaldhar@debian.org>, Fabio Tranchitella <kobold@debian.org>, Joel Johnson <mrjoel@lixil.net>, Marco Nenciarini <mnencia@debian.org>, Jelmer Vernooij <jelmer@debian.org>, Apollon Oikonomopoulos <apoikos@debian.org>
657 Build-Depends: debhelper (>= 9),
658 dpkg-dev (>= 1.16.1),
659@@ -23,11 +24,9 @@ Build-Depends: debhelper (>= 9),
660 libwrap0-dev,
661 dh-systemd,
662 lsb-release,
663- libclucene-dev (>= 2.3),
664 liblzma-dev,
665 liblz4-dev,
666 libexttextcat-dev,
667- libstemmer-dev,
668 autotools-dev,
669 dh-exec
670 Standards-Version: 3.9.7
671@@ -37,11 +36,13 @@ Vcs-Browser: https://anonscm.debian.org/gitweb/?p=collab-maint/dovecot.git
672
673 Package: dovecot-core
674 Architecture: any
675-Depends: ${shlibs:Depends}, ${misc:Depends}, libpam-runtime (>= 0.76-13.1), openssl, adduser, ucf (>= 2.0020)
676-Suggests: ntp, dovecot-gssapi, dovecot-sieve, dovecot-pgsql, dovecot-mysql, dovecot-sqlite, dovecot-ldap, dovecot-imapd, dovecot-pop3d, dovecot-lmtpd, dovecot-managesieved, dovecot-solr, dovecot-lucene
677+Depends: ${shlibs:Depends}, ${misc:Depends}, libpam-runtime (>= 0.76-13.1), openssl, adduser, ucf (>= 2.0020), ssl-cert, lsb-base
678+Suggests: ntp, dovecot-gssapi, dovecot-sieve, dovecot-pgsql, dovecot-mysql, dovecot-sqlite, dovecot-ldap, dovecot-imapd, dovecot-pop3d, dovecot-lmtpd, dovecot-managesieved, dovecot-solr, ufw
679 Provides: dovecot-common, dovecot-abi-${dovecot:ABI-Version}
680-Replaces: dovecot-common (<< 1:2.0.14-2~), mailavenger (<< 0.8.1-4)
681-Breaks: dovecot-common (<< 1:2.0.14-2~), mailavenger (<< 0.8.1-4)
682+Replaces: dovecot-common (<< 1:2.0.14-2~), mailavenger (<< 0.8.1-4),
683+ dovecot-lucene (<<1:2.2.24~)
684+Breaks: dovecot-common (<< 1:2.0.14-2~), mailavenger (<< 0.8.1-4),
685+ dovecot-lucene (<<1:2.2.24~)
686 Description: secure POP3/IMAP server - core files
687 Dovecot is a mail server whose major goals are security and extreme
688 reliability. It tries very hard to handle all error conditions and verify
689@@ -206,18 +207,6 @@ Description: secure POP3/IMAP server - Solr support
690 .
691 This package provides Solr full text search support for Dovecot.
692
693-Package: dovecot-lucene
694-Architecture: any
695-Depends: ${shlibs:Depends}, ${misc:Depends}, dovecot-core (= ${binary:Version})
696-Description: secure POP3/IMAP server - Lucene support
697- Dovecot is a mail server whose major goals are security and extreme
698- reliability. It tries very hard to handle all error conditions and verify
699- that all data is valid, making it nearly impossible to crash. It supports
700- mbox/Maildir and its own dbox/mdbox formats, and should also be pretty
701- fast, extensible, and portable.
702- .
703- This package provides Lucene full text search support for Dovecot.
704-
705 Package: dovecot-dbg
706 Section: debug
707 Priority: extra
708@@ -231,3 +220,18 @@ Description: secure POP3/IMAP server - debug symbols
709 fast, extensible, and portable.
710 .
711 This package contains debug symbols for Dovecot.
712+
713+Package: mail-stack-delivery
714+Architecture: all
715+Depends: dovecot-core, dovecot-imapd, dovecot-pop3d, dovecot-managesieved,
716+ postfix, ${misc:Depends}
717+Replaces: dovecot-postfix (<< 1:1.2.12-0ubuntu1~)
718+Description: mail server delivery agent stack provided by Ubuntu server team
719+ Ubuntu's mail stack provides fully operational delivery with
720+ safe defaults and additional options. Out of the box it supports IMAP,
721+ POP3 and SMTP services with SASL authentication and Maildir as default
722+ storage engine.
723+ .
724+ This package contains configuration files for dovecot.
725+ .
726+ This package modifies postfix's configuration to integrate with dovecot
727diff --git a/debian/dovecot-core.dirs b/debian/dovecot-core.dirs
728index a04bea3..211a634 100644
729--- a/debian/dovecot-core.dirs
730+++ b/debian/dovecot-core.dirs
731@@ -1,5 +1,7 @@
732 etc/dovecot/conf.d
733 etc/dovecot/private
734+etc/ssl/certs
735+etc/ufw/applications.d
736 usr/sbin
737 usr/share/dovecot/protocols.d
738 var/lib/dovecot
739diff --git a/debian/dovecot-core.lintian-overrides b/debian/dovecot-core.lintian-overrides
740index 2280c54..c53492a 100644
741--- a/debian/dovecot-core.lintian-overrides
742+++ b/debian/dovecot-core.lintian-overrides
743@@ -7,7 +7,6 @@ dovecot-core: hardening-no-fortify-functions usr/lib/dovecot/gdbhelper
744 dovecot-core: hardening-no-fortify-functions usr/lib/dovecot/libdovecot-login.so.0.0.0
745 dovecot-core: hardening-no-fortify-functions usr/lib/dovecot/libdovecot-sql.so.0.0.0
746 dovecot-core: hardening-no-fortify-functions usr/lib/dovecot/modules/auth/libauthdb_imap.so
747-dovecot-core: hardening-no-relro usr/lib/dovecot/modules/drac.so
748 dovecot-core: hardening-no-fortify-functions usr/lib/dovecot/modules/lib05_pop3_migration_plugin.so
749 dovecot-core: hardening-no-fortify-functions usr/lib/dovecot/modules/lib10_quota_plugin.so
750 dovecot-core: hardening-no-fortify-functions usr/lib/dovecot/modules/lib11_trash_plugin.so
751diff --git a/debian/dovecot-core.maintscript b/debian/dovecot-core.maintscript
752new file mode 100644
753index 0000000..274820e
754--- /dev/null
755+++ b/debian/dovecot-core.maintscript
756@@ -0,0 +1 @@
757+rm_conffile /etc/init/dovecot.conf 1:2.2.22-1ubuntu4
758diff --git a/debian/dovecot-core.ufw.profile b/debian/dovecot-core.ufw.profile
759new file mode 100644
760index 0000000..8d70761
761--- /dev/null
762+++ b/debian/dovecot-core.ufw.profile
763@@ -0,0 +1,23 @@
764+[Dovecot POP3]
765+title=Secure mail server (POP3)
766+description=Dovecot is a mail server whose major goals are security and extreme
767+ reliability.
768+ports=110/tcp
769+
770+[Dovecot Secure POP3]
771+title=Secure mail server (POP3S)
772+description=Dovecot is a mail server whose major goals are security and extreme
773+ reliability.
774+ports=995/tcp
775+
776+[Dovecot IMAP]
777+title=Secure mail server (IMAP)
778+description=Dovecot is a mail server whose major goals are security and extreme
779+ reliability.
780+ports=143/tcp
781+
782+[Dovecot Secure IMAP]
783+title=Secure mail server (IMAPS)
784+description=Dovecot is a mail server whose major goals are security and extreme
785+ reliability.
786+ports=993/tcp
787diff --git a/debian/mail-stack-delivery.README.Debian b/debian/mail-stack-delivery.README.Debian
788new file mode 100644
789index 0000000..c48decd
790--- /dev/null
791+++ b/debian/mail-stack-delivery.README.Debian
792@@ -0,0 +1,24 @@
793+Introduction
794+-------------------
795+
796+Mail-stack-delivery will not install any binary or library files. This package
797+contains only configuration file /etc/dovecot/mail-stack-delivery.conf with
798+configuration prerpared by Ubuntu Server Team.
799+
800+The matching configuration for dovecot is placed in:
801+ /etc/dovecot/conf.d/99-mail-stack-delivery.conf
802+
803+During installation of package, it modifies postfix's configuration and
804+stores original version of /etc/postfix/main.cf in /var/backup/mail-stack-delivery.
805+
806+Features of mail-stack-delivery:
807+----------------------------
808+
809+- IMAP4rev1 and POP3, including support for TLS and SSL
810+- SMTP, including support for TLS and SSL
811+- support for sieve scripting
812+- managesieve for managing sieve scripts directly on server
813+- dovecot MDA, including extensions separated with '+'
814+- Maildir storage engine
815+- SASL authentication (plain and login)
816+- support only for medium and high TLS/SSL ciphers
817diff --git a/debian/mail-stack-delivery.dirs b/debian/mail-stack-delivery.dirs
818new file mode 100644
819index 0000000..6771044
820--- /dev/null
821+++ b/debian/mail-stack-delivery.dirs
822@@ -0,0 +1,2 @@
823+var/backups
824+var/backups/mail-stack-delivery
825diff --git a/debian/mail-stack-delivery.postinst b/debian/mail-stack-delivery.postinst
826new file mode 100644
827index 0000000..ebda461
828--- /dev/null
829+++ b/debian/mail-stack-delivery.postinst
830@@ -0,0 +1,91 @@
831+#!/bin/sh
832+
833+set -e
834+
835+POSTFIX_BCKFILE="/var/backups/mail-stack-delivery/main.cf-backup"
836+
837+set_postfix_option() {
838+ opt="$1"
839+ # Backup the existion value of the option
840+ postconf $(echo ${opt} | cut -d= -f1) >> ${POSTFIX_BCKFILE} || true
841+ # Set the new value of the option
842+ postconf -e "${opt}"
843+ echo -n '.'
844+}
845+
846+if [ "$1" = "configure" ]; then
847+ # Create initial symlinks for certificates
848+ SSL_CERT=$( (grep -m 1 "ssl_cert_file" /etc/dovecot/conf.d/10-ssl.conf || echo '/etc/dovecot/dovecot.pem') | cut -d'=' -f2)
849+ SSL_KEY=$( (grep -m 1 "ssl_key_file" /etc/dovecot/conf.d/10-ssl.conf || echo '/etc/dovecot/private/dovecot.pem') | cut -d'=' -f2)
850+
851+ if [ ! -e "${SSL_KEY}" ]; then
852+ ln -s /etc/ssl/private/ssl-cert-snakeoil.key ${SSL_KEY}
853+ fi
854+ if [ ! -e "${SSL_CERT}" ]; then
855+ ln -s /etc/ssl/certs/ssl-cert-snakeoil.pem ${SSL_CERT}
856+ fi
857+ # Configure postfix either on new install
858+ # or if the postfix backup file is no longer there
859+ # (only deleted when the pkg is removed)
860+ if [ -f "/etc/postfix/main.cf" ]; then
861+ if [ -e "$POSTFIX_BCKFILE" ]; then
862+ cp $POSTFIX_BCKFILE ${POSTFIX_BCKFILE}-$(date +%Y%m%d%H%M)
863+ fi
864+ if [ -z "$2" -o ! -e "$POSTFIX_BCKFILE" ]; then
865+ if which postconf >/dev/null; then
866+ # Setup postfix
867+ echo 'Mail stack delivery changes some postfix settings.'
868+ echo 'Old values are stored in '$POSTFIX_BCKFILE'.'
869+ echo 'Feel free to revert any of them when the process is done.'
870+ echo -n 'Configuring postfix for mail-stack-delivery integration: '
871+ set_postfix_option "home_mailbox = Maildir/"
872+ set_postfix_option "smtpd_sasl_auth_enable = yes"
873+ set_postfix_option "smtpd_sasl_type = dovecot"
874+ set_postfix_option "smtpd_sasl_path = private/dovecot-auth"
875+ set_postfix_option "smtpd_sasl_authenticated_header = yes"
876+ set_postfix_option "smtpd_sasl_security_options = noanonymous"
877+ set_postfix_option "smtpd_sasl_local_domain = \$myhostname"
878+ set_postfix_option "broken_sasl_auth_clients = yes"
879+ set_postfix_option "smtpd_recipient_restrictions = reject_unknown_sender_domain, reject_unknown_recipient_domain, reject_unauth_pipelining, permit_mynetworks, permit_sasl_authenticated, reject_unauth_destination"
880+ set_postfix_option "smtpd_sender_restrictions = reject_unknown_sender_domain"
881+ set_postfix_option "mailbox_command = /usr/lib/dovecot/deliver -c /etc/dovecot/dovecot.conf -m \"\${EXTENSION}\""
882+ set_postfix_option "smtpd_tls_cert_file = ${SSL_CERT}"
883+ set_postfix_option "smtpd_tls_key_file = ${SSL_KEY}"
884+ set_postfix_option "smtpd_use_tls = yes"
885+ set_postfix_option "smtp_use_tls = yes"
886+ set_postfix_option "smtpd_tls_received_header = yes"
887+ set_postfix_option "smtpd_tls_mandatory_protocols = SSLv3, TLSv1"
888+ set_postfix_option "smtpd_tls_mandatory_ciphers = medium"
889+ set_postfix_option "smtpd_tls_auth_only = yes"
890+ set_postfix_option "tls_random_source = dev:/dev/urandom"
891+ echo ' done.'
892+ fi
893+ fi
894+ else
895+ echo ""
896+ echo "Postfix not configured. Run"
897+ echo "sudo dpkg-reconfigure postfix and choose"
898+ echo "the type of mail server. Then run"
899+ echo "sudo dpkg-reconfigure mail-stack-delivery to"
900+ echo "finish mail-stack-delivery installation."
901+ echo ""
902+ fi
903+
904+ if [ -x "/etc/init.d/dovecot" ]; then
905+ if [ -x /usr/sbin/invoke-rc.d ]; then
906+ invoke-rc.d dovecot restart
907+ else
908+ service dovecot restart
909+ fi
910+ fi
911+ if [ -x "/etc/init.d/postfix" ]; then
912+ if [ -x /usr/sbin/invoke-rc.d ]; then
913+ invoke-rc.d postfix restart
914+ else
915+ service postfix restart
916+ fi
917+ fi
918+
919+fi
920+
921+#DEBHELPER#
922diff --git a/debian/mail-stack-delivery.postrm b/debian/mail-stack-delivery.postrm
923new file mode 100644
924index 0000000..bb3f0fb
925--- /dev/null
926+++ b/debian/mail-stack-delivery.postrm
927@@ -0,0 +1,35 @@
928+#!/bin/sh
929+set -e
930+
931+POSTFIX_BCKFILE="/var/backups/mail-stack-delivery/main.cf-backup"
932+
933+PATH=/usr/sbin:$PATH
934+export PATH
935+
936+if [ "$1" = "remove" -o "$1" = "purge" ]; then
937+ # Restore postfix configuration
938+ if [ "$1" = "remove" ]; then
939+ if which postconf >/dev/null && [ -f "${POSTFIX_BCKFILE}" ]; then
940+ while read line; do
941+ postconf -e "$line"
942+ done < "${POSTFIX_BCKFILE}"
943+ rm -f "${POSTFIX_BCKFILE}"
944+ fi
945+ fi
946+ if [ -x "/etc/init.d/dovecot" ]; then
947+ if [ -x /usr/sbin/invoke-rc.d ]; then
948+ invoke-rc.d dovecot restart
949+ else
950+ service dovecot restart
951+ fi
952+ fi
953+ if [ -x "/etc/init.d/postfix" ]; then
954+ if [ -x /usr/sbin/invoke-rc.d ]; then
955+ invoke-rc.d postfix restart
956+ else
957+ service postfix restart
958+ fi
959+ fi
960+fi
961+
962+#DEBHELPER#
963diff --git a/debian/mail-stack-delivery.preinst b/debian/mail-stack-delivery.preinst
964new file mode 100644
965index 0000000..6065fde
966--- /dev/null
967+++ b/debian/mail-stack-delivery.preinst
968@@ -0,0 +1,56 @@
969+#!/bin/sh
970+
971+set -e
972+
973+# Prepare to move a conffile without triggering a dpkg question
974+prep_mv_conffile() {
975+ PKGNAME="$1"
976+ CONFFILE="$2"
977+ if [ -e "$CONFFILE" ]; then
978+ md5sum="`md5sum \"$CONFFILE\" | sed -e \"s/ .*//\"`"
979+ old_md5sum="`dpkg-query -W -f='${Conffiles}' $PKGNAME | sed -n -e \"\\\\' $CONFFILE'{s/ obsolete$//;s/.* //p}\"`"
980+ if [ "$md5sum" = "$old_md5sum" ]; then
981+ rm -f "$CONFFILE"
982+ else
983+ if [ -e "$CONFFILE" ]; then
984+ if [ "$CONFFILE" = "/etc/dovecot/conf.d/01-dovecot-postfix.conf" ]; then
985+ mv -f "$CONFFILE" "/etc/dovecot/conf.d/01-mail-stack-delivery.conf"
986+ fi
987+ if [ "$CONFFILE" = "/etc/dovecot/auth.d/01-dovecot-postfix.auth" ]; then
988+ mv -f "$CONFFILE" "/etc/dovecot/auth.d/01-mail-stack-delivery.auth"
989+ fi
990+ fi
991+ fi
992+ fi
993+}
994+case "$1" in
995+install|upgrade)
996+ # Check if mail-stack-delivery.conf had any customizations
997+ if [ -f "/usr/share/dovecot/mail-stack-delivery.conf" ]; then
998+ if [ -f "/etc/dovecot/mail-stack-delivery.conf" ]; then
999+ mv /etc/dovecot/mail-stack-delivery.conf /etc/dovecot/mail-stack-delivery.conf.bak
1000+ DIR=`mktemp -d`
1001+ egrep -v ^protocol /etc/dovecot/mail-stack-delivery.conf.bak > $DIR/mail-stack-delivery-custom.conf
1002+ egrep -v ^protocol /usr/share/dovecot/mail-stack-delivery.conf > $DIR/mail-stack-delivery.conf
1003+ if diff -qur $DIR/mail-stack-delivery-dist.conf $DIR/mail-stack-delivery-custom.conf 1>/dev/null 2>&1; then
1004+ rm -f /etc/dovecot/mail-stack-delivery.conf.bak
1005+ else
1006+ awk ' /^auth default/ {flag=1;next} /^}/{flag=0} flag { print }' /etc/dovecot/mail-stack-delivery.conf.bak > /etc/dovecot/auth.d/01-mail-stack-delivery.auth
1007+ awk ' /^## Dovecot conf/{flag=1} /^auth default/{flag=0} flag { print }' /etc/dovecot/mail-stack-delivery.conf.bak > /etc/dovecot/conf.d/01-mail-stack-delivery.conf
1008+ awk ' /^# If you wish to use another authentication server than dovecot-auth/{flag=1} flag { print }' /etc/dovecot/mail-stack-delivery.conf.bak >> /etc/dovecot/conf.d/01-mail-stack-delivery.conf
1009+ fi
1010+ rm -rf $DIR
1011+ fi
1012+ fi
1013+ ;;
1014+
1015+ abort-upgrade)
1016+ ;;
1017+
1018+ *)
1019+ echo "preinst called with unknown argument \`$1'" >&2
1020+ exit 1
1021+ ;;
1022+esac
1023+
1024+#DEBHELPER#
1025diff --git a/debian/rules b/debian/rules
1026index a05807c..0e26497 100755
1027--- a/debian/rules
1028+++ b/debian/rules
1029@@ -57,8 +57,6 @@ sieve_files = usr/bin/sieve* \
1030
1031 solr_files = usr/lib/dovecot/modules/lib??_fts_solr_*
1032
1033-lucene_files = usr/lib/dovecot/modules/lib??_fts_lucene_*
1034-
1035 dev_files = usr/include/* \
1036 usr/lib/dovecot/dovecot-config
1037
1038@@ -77,7 +75,7 @@ override_dh_auto_configure:
1039 --with-solr \
1040 --with-ioloop=best \
1041 --with-libwrap \
1042- --with-lucene \
1043+ --without-lucene \
1044 --with-lz4 \
1045 --prefix=/usr \
1046 --sysconfdir=/etc \
1047@@ -143,6 +141,14 @@ override_dh_install:
1048 | perl -ne '/"(.+)\(.+\)"/ && print $$1' \
1049 | tr '[A-Z]' '[a-z]' > $(PKG_DIR:PKG=dev)/usr/share/dovecot/dovecot-abi
1050
1051+ install -m644 debian/dovecot-core.ufw.profile debian/dovecot-core/etc/ufw/applications.d/dovecot-core
1052+
1053+ # Install apport hook
1054+ install -D -m 644 debian/source_dovecot.py $(CURDIR)/debian/dovecot-core/usr/share/apport/package-hooks/dovecot-core.py
1055+
1056+ mkdir -p $(CURDIR)/debian/mail-stack-delivery/etc/dovecot/conf.d/
1057+ cp $(CURDIR)/debian/99-mail-stack-delivery.conf $(CURDIR)/debian/mail-stack-delivery/etc/dovecot/conf.d/
1058+
1059 override_dh_installpam:
1060 dh_installpam -pdovecot-core --name=dovecot
1061
1062diff --git a/debian/source_dovecot.py b/debian/source_dovecot.py
1063new file mode 100644
1064index 0000000..bd9958c
1065--- /dev/null
1066+++ b/debian/source_dovecot.py
1067@@ -0,0 +1,39 @@
1068+#!/usr/bin/python
1069+
1070+'''Dovecot Apport interface
1071+
1072+Copyright (C) 2010 Canonical Ltd/
1073+Author: Chuck Short <chuck.short@canonical.com>
1074+
1075+This program is free software; you can redistribute it and/or modify it
1076+under the terms of the GNU General Public License as published by the
1077+Free Software Foundation; either version 2 of the License, or (at your
1078+option) any later version. See http://www.gnu.org/copyleft/gpl.html for
1079+the full text of the license.
1080+'''
1081+
1082+from apport.hookutils import *
1083+
1084+def add_info(report, ui):
1085+ response = ui.yesno("The output of dovecot -n may help developers diagnose your bug more quickly, however, it may contain sensitive information. Do you want to include it in your bug report?")
1086+
1087+ if response == None: #user canceled
1088+ raise StopIteration
1089+
1090+ elif response == True:
1091+ report['DovecotConf'] = root_command_output(['/usr/sbin/dovecot', '-n'])
1092+
1093+
1094+ elif response == False:
1095+ ui.information("The contents of dovecot -n will NOT be includeded in the bug report")
1096+
1097+ packages=['dovecot-common', 'dovecot-core', 'dovecot-dev', 'dovecot-pop3d', 'dovecot-imapd', 'mail-stack-delivery', 'dovecot-postfix']
1098+ versions = ''
1099+ for package in packages:
1100+ try:
1101+ version = package.get_version(package)
1102+ except:
1103+ version = 'N/A'
1104+ versions += '%s %s\n' %(package, version)
1105+ report['DovecotInstalledVersions'] = versions
1106+
1107diff --git a/debian/tests/control b/debian/tests/control
1108index 70b78e4..96fd8c8 100644
1109--- a/debian/tests/control
1110+++ b/debian/tests/control
1111@@ -4,3 +4,9 @@ Restrictions: needs-root
1112
1113 Tests: systemd
1114 Depends: dovecot-core, systemd-sysv
1115+
1116+# the old Ubuntu tests
1117+Tests: general
1118+Restrictions: needs-root
1119+Features: no-build-needed
1120+Depends: python, dovecot-imapd, dovecot-pop3d, dovecot-managesieved, mail-stack-delivery
1121diff --git a/debian/tests/general b/debian/tests/general
1122new file mode 100644
1123index 0000000..ba69fbd
1124--- /dev/null
1125+++ b/debian/tests/general
1126@@ -0,0 +1,218 @@
1127+#!/usr/bin/python
1128+
1129+import unittest, subprocess, shutil, grp, os, os.path, sys, time
1130+import imaplib, poplib
1131+
1132+import testlib
1133+import testlib_dovecot
1134+
1135+class DovecotBasics(unittest.TestCase):
1136+ '''Base operational tests for Dovecot server.'''
1137+
1138+ def _setUp(self,config_mmap_disable=False):
1139+ '''Create test scenario.
1140+
1141+ dovecot is configured for all protocols (imap[s] and pop3[s]), a test
1142+ user is set up, and /var/mail/$user contains an unread and a read mail.
1143+ '''
1144+
1145+ self.user = testlib.TestUser()
1146+
1147+ config = '''
1148+protocols = imap pop3
1149+log_timestamp = "%Y-%m-%d %H:%M:%S "
1150+mail_privileged_group = mail
1151+managesieve_notify_capability = mailto
1152+managesieve_sieve_capability = fileinto reject envelope encoded-character vacation subaddress comparator-i;ascii-numeric relational regex imap4flags copy include variables body enotify environment mailbox date index ihave duplicate mime foreverypart extracttext
1153+'''
1154+ if config_mmap_disable:
1155+ config += '''
1156+mmap_disable = yes
1157+'''
1158+ config += '''
1159+ssl = yes
1160+ssl_cert = </etc/dovecot/dovecot.pem
1161+ssl_key = </etc/dovecot/private/dovecot.pem
1162+auth_mechanisms = PLAIN
1163+mail_location = mbox:~/mail:INBOX=/var/mail/%u
1164+service auth {
1165+ user = root
1166+}
1167+protocol pop3 {
1168+ pop3_uidl_format = %08Xu%08Xv
1169+}
1170+userdb {
1171+ driver = passwd
1172+}
1173+passdb {
1174+ driver = passwd-file
1175+ args = username_format=%n scheme=PLAIN /etc/dovecot/test.passwd
1176+}
1177+'''
1178+ self.dovecot = testlib_dovecot.Dovecot(self.user,config)
1179+
1180+ def tearDown(self):
1181+ self.dovecot = None
1182+ self.user = None
1183+
1184+ def _test_pop3_proto(self, pop):
1185+ '''Internal factorization of POP3 protocol checks with an established
1186+ connection.'''
1187+
1188+ # check empty password
1189+ self.assertEqual(pop.user(self.user.login), '+OK')
1190+ self.assertRaises(poplib.error_proto, pop.pass_, '')
1191+
1192+ # check wrong password
1193+ self.assertEqual(pop.user(self.user.login), '+OK')
1194+ self.assertRaises(poplib.error_proto, pop.pass_, '123')
1195+
1196+ # check correct password
1197+ self.assertEqual(pop.user(self.user.login), '+OK')
1198+ self.assertEqual(pop.pass_(self.user.password), '+OK Logged in.')
1199+
1200+ # check messages
1201+ self.assertEqual(pop.stat()[0], 2, '2 available messages')
1202+ self.assertEqual(pop.list()[1], ['1 163', '2 161'])
1203+ self.assertEqual('\n'.join(pop.retr(1)[1]), '''Date: Thu, 16 Nov 2006 17:12:23 -0800
1204+From: Test User 1 <test1@test1.com>
1205+To: Dovecot tester <dovecot@test.com>
1206+Subject: Test 1
1207+
1208+Some really important news.''')
1209+ self.assertEqual('\n'.join(pop.retr(2)[1]), '''Date: Tue, 28 Nov 2006 11:29:34 +0100
1210+From: Test User 2 <test2@test2.com>
1211+To: Dovecot tester <dovecot@test.com>
1212+Subject: Test 2
1213+
1214+More news.
1215+
1216+Get cracking!''')
1217+
1218+ self.assertEqual(pop.quit(), '+OK Logging out.')
1219+
1220+ # check new status
1221+ status = ''
1222+ for l in open(self.dovecot.get_mailbox()):
1223+ if l.startswith('Status:'):
1224+ status += l
1225+ self.assertEqual(status, 'Status: NRO\nStatus: RO\n')
1226+
1227+ def test_pop3(self):
1228+ '''Test POP3 protocol.'''
1229+
1230+ pop = poplib.POP3('localhost')
1231+ self.assertEqual(pop.getwelcome(), '+OK Dovecot ready.')
1232+
1233+ self._test_pop3_proto(pop)
1234+
1235+ def test_pop3s(self):
1236+ '''Test POP3S protocol.'''
1237+
1238+ pop = poplib.POP3_SSL('localhost')
1239+ self.assertEqual(pop.getwelcome(), '+OK Dovecot ready.')
1240+
1241+ self._test_pop3_proto(pop)
1242+
1243+ def _test_imap_proto(self, imap):
1244+ '''Internal factorization of IMAP4 protocol checks with an established
1245+ connection.'''
1246+
1247+ # invalid passwords
1248+ self.assertRaises(imaplib.IMAP4.error, imap.login, self.user.login, '')
1249+ self.assertRaises(imaplib.IMAP4.error, imap.login, self.user.login, '123')
1250+
1251+ # correct password
1252+ imap.login(self.user.login, self.user.password)
1253+
1254+ # list mailboxes
1255+ status, imlist = imap.list()
1256+ self.assertEqual(status, 'OK')
1257+ self.assert_(imlist[0].endswith('INBOX'))
1258+
1259+ # check mails
1260+ imap.select()
1261+ self.assertEqual(imap.search(None, 'ALL'), ('OK', ['1 2']))
1262+ self.assertEqual(imap.fetch('1', '(FLAGS)'),
1263+ ('OK', ['1 (FLAGS (\\Recent))']))
1264+ self.assertEqual(imap.fetch('2', '(FLAGS)'),
1265+ ('OK', ['2 (FLAGS (\\Seen \\Recent))']))
1266+ self.assertEqual(imap.fetch('1', '(BODY[TEXT])')[1][0][1],
1267+ 'Some really important news.\r\n')
1268+ self.assertEqual(imap.fetch('2', '(BODY[TEXT])')[1][0][1],
1269+ 'More news.\r\n\r\nGet cracking!')
1270+
1271+ self.assertEqual(imap.fetch('1', '(RFC822)')[1],
1272+ [('1 (RFC822 {163}',
1273+ '''Date: Thu, 16 Nov 2006 17:12:23 -0800\r
1274+From: Test User 1 <test1@test1.com>\r
1275+To: Dovecot tester <dovecot@test.com>\r
1276+Subject: Test 1\r
1277+\r
1278+Some really important news.\r
1279+'''), ')'])
1280+
1281+ # delete mail 1
1282+ self.assertEqual(imap.store('1', '+FLAGS', '\\Deleted')[0], 'OK')
1283+ self.assertEqual(imap.expunge()[0], 'OK')
1284+ self.assertEqual(imap.search(None, 'ALL'), ('OK', ['1']))
1285+
1286+ # old mail 2 is mail 1 now
1287+ self.assertEqual(imap.fetch('1', '(RFC822)')[1],
1288+ [('1 (RFC822 {161}',
1289+ '''Date: Tue, 28 Nov 2006 11:29:34 +0100\r
1290+From: Test User 2 <test2@test2.com>\r
1291+To: Dovecot tester <dovecot@test.com>\r
1292+Subject: Test 2\r
1293+\r
1294+More news.\r
1295+\r
1296+Get cracking!'''), ')'])
1297+ imap.close()
1298+ imap.logout()
1299+
1300+ def test_imap(self):
1301+ '''Test IMAP4 protocol.'''
1302+
1303+ imap = imaplib.IMAP4('localhost')
1304+ self._test_imap_proto(imap)
1305+
1306+ def test_imaps(self):
1307+ '''Test IMAP4S protocol.'''
1308+
1309+ imap = imaplib.IMAP4_SSL('localhost')
1310+ self._test_imap_proto(imap)
1311+
1312+
1313+class DovecotMmapTest(DovecotBasics):
1314+ '''Test dovecot with mmap support.'''
1315+
1316+ def setUp(self):
1317+ self._setUp()
1318+
1319+ def test_configuration(self):
1320+ '''Test dovecot configuration has mmap support.'''
1321+ self.assertEquals(subprocess.call(['/bin/grep', '-q', '^mmap_disable = yes','/etc/dovecot/dovecot.conf'], stdout=subprocess.PIPE), 1)
1322+
1323+
1324+class DovecotDirectTest(DovecotBasics):
1325+ '''Test dovecot without mmap support.'''
1326+
1327+ def setUp(self):
1328+ self._setUp(config_mmap_disable=True)
1329+
1330+ def test_configuration(self):
1331+ '''Test dovecot configuration has mmap disabled.'''
1332+ self.assertEquals(subprocess.call(['/bin/grep', '-q', '^mmap_disable = yes','/etc/dovecot/dovecot.conf'], stdout=subprocess.PIPE), 0)
1333+
1334+
1335+
1336+if __name__ == '__main__':
1337+ os.dup2(1,2)
1338+ suite = unittest.TestSuite()
1339+ suite.addTest(unittest.TestLoader().loadTestsFromTestCase(DovecotDirectTest))
1340+ suite.addTest(unittest.TestLoader().loadTestsFromTestCase(DovecotMmapTest))
1341+ result = unittest.TextTestRunner(verbosity=2).run(suite)
1342+ sys.exit(not result.wasSuccessful())
1343+
1344+#unittest.main()
1345diff --git a/debian/tests/testlib.py b/debian/tests/testlib.py
1346new file mode 100644
1347index 0000000..61f9074
1348--- /dev/null
1349+++ b/debian/tests/testlib.py
1350@@ -0,0 +1,101 @@
1351+'''Common classes and functions for package tests.'''
1352+
1353+import string, random, crypt, subprocess, pwd, signal, time
1354+
1355+class TimedOutException(Exception):
1356+ def __init__(self, value = "Timed Out"):
1357+ self.value = value
1358+ def __str__(self):
1359+ return repr(self.value)
1360+
1361+def timeout(secs, f, *args):
1362+ def handler(signum, frame):
1363+ raise TimedOutException()
1364+
1365+ old = signal.signal(signal.SIGALRM, handler)
1366+ result = None
1367+ signal.alarm(secs)
1368+ try:
1369+ result = f(*args)
1370+ finally:
1371+ signal.alarm(0)
1372+ signal.signal(signal.SIGALRM, old)
1373+
1374+ return result
1375+
1376+def random_string(length):
1377+ '''Return a random string, consisting of ASCII letters, with given
1378+ length.'''
1379+
1380+ s = ''
1381+ maxind = len(string.letters)-1
1382+ for l in range(length):
1383+ s += string.letters[random.randint(0, maxind)]
1384+ return s.lower()
1385+
1386+def login_exists(login):
1387+ '''Checks whether the given login exists on the system.'''
1388+
1389+ try:
1390+ pwd.getpwnam(login)
1391+ return True
1392+ except KeyError:
1393+ return False
1394+
1395+def cmd(command, input = None, stderr = subprocess.STDOUT):
1396+ '''Try to execute given command (array) and return its stdout, or return
1397+ a textual error if it failed.'''
1398+
1399+ try:
1400+ sp = subprocess.Popen(command, stdout=subprocess.PIPE, stderr=stderr, close_fds=True)
1401+ except OSError, e:
1402+ return [127, str(e)]
1403+
1404+ out = sp.communicate(input)[0]
1405+ return [sp.returncode,out]
1406+
1407+class TestUser:
1408+ '''Create a temporary test user and remove it again in the dtor.'''
1409+
1410+ def __init__(self, login=None, home=True):
1411+ '''Create a new user account with a random password.
1412+
1413+ By default, the login name is random, too, but can be explicitly
1414+ specified with 'login'. By default, a home directory is created, this
1415+ can be suppressed with 'home=False'.'''
1416+
1417+ self.login = None
1418+
1419+ if login:
1420+ if login_exists(login):
1421+ raise ValueError, 'login name already exists'
1422+ else:
1423+ while(True):
1424+ login = random_string(8)
1425+ if not login_exists(login):
1426+ break
1427+
1428+ self.salt = random_string(2)
1429+ self.password = random_string(8)
1430+ self.crypted = crypt.crypt(self.password, self.salt)
1431+
1432+ if home:
1433+ assert subprocess.call(['useradd', '-p', self.crypted, '-m', login]) == 0
1434+ else:
1435+ assert subprocess.call(['useradd', '-p', self.crypted, login]) == 0
1436+
1437+ self.login = login
1438+ p = pwd.getpwnam(self.login)
1439+ self.uid = p[2]
1440+ self.gid = p[3]
1441+
1442+ def __del__(self):
1443+ '''Remove the created user account.'''
1444+
1445+ if self.login:
1446+ # seems to already have gone here
1447+ try:
1448+ import subprocess
1449+ except:
1450+ pass
1451+ assert subprocess.call(['userdel', '-r', self.login]) == 0
1452diff --git a/debian/tests/testlib_dovecot.py b/debian/tests/testlib_dovecot.py
1453new file mode 100644
1454index 0000000..a2c216b
1455--- /dev/null
1456+++ b/debian/tests/testlib_dovecot.py
1457@@ -0,0 +1,112 @@
1458+#!/usr/bin/python
1459+'''
1460+ Packages required: dovecot-imapd dovecot-pop3d
1461+'''
1462+
1463+import subprocess, shutil, grp, os, os.path, sys, time
1464+
1465+class Dovecot:
1466+ def get_mailbox(self):
1467+ return self.mailbox
1468+
1469+ def __init__(self,user,config=None):
1470+ '''Create test scenario.
1471+
1472+ dovecot is configured for all protocols (imap[s] and pop3[s]), a test
1473+ user is set up, and /var/mail/$user contains an unread and a read mail.
1474+ '''
1475+
1476+ self.old_version = False
1477+ if config == None:
1478+ config='''
1479+protocols = imap pop3
1480+log_timestamp = "%Y-%m-%d %H:%M:%S "
1481+mail_privileged_group = mail
1482+managesieve_notify_capability = mailto
1483+managesieve_sieve_capability = fileinto reject envelope encoded-character vacation subaddress comparator-i;ascii-numeric relational regex imap4flags copy include variables body enotify environment mailbox date index ihave duplicate mime foreverypart extracttext
1484+mmap_disable = yes
1485+ssl = yes
1486+ssl_cert = </etc/dovecot/dovecot.pem
1487+ssl_key = </etc/dovecot/private/dovecot.pem
1488+auth_mechanisms = PLAIN
1489+mail_location = mbox:~/mail:INBOX=/var/mail/%u
1490+service auth {
1491+ user = root
1492+}
1493+protocol pop3 {
1494+ pop3_uidl_format = %08Xu%08Xv
1495+}
1496+userdb {
1497+ driver = passwd
1498+}
1499+passdb {
1500+ driver = passwd-file
1501+ args = username_format=%n scheme=PLAIN /etc/dovecot/test.passwd
1502+}
1503+'''
1504+
1505+ # make sure that /etc/inetd.conf exists to avoid init script errors
1506+ self.created_inetdconf = False
1507+ if not os.path.exists('/etc/inetd.conf'):
1508+ open('/etc/inetd.conf', 'a')
1509+ self.created_inetdconf = True
1510+
1511+ # configure and restart dovecot
1512+ if not os.path.exists('/etc/dovecot/dovecot.conf.autotest'):
1513+ shutil.copyfile('/etc/dovecot/dovecot.conf', '/etc/dovecot/dovecot.conf.autotest')
1514+ cfgfile = open('/etc/dovecot/dovecot.conf', 'w')
1515+ cfgfile.write(config)
1516+ cfgfile.close()
1517+
1518+ file('/etc/dovecot/test.passwd','w').write('%s:{plain}%s\n' % (user.login, user.password) )
1519+
1520+ # restart will fail if dovecot is not already running
1521+ subprocess.call(['/etc/init.d/dovecot', 'stop'], stdout=subprocess.PIPE)
1522+ # systemd rate limit will kill it without a bit of sleep (max 5 in 10 sec)
1523+ time.sleep(3)
1524+ assert subprocess.call(['/etc/init.d/dovecot', 'start'], stdout=subprocess.PIPE, stderr=subprocess.STDOUT) == 0
1525+
1526+ # create test mailbox with one new and one old mail
1527+ self.mailbox = '/var/mail/' + user.login
1528+ self.orig_mbox = \
1529+'''From test1@test1.com Fri Nov 17 02:21:08 2006
1530+Date: Thu, 16 Nov 2006 17:12:23 -0800
1531+From: Test User 1 <test1@test1.com>
1532+To: Dovecot tester <dovecot@test.com>
1533+Subject: Test 1
1534+Status: N
1535+
1536+Some really important news.
1537+
1538+From test2@test1.com Tue Nov 28 11:29:34 2006
1539+Date: Tue, 28 Nov 2006 11:29:34 +0100
1540+From: Test User 2 <test2@test2.com>
1541+To: Dovecot tester <dovecot@test.com>
1542+Subject: Test 2
1543+Status: R
1544+
1545+More news.
1546+
1547+Get cracking!
1548+'''
1549+ open(self.mailbox, 'w').write(self.orig_mbox)
1550+ os.chown(self.mailbox, user.uid, grp.getgrnam('mail')[2])
1551+ os.chmod(self.mailbox, 0660)
1552+
1553+ def __del__(self):
1554+ # restore original configuration and restart dovecot
1555+ os.rename('/etc/dovecot/dovecot.conf.autotest', '/etc/dovecot/dovecot.conf')
1556+ # quiesce, default configuration has no protocols
1557+ subprocess.call(['/etc/init.d/dovecot', 'restart'], stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
1558+
1559+ if self.created_inetdconf:
1560+ os.unlink('/etc/inetd.conf')
1561+
1562+ def get_ssl_fingerprint(self):
1563+ pem = '/etc/ssl/certs/dovecot.pem'
1564+ if not os.path.exists(pem):
1565+ pem = '/etc/ssl/certs/ssl-cert-snakeoil.pem'
1566+
1567+ sp = subprocess.Popen(['openssl','x509','-in',pem,'-noout','-md5','-fingerprint'], stdout=subprocess.PIPE, stderr=subprocess.STDOUT, close_fds=True)
1568+ return sp.communicate(None)[0].split('=',1)[1].strip()
1569+

Subscribers

People subscribed via source and target branches