Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 141743 - Add sieve plugin to net-mail/dovecot?
Summary: Add sieve plugin to net-mail/dovecot?
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: New packages (show other bugs)
Hardware: All Linux
: High enhancement (vote)
Assignee: Roy Marples (RETIRED)
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-07-25 15:45 UTC by Alan Briolat
Modified: 2006-12-05 07:43 UTC (History)
8 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
net-mail/dovecot-1.0_rc2 to 1.0_rc2-r1 (dovecot-1.0_rc2-r1.diff,1.54 KB, patch)
2006-07-26 16:04 UTC, Alan Briolat
Details | Diff
dovecot-1.0_rc2-r1.diff (dovecot-1.0_rc2-r1.diff,1018 bytes, patch)
2006-07-26 20:24 UTC, Alan Briolat
Details | Diff
net-mail/dovecot-sieve-20060726 (dovecot-sieve-20060726.ebuild,934 bytes, text/plain)
2006-07-26 20:27 UTC, Alan Briolat
Details
dovecot-1.0_rc2.ebuild (dovecot-1.0_rc2.ebuild,5.79 KB, text/plain)
2006-07-27 17:32 UTC, Magnus Granberg
Details
net-mail/dovecot-1.0_rc2-r1 (dovecot-1.0_rc2-r1.ebuild,5.53 KB, text/plain)
2006-07-27 18:46 UTC, Alan Briolat
Details
dovecot-1.0-rc2.ebuild (dovecot-1.0_rc2.ebuild,5.86 KB, text/plain)
2006-07-27 19:26 UTC, Magnus Granberg
Details
dovecot-1.0_rc7-r1.ebuild (dovecot-1.0_rc7-r1.ebuild,5.84 KB, text/plain)
2006-09-16 06:38 UTC, Alan Briolat
Details
patch to current dovecot-1.0_rc14.ebuild to add sieve support (dovecot-ebuild-sieve.patch,3.33 KB, patch)
2006-11-17 05:43 UTC, Brian G. Peterson
Details | Diff
patch to current dovecot-1.0_rc14.ebuild to add sieve support (dovecot-ebuild-sieve-r1.patch,3.31 KB, patch)
2006-11-17 06:07 UTC, Brian G. Peterson
Details | Diff
patch to current dovecot-1.0_rc14.ebuild to add sieve support (dovecot-ebuild-sieve-r2.patch,3.32 KB, patch)
2006-11-17 08:42 UTC, Brian G. Peterson
Details | Diff
Full dovecot rc14 ebuild with sieve USE flag (dovecot-1.0_rc14-r1.ebuild,5.86 KB, text/plain)
2006-11-17 13:24 UTC, Alan Briolat
Details
patch to current dovecot-1.0_rc14.ebuild to add sieve support (dovecot-ebuild-sieve-r3.patch,2.42 KB, patch)
2006-11-18 06:58 UTC, Brian G. Peterson
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Alan Briolat 2006-07-25 15:45:22 UTC
I was wondering if there was a chance of having the 'sieve' plugin added to the net-mail/dovecot build process?  A lot of distributions seem to have this available, or by default, now.

I'm not too certain about the build process at the moment, but I might be able to work on an ebuild if the maintainer for the dovecot ebuild is uninterested or otherwise too busy.
Comment 1 Alan Briolat 2006-07-26 16:04:43 UTC
Created attachment 92814 [details, diff]
net-mail/dovecot-1.0_rc2  to  1.0_rc2-r1

Adds 'sieve' USE flag, which causes dovecot-sieve plugin to be built against compiled dovecot source during src_compile(), and installed after dovecot.

Tarball 'dovecot-sieve-20060726.tar.gz' is a CVS snapshot I have compiled/installed/tested on a working mail system, no problems.

Have successfully installed this on x86 and amd64.

Also working on an alternative method that requires a smaller patch to dovecot ebuid, and is a separate package instead - will post here if I get it working.
Comment 2 Alan Briolat 2006-07-26 20:24:57 UTC
Created attachment 92819 [details, diff]
dovecot-1.0_rc2-r1.diff

Removed 'dovecot-sieve' build from 'dovecot' ebuild.  (look at next attachment for 'net-mail/dovecot-sieve' ebuild)

