Dovecot is a secure unix IMAP & POP3 server. See URL for more info. This is a simple ebuild for net-mail/dovecot version 0.99.9.1. It includes a patch that may fix a CR+LF issue, as mentioned on the homepage. It respects the USE flags: ipv6 pam ldap postgres sasl ssl Though these have not all been thoroughly tested. Dovecot is under heavy development. It is full featured and stabalising but I'd still recommend keeping this ebuild masked for a while.
Created attachment 12658 [details] Ebuild for Dovecot 0.99.9.1
Updated after reading http://cvs.gentoo.org/~liquidx/ebuildmistakes.html & associated docs. Removed some comments from the ebuild other fixups. Files: dovecot-0.99.9.1.ebuild (ebuild for latest packaged version of dovecot) dovecot (init script for starting and stopping the daemon) dovecot-0.99.9.1-fetch.patch (a patch to resolve a CR+LF issue)
Created attachment 12746 [details] ebuild Suggest net-mail/dovecot/
Comment on attachment 12658 [details] Ebuild for Dovecot 0.99.9.1 Use attached individual files instead.
Created attachment 12747 [details] init script this goes in the files/ dir
Created attachment 12748 [details] patch in the files/ dir
Created attachment 13912 [details] Updated ebuild for just released 0.99.10.
Created attachment 16029 [details] Ebuild tarball for dovecot 0.99.10 I made an ebuild too, I didn't saw that there is one already here. Would have saved me the work. My ebuild automatically modifies the dovecot config file to use the default Gentoo mailbox locations (i.e. ~/.maildir for maildir, etc.) and generates ssl certs if it is build with 'use ssl' (like cyrus-imapd). Also the ebuild applies a patch (from the dovecot mailing list) to make dovecot run with 2.6 kernels (it will still work with 2.4 kernels). For pam support it installs the pam file from Red Hat's dovecot (yes, dovecot is now part of RHL). My ebuild also automatically creats dovecot user and group because imap-login runs per default as user dovecot. But beware, the ldap or postgresql support is absolutly untested. These are two things I can't test currently.
Looks really good, Andreas. If you're happy with it, mark the previous files as obsolete. Might be a good idea to attach the files here individually instead of as a tarball. It is easier to examine them online that way. I've not yet heard from any Gentoo devs about adding dovecot to CVS. Maybe for 1.0 eh :-).
When I use the ebuild tarball, I get following error message: trieloff portage # emerge dovecot Calculating dependencies \ emerge: there are no masked or unmasked ebuilds to satisfy "dev-libs/cyrus-sasl-2.1". !!! Error calculating dependencies. Please correct. After changing the line to sasl? ( >=dev-libs/cyrus-sasl-2.1 ) the ebuild works perfect. Thank you.
Bump! I'd like to see this in stable! Is there such a thing as a bugzilla troll? I guess so...
Created attachment 20575 [details] Ebuild for Dovecot 0.99.10.2 New ebuild adapted from Andreas'. This is for Dovecot 0.99.10.2. Changes: - Cosmetic change to HOMEPAGE - LICENSE set to LGPL-2.1 - Set >=dev-libs/cyrus-sasl-2.1 as noted by Lars - Changed ">=net-mail/mailbase-0.00" to just "net-mail/mailbase" in RDEPEND - Removed explicit uid and gid setting from user/groupadd commands. When dovecot becomes stable, a uid & gid should be reserved as with other system apps. - Removed reference to 0.99.10 setuid patch (change has been incorporated in release) - Don't install dovecot.conf if it already exists in /etc/ - Don't regenerate /etc/ssl/{certs,private}/dovecot.pem if they already exist - Added post-installation note regarding PAM profile change from imap to dovecot
Created attachment 20576 [details] PAM profile from Andreas
Created attachment 20577 [details] Init script from Andreas
Andreas, please check out the latest ebuild then tag "Ebuild tarball for dovecot 0.99.10" as obsoleted if you could. The three most recent files go like this: net-mail/dovecot/dovecot-0.99.10.2.ebuild net-mail/dovecot/files/init.d/dovecot net-mail/dovecot/files/pam.d/dovecot I'm running this ebuild on my own PC and it looks good. Big thanks to Andreas and Lars. It'd be great to have dovecot in gentoo (masked) so that it can be tested more thoroughly. Maybe stable shortly after 1.0 release..?
- Marked the old 0.99.10 ebuild as obsolete The new 0.99.10.2 looks and works fine. Thanks. There is only a minor cosmetical issue: Afer the removal of the explicit uid and gid setting from the user/groupadd commands, the comment "(same uid/gid as Red Hat Linux)" is obsolete. I guess it's time now to bug some Gentoo developers to get it into portage...
Created attachment 20795 [details] Ebuild for Dovecot 0.99.10.2 Fixed.
Created attachment 20891 [details] Ebuild for Dovecot 0.99.10.2 Minor updates: - Use ${A} instead of ${P}.tar.gz in src_unpack() - Add a note about reviewing the config file because the default is to use postgresql for authentication which wont work "out of the box"
Created attachment 21218 [details] Ebuild for Dovecot 0.99.10.4 New dovecot release.
Most recent ebuild compiles and works for me, but did manage to overwrite the /etc/dovecot.conf file I put in before emerging.
Created attachment 21459 [details] Ebuild for Dovecot 0.99.10.4 Hmm. I just updated from .2 to .4 using the ebuild and it didn't alter the /etc/dovecot.conf (I added a test comment to the file before updating to be sure and it remained intact). The attached ebuild uses -e instead of -f for the existance tests. This should work in case /etc/dovecot.conf is a symlink to elsewhere (likewise for the two PEM files).
For it's ssl support dovecot can use the openssl or the gnutls implementation. But the ebuild is fixed to openssl. Here is a patch (for the dovecot 0.99.10.4 ebuild) which makes it possible to use gnutls as well. Further I removed the required minimum version number for ssl. I think it's not needed anymore (especially since the ssl version in the dovecot ebuild has some security issues). I didn't used the ssl use flag anymore since ssl is per default in all profiles. Thus I think it makes more sense to choose the ssl implementation with the gnutls use flag. It's done this way in libsoup too, libsoup is the only ebuild I found where one can choose with use flags between openssl and gnutls. It makes sense to do it the same way in both ebuilds. Although some ebuilds which don't support openssl at all use the ssl flag to mark gnutls support, thus using gnutls instead of ssl for dovecot is more clear. Per default dovecot will still use openssl, this patch doesn't change that. --- dovecot-0.99.10.4.ebuild 2003-11-25 16:12:06.000000000 +0100 +++ dovecot-0.99.10.4-r1.ebuild 2004-03-30 14:36:58.066534312 +0200 @@ -2,7 +2,7 @@ # Distributed under the terms of the GNU General Public License v2 # $Header: $ -IUSE="debug ipv6 ldap maildir pam postgres sasl ssl vpopmail nopop3d" +IUSE="debug gnutls ipv6 ldap maildir pam postgres sasl vpopmail nopop3d" inherit base @@ -21,7 +21,8 @@ ldap? ( >=net-nds/openldap-1.2 ) pam? ( sys-libs/pam ) sasl? ( >=dev-libs/cyrus-sasl-2.1 ) - ssl? ( >=dev-libs/openssl-0.9.6g ) + !gnutls? ( dev-libs/openssl ) + gnutls? ( net-libs/gnutls ) postgres? ( dev-db/postgresql ) vpopmail? ( net-mail/vpopmail )" @@ -53,7 +54,9 @@ use pam || myconf="${myconf} --without-pam" use postgres && myconf="${myconf} --with-pgsql" use sasl && myconf="${myconf} --with-cyrus-sasl2" - use ssl || myconf="${myconf} --without-ssl" + use gnutls \ + && myconf="${myconf} --with-ssl=gnutls" \ + || myconf="${myconf} --with-ssl=openssl" use vpopmail || myconf="${myconf} --without-vpopmail" ./configure ${myconf} \
Since dovecot can be built w/o ssl support, the ebuild should have both ssl and gnutls USE flags. The trick, then, is that if both flags are specified, then gnutls would be chosen. Does that make sense?
While I'm hacking, a note to the original author. Instead of grepping the /etc/passwd file (which ldap and nis folks may not be using), you should instead grep the results of "getent passwd". We should also choose specific uid / gid info for the ebuild, but I'm not sure what the current method is for doing that sanely.
More random notes: I don't think the "inherit base" is needed, but I could be wrong there. pkg_setup() isn't called when a binary package is installed, so adding groups / users needs to be in pkg_preinst() instead.
Okay, I'm willing to commit this ebuild to cvs, but first I need permission to change the copyright to Gentoo Technologies, Inc, as that's the current Gentoo policy (you can see the full explanation at http://www.gentoo.org/proj/en/devrel/copyright/index.xml). Thanks, g2boojum
Oops, there is really a "Copyright 2003 Andreas Simon" line in the ebuild. I don't remember writing that ;-) Actually I feel silly having a "Copyright" on such trivial stuff at all. Of course you have (at least from my part) permission to change the copyright to Gentoo Technologies, Inc,. Having both use flags, gnutls and ssl, seems like a good idea, especially if someone doesn't want ssl support at all. BTW, dovecot will not compile with tha latest gnutls version (1.0.9) because of some changes in gnutls, but this gnutls version is not yet in portage. Thus dovecot should depend on =gnutls-1.0.4 and not later versions. I don't see a reason for inherit base either. Must be the remains from some old cut&paste.
Thank you very much; I appreciate it. My apologies for this ebuild languishing so long! Since dovecot seems to work w/ the 0.8.10 version of gnutls I've replaced the DEPEND w/ <=net-libs/gnutls-1.0.4. I'm very much a novice w/ this ebuild, so those of you who have been doing such a good job of keeping up this ebuild please do continue to do so. Now in CVS; should propagate to rsync in an hour or so.