For now I've made installing the libs required for building plugins dependant on a local 'plugin-libs' USE flag - maybe we should just install them regardless?  'du -h' says:

2.4M    /usr/lib/dovecot/pluginlibs

So maybe this is nothing to worry about.
Comment 3 Alan Briolat 2006-07-26 20:27:52 UTC
Created attachment 92820 [details]
net-mail/dovecot-sieve-20060726

Ebuild for the dovecot-sieve plugin.  Depends on >=net-mail/dovecot-1.0_rc2-r1 built with +plugin-libs (for now) (see above!)
Comment 4 Magnus Granberg gentoo-dev 2006-07-27 17:32:02 UTC
Created attachment 92883 [details]
dovecot-1.0_rc2.ebuild

Add sieve in dovecot build (use flag sieve).
Move dovecot.conf to /etc/dovecot/ .
Need emerge cvs to work.
Not tested 100%.
Comment 5 Alan Briolat 2006-07-27 17:49:25 UTC
Good idea about moving the configs to /etc/dovecot - I had thought of doing that but forgot what I needed to change to do it :)

As for the sieve plugin - while that is possibly another way to do it, I opted for a CVS snapshot, which could then be tested and used, rather than mixing live CVS with a pretty-much stable package.

If we really must use live CVS, I think that is more of a case for the plugin being its own package.  Also you might want to look at the functions available in the 'cvs' eclass.
Comment 6 Alan Briolat 2006-07-27 18:11:17 UTC
It appears that something somewhere is causing both of our ebuilds to not create/copy the init script for dovecot via 'newinitd', however it works fine in the current ebuild and I cannot see a change in our ebuilds that should stop it from working.
Comment 7 Alan Briolat 2006-07-27 18:15:45 UTC
Never mind, looks like i forgot to copy the dovecot.init to the 'files/' for dovecot in my overlay :(
Comment 8 Alan Briolat 2006-07-27 18:46:44 UTC
Created attachment 92886 [details]
net-mail/dovecot-1.0_rc2-r1

Build from CVS snapshot (fetched ONLY if using the 'sieve' useflag) - I don't think it is a good idea to mix in live CVS with a package that is supposed to be "stable" and dependable.
Using /etc/dovecot/ for configs (thanks Magnus)
Moved sieve plugin install towards the end of src_install() - any earlier and it will mess up some of the doc installs which assume $PWD == $S

Tested and working on x86 and amd64
Comment 9 Magnus Granberg gentoo-dev 2006-07-27 19:26:05 UTC
Created attachment 92887 [details]
dovecot-1.0-rc2.ebuild

Pot a CVS snapshot file on the web and make new ebuild for it.
Hoppe it works.
Comment 10 Magnus Granberg gentoo-dev 2006-07-27 19:31:12 UTC
Damm u post the fix befor me :)
Will test the ebuild.
Comment 11 Magnus Granberg gentoo-dev 2006-07-27 19:47:01 UTC
It works her :)
thanx for the help.
Comment 12 Alan Briolat 2006-07-27 20:04:40 UTC
No problem - hopefully it will make it into the tree...  For now, i'll just continue to hug my overlay :)
Comment 13 Roy Marples (RETIRED) gentoo-dev 2006-08-01 02:25:52 UTC
Looks good. But before this goes into portage, could you ask upstream to consider changing their default config location from /etc to /etc/dovecot?

We like to mirror upstream as much as we can :)
Comment 14 Brian G. Peterson 2006-09-15 21:56:12 UTC
Any movement on getting sieve support into the official tree?  This seems to build OK on my amd64 test server, but I don't want to create a custom overlay just for this ebuild in production
Comment 15 Alan Briolat 2006-09-16 06:38:28 UTC
Created attachment 97149 [details]
dovecot-1.0_rc7-r1.ebuild

Applied my changes enabling the sieve plugin to the latest rc7 ebuild.

Also did a couple of little fixes to the rc7 ebuild - the dovecot-ldap.conf and dovecot-sql.conf configs were being put in /etc/dovecot/, but the dovecot.conf was still being changed to point to /etc/dovecot-sql.conf and /etc/dovecot-ldap.conf by default.

New ebuild builds, runs, works - tested and working on both of my mailservers (amd64 and x86)
Comment 16 Ziga Boehm 2006-10-18 11:38:39 UTC
Builds and runs fine on my x86 machine also. Thank you - sieve is really a great feature!

I have one question though - why ebuild sets such a restrictive file permissions on dovecot.conf? Security through obscurity?

When using dovecot-lda as virtual (for delivery to virtual domains/mailboxes) and/or local delivery agent in combination with postfix there is necessity for dovecot to be able to read-access dovecot.conf as non-root user or delivery to mailboxes fails miserably. One can of course always change the permissions by hand but will loose them after upgrading and etc-updating...

I would therefore like to make a suggestion to use fperms of 644 instead of 600.
Comment 17 Tomislav Filipcic 2006-11-16 15:23:06 UTC
The dovecot-sieve plugin is now released at version 1.0. Please consider adding it to the latest ebuild.
Comment 18 Brian G. Peterson 2006-11-16 19:06:01 UTC
The poster in Comment #17 neglected to give salient details.

Dovecot-Sieve has been marked as stable 1.0, and is available here:

http://www.dovecot.org/releases/sieve/dovecot-sieve-1.0.tar.gz

It would indeed be best if this were made a standard part (or a USE flag at least) of the gentoo ebuild, and given the number of positive reports on this bug, I don't quite understand why someone with commit access doesn't simply commit to CVS already...
Comment 19 Brian G. Peterson 2006-11-16 19:36:54 UTC
In Comment #13, uberlord@gentoo.org  asked that a request be made of the upstream dovecot team to move config files to /etc/dovecot instead of /etc/

That could be accomplished by a small change to the make instructions, or a small patch to the Makefile.am file, but I've now made this request of the dovecot team:

The thread should be viewable here:

http://dovecot.org/pipermail/dovecot/2006-November/017622.html

As I've just made the request, there has been no response as yet, but hopefully one will be forthcoming.
Comment 20 Alan Briolat 2006-11-16 21:35:15 UTC
I'll try to get around to creating, testing and posting an updated ebuild.  Thanks for bringing this to everyone's attention.

Also, thanks for initiating the query with the dovecot team - something I meant to do but never got around to.
Comment 21 Brian G. Peterson 2006-11-17 05:40:44 UTC
In Comment #19, I initiated a request with the upstream dovecot team regarding moving config files to /etc/dovecot/.  An active member of the dovecot community (but not the development lead (Marcus Ruekert from Germany) has said:

<quote>
you dont need to modify anything:

"--sysconfdir=/etc/dovecot/"

thats all you need. not too hard no?
</quote>

This is the approach that Alan's ebuilds already take, and is clearly an approved method by the dovecot team, so I suggest that we simply leave it this way.  I definitely prefer /etc/dovecot/ to /etc/ , and we're only setting a configure flag (which is what they are there for).
Comment 22 Brian G. Peterson 2006-11-17 05:43:49 UTC
Created attachment 102203 [details, diff]
patch to current dovecot-1.0_rc14.ebuild to add sieve support

I've created a unified diff patch that can be applied to the current dovecot _rc14.ebuild to add sieve support.

It would be best if someone with more ebuild-foo than I have would figure out how to add auto-download of the dovecot-sieve-1.0.tar.gz file to the process, but this works for now.
Comment 23 Brian G. Peterson 2006-11-17 06:07:10 UTC
Created attachment 102204 [details, diff]
patch to current dovecot-1.0_rc14.ebuild to add sieve support

This slightly modified patch downloasds dovecot-sieve-1.0.tar.gz from the dovecot releases directly.

Hopefully the Gentoo dovecot ebuild maintainer will test and commit to CVS as dovecot-1.0_rc14-r1.ebuild after adding 'sieve' use flag to the officially supported USE flag list.
Comment 24 Brian G. Peterson 2006-11-17 08:42:37 UTC
Created attachment 102209 [details, diff]
patch to current dovecot-1.0_rc14.ebuild to add sieve support

I've fixed the source URL for the dovecot-sieve-1.0.tar.gz package.

I've tested and installed this on my development servers (x86 and amd64) and my production servers (x86 and amd64), and it builds and installs without problem on all these machines.

The difference between the first patch file and this one was:

< +SRC_URI="http://dovecot.org/releases/${MY_P}.tar.gz sieve? ( http://gentoo.thev0id.net/distfiles/${SIEVE}.tar.gz )"
---
> +SRC_URI="http://dovecot.org/releases/${MY_P}.tar.gz sieve? ( http://dovecot.org/releases/sieve/${SIEVE} )"

I think that once a 'sieve' USE flag is registered wherever those things happen in the Gentoo build process, this should be good to go into CVS.  Hopefully others, including uberlord@gentoo.org, will test this patch against the current dovecot-1.0_rc14.ebuild and confirm.
Comment 25 Alan Briolat 2006-11-17 13:24:37 UTC
Created attachment 102225 [details]
Full dovecot rc14 ebuild with sieve USE flag

Are you sure your patch works when you have sieve enabled?  Looks like your SIEVE_S ends up as ${WORKDIR}/dovecot-sieve-1.0.tar.gz when the ebuild is run, so cd ${SIEVE_S} should fail...

Anyway, I very carefully did a merge between my old changes and the latest (rc14) ebuild, and it works exactly as it should, using the same behavior as my older ebuild, but of course incorporating all the newer fixes etc too.

Compiles and installs on x86 and amd64, all of my filters still work as expected.
Comment 26 Brian G. Peterson 2006-11-18 06:58:18 UTC
Created attachment 102271 [details, diff]
patch to current dovecot-1.0_rc14.ebuild to add sieve support

Yes, I've sure that the patch works.  Also, the patch in Attachment #100209 [details] referenced in Comment #24 produce versions of the ebuild that are nearly identical.  

Creating patches makes more sense in general, because they can be applied to version bump ebuilds.  That's how I created and applied the original patch, although it needed some tweaking to use /etc/dovecot everywhere.

I've created a patch file from Alan's latest ebuild as well.  This way, a gentoo developer (or insterested third party) can use the patch features of Bugzilla to examine just the changes.

I'm marking the patch from Attachment 102209 [details, diff] obsolete as well. Both patches work, and as I said create nearly identical ebuilds, but we'll try to keep the number of open attachments to this bug to a minimum.
Comment 27 Wolfram Schlich (RETIRED) gentoo-dev 2006-11-18 11:51:04 UTC
Roy, any news on this? :)
Comment 28 Roy Marples (RETIRED) gentoo-dev 2006-11-19 03:28:05 UTC
(In reply to comment #27)
> Roy, any news on this? :)

Now that the plugin isn't in CVS then I'll look into it in the coming week.
Comment 29 Brian G. Peterson 2006-11-19 06:31:07 UTC
The primary author of dovcot, Timo Sirainen <tss@iki.fi>, has responded to the request to move the config files to /etc/dovecot:

On Saturday 18 November 2006 16:05, Timo Sirainen wrote:
> On Thu, 2006-11-16 at 21:34 -0600, Brian G. Peterson wrote:
> > <...>
> > /etc/dovecot/
> > <...>
> > Some distributions already make this change, but placing this change
> > in the dovecot core would make it unnecessary for downstream
> > packagers to make a change to the core dovecot distribution files.
>
> I think it's not a good idea to do this kind of a change so close to
> v1.0 release. I'll change it for v1.1.

So, the change in default location should be permanent upstream eventually, and the setting of "--sysconfdir=/etc/dovecot/" as it has been in portage since at least dovecot-1.0_rc10.ebuild is fine for now.

I think this officially lays to rest the sub-thread on this bug from Comment #4, Comment #13, and Comment #19, and Comment #21
Comment 30 Ziga Boehm 2006-11-19 06:42:45 UTC
What about using fperms 644 on /etc/dovecot/dovecot.conf instead of 600 applied in current ebuild? Please see my Comment #16.
Comment 31 Brian G. Peterson 2006-11-19 07:09:05 UTC
In response to Comment #16 and follow-up Comment #30 RE:permissions:
In my setup, I have sendmail and dovecot and procmail all in the "mail" group, and  made the files group readable.  So, something like 640, would probably be preferable to world readable.  But I suspect that may be an issue for a different bug, if uberlord@gentoo.org doesn't chime in here.
Comment 32 Brian G. Peterson 2006-11-19 07:42:47 UTC
Today, dovecot has version-bumped to dovecot-1.0_rc15 to fix a buffer error that may have been exploitable.

I'll put this in another bug if uberlord@gentoo.org wants me to, but I'm hoping that the version of the ebuild on this bug will simply be checked in as the standard ebuild for rc15.  dovecot-1.0_rc15 compiles and runs without problems using the sieve version of the ebuild here.
Comment 33 Roy Marples (RETIRED) gentoo-dev 2006-11-28 03:34:49 UTC
I have no issue with relaxing the file permissions.

Out of curiosity, how feasible is it to have sieve as a separate ebuild? That would be preferable I think. Maybe get dovecot to install some headers that sieve can then use to build against?
Comment 34 Brian G. Peterson 2006-11-28 04:45:07 UTC
Comment #33 asks about having dovecot-sieve as a separate ebuild.

There is no theoretical problem with this. dovecot-sieve is actually a separate package that adds functionality to the dovecot Local Delivery Agent (LDA) 'deliver'.  A separate ebuild would, of course, require dovecot and its libraries and headers to build.

dovecot-sieve isn't really a stand-alone application, but rather a plugin to dovecot.  I think the general trend in ebuilds has been to make things like that into USE flags (think SSL, MySQL, etc use flags where such functionality is optional at build time with a multitude of other packages)

I think my preference would be for a single ebuild with a 'sieve' USE flag, just to keep things easy from a system administration end, and encourage the wider adoption of the SIEVE protocol.  If it's a separate ebuild, I think fewer people will know about it and thus fewer people will deploy SIEVE, which would be a shame for the users ;)
Comment 35 Ziga Boehm 2006-11-28 15:07:17 UTC
I have to agree with Comment #34 as I too feel that separate ebuild isn't as elegant as using single ebuild with additional USE flag.

As far as relaxing file permissions goes, current ebuild installs three configuration files: dovecot.conf, dovecot-ldap.conf and dovecot-sql.conf - and relaxing fperms for at least first one in my opinion shouldn't pose any serious security threat.
Comment 36 Ziga Boehm 2006-11-28 15:10:03 UTC
... as it doesn't hold/reveal any relevant security information I should add. 

Sorry for this additional post! ;-)
Comment 37 Peter Fischer 2006-11-29 05:50:01 UTC
I too would prefer a single ebuild script with various USE flags, because there are other plugins, too:
see http://wiki.dovecot.org/Plugins
I consider convert, trash & zlib plugins a "nice to have", but quota, imap_quota & acl plugins are essential.

Now imagine the neccesary administration overhead for different ebuilds (dovecot itself and 4-7 plugins) and different versions with different ARCHes ..!

(I'd had my share of this problem with postgresql and it's postgis add-on)

@package maintainer: Will you read this comment as "nice plea for convert, trash, zlib, quota, imap_quota & acl USE flags and plugins in dovecot" or would you prefer me adding bugs for each of it?

Comment 38 Brian G. Peterson 2006-11-29 06:01:32 UTC
from Comment #37 
trash, zlib, quota, imap_quota & acl are all distributed with dovecot, and enabling them requires only configuration changes that are specific to your installation. The ebuild has nothing to do with this.  It doesn't make any sense to maintain separate config files for these changes.  I suppose that you could provide patch files that could be applied to the default config to enable the plugins, but that just seems dangerous and wrong.

sieve is big enough that it is contained in a separate tarball, and needs to be downloaded and compiled sparately if support for sieve is going to be included, so you *need* to tell the ebuild to do something different just to compile support for sieve.  The system administrator will still need to make required configuration changes in their smtp server config to enable sive support anyway, even after it is compiled.
Comment 39 Jan Kohnert 2006-12-02 07:34:41 UTC
I vote for this one.

I think it would be very useful to have sieve support fot dovecot in Gentoo.

Best regards Jan

PS: I'll test the rc14 ebuild and update to rc15 for testing purposes. I'll comment later on that.
Comment 40 Roy Marples (RETIRED) gentoo-dev 2006-12-05 07:06:51 UTC
OK, sieve support has been added in rc15-r1.

Sorry about the delay.
Comment 41 Alan Briolat 2006-12-05 07:38:08 UTC
Thanks!  Another one to cross off my overlay :D
Comment 42 Jan Kohnert 2006-12-05 07:43:00 UTC
Thanks,

I wanted to comment: worked like a charm on rc15, with the provided patch rewritten. Good to have it in the official tree now. ;)

Best regards Jan