cyrus on debian

I had to setup a nice mail solution for friends on their GNU/Linux server: a nice Debian 4.0 :-) As you should know, I'm not a Debian afficionados, never knew why but this is not my favorite distro and this is where the opensource world takes all his sense: freedom of choice :) "...tous les goûts sont dans la nature..." Ok then I started to setup ldap, not really a problem, the 4 db's were inserted via ldif; postfix with ldap support for domains and users was also not problem. Cyrus and Sasl was ok untill I discover that the autocreate patch[1] was not present in the package... oh my root ! As I didn't want to install cyrus from sources, and as I wasn't able to find a package already patched (but I found a huge amount of bugs requesting that feature and this for all cyrus version, it seems that postfix's debian maintainers don't like that patch... but I guess that all the other common distros have the patch included in their package...) Ok then I started to try to remember how to make a .deb again (loooooong time ago) step 1: apt-get install devscripts step 2: apt-get source cyrus-imapd-2.2 (I know it's old :( ) step 3: create a dpatch (cat ~lefred/cyrus-imapd-2.2.13-autocreate-0.9.4.diff | dpatch patch-template -p "85-autocreate.dpatch" > cyrus-imapd-2.2-2.2.13/debian/patches/85-autocreate.dpatch step 4: add 85-autocreate.dpatch between 80-kbsd-no-psstrings.dpatch and 99-update-autoconf.dpatch in cyrus-imapd-2.2-2.2.13/debian/patches/00list step 5: apply the patches : cd cyrus-imapd-2.2-2.2.13; dpatch apply-all -v step 6: build the packages : dpkg-buildpackage -uc ARRGH it fails : reverting patch 85-autocreate from ./ ... failed. step 7: rm debian/patched/85-autocreate.dpatch step 8: redo step 6 ARRGH it fails again, it seemd the dpatch creation is not ok I found another dpatch [2] and I replace it, so step 3 can be replaced by the copy of the new 85-autocreate.dpatch into cyrus-imapd-2.2-2.2.13/debian/patches/ Then back to step 4 and everything works ! in the mail.log using the standard debian package : Oct 15 20:12:53 ns2014675 postfix/pipe[6186]: 6506571620: to=, orig_to=, relay=cyrus, delay=0.08, delays=0.03/0/0/0.04, dsn=5.6.0, status=bounced (data format error. Command output: alain: Mailbox does not exist ) with the new fresh package : Oct 15 23:09:28 ns2014675 cyrus/lmtpunix[7840]: autocreateinbox: User alain, INBOX was successfully created in partition default Oct 15 23:09:28 ns2014675 cyrus/lmtpunix[7840]: autocreateinbox: User alain, subfolder INBOX.Learn creation succeeded. Oct 15 23:09:28 ns2014675 cyrus/lmtpunix[7840]: autocreateinbox: User alain, subfolder INBOX.Learn.Ham creation succeeded. Oct 15 23:09:28 ns2014675 cyrus/lmtpunix[7840]: autocreateinbox: User alain, subscription to INBOX.Learn.Ham succeeded Oct 15 23:09:28 ns2014675 cyrus/lmtpunix[7840]: autocreateinbox: User alain, subfolder INBOX.Learn.Spam creation succeeded. Oct 15 23:09:28 ns2014675 cyrus/lmtpunix[7840]: autocreateinbox: User alain, subscription to INBOX.Learn.Spam succeeded Oct 15 23:09:28 ns2014675 cyrus/lmtpunix[7840]: autocreateinbox: User alain, subfolder INBOX.Drafts creation succeeded. Oct 15 23:09:28 ns2014675 cyrus/lmtpunix[7840]: autocreateinbox: User alain, subscription to INBOX.Drafts succeeded Oct 15 23:09:28 ns2014675 cyrus/lmtpunix[7840]: autocreateinbox: User alain, subfolder INBOX.Sent creation succeeded. Oct 15 23:09:28 ns2014675 cyrus/lmtpunix[7840]: autocreateinbox: User alain, subscription to INBOX.Sent succeeded Oct 15 23:09:28 ns2014675 cyrus/lmtpunix[7840]: autocreateinbox: User alain, subfolder INBOX.SpamMail creation succeeded. Oct 15 23:09:28 ns2014675 cyrus/lmtpunix[7840]: autocreateinbox: User alain, subscription to INBOX.SpamMail succeeded Oct 15 23:09:28 ns2014675 cyrus/lmtpunix[7840]: autocreateinbox: User alain, subfolder INBOX.Trash creation succeeded. Oct 15 23:09:28 ns2014675 cyrus/lmtpunix[7840]: autocreateinbox: User alain, subscription to INBOX.Trash succeeded Oct 15 23:09:28 ns2014675 cyrus/lmtpunix[7840]: User alain, Inbox subfolders, created 7, subscribed 6 [1] http://email.uoa.gr/download/cyrus/cyrus-imapd-2.2.13/ [2] http://bugs.debian.org/cgi-bin/bugreport.cgi?msg=25;filename=85-autocreate.dpatch;att=1;bug=435598

I had to setup a nice mail solution for friends on their GNU/Linux server: a nice Debian 4.0 🙂

As you should know, I’m not a Debian afficionados, never knew why but this is not my favorite distro and this is where the opensource world takes all his sense: freedom of choice 🙂 “…tous les goûts sont dans la nature…”

Ok then I started to setup ldap, not really a problem, the 4 db’s were inserted via ldif; postfix with ldap support for domains and users was also not problem. Cyrus and Sasl was ok untill I discover that the autocreate patch[1] was not present in the package… oh my root !

As I didn’t want to install cyrus from sources, and as I wasn’t able to find a package already patched (but I found a huge amount of bugs requesting that feature and this for all cyrus version, it seems that postfix’s debian maintainers don’t like that patch… but I guess that all the other common distros have the patch included in their package…)

Ok then I started to try to remember how to make a .deb again (loooooong time ago)

step 1: apt-get install devscripts

step 2: apt-get source cyrus-imapd-2.2 (I know it’s old 🙁 )

step 3: create a dpatch (cat ~lefred/cyrus-imapd-2.2.13-autocreate-0.9.4.diff | dpatch patch-template -p “85-autocreate.dpatch” > cyrus-imapd-2.2-2.2.13/debian/patches/85-autocreate.dpatch

step 4: add 85-autocreate.dpatch between 80-kbsd-no-psstrings.dpatch and 99-update-autoconf.dpatch in cyrus-imapd-2.2-2.2.13/debian/patches/00list

step 5: apply the patches : cd cyrus-imapd-2.2-2.2.13; dpatch apply-all -v

step 6: build the packages : dpkg-buildpackage -uc

ARRGH it fails :
reverting patch 85-autocreate from ./ … failed.

step 7: rm debian/patched/85-autocreate.dpatch

step 8: redo step 6

ARRGH it fails again, it seemd the dpatch creation is not ok

I found another dpatch [2] and I replace it, so step 3 can be replaced by the copy of the new 85-autocreate.dpatch into cyrus-imapd-2.2-2.2.13/debian/patches/

Then back to step 4 and everything works !

in the mail.log using the standard debian package :

Oct 15 20:12:53 ns2014675 postfix/pipe[6186]: 6506571620: to=, orig_to=, relay=cyrus, delay=0.08, delays=0.03/0/0/0.04, dsn=5.6.0, status=bounced (data format error. Command output: alain: Mailbox does not exist )

with the new fresh package :

Oct 15 23:09:28 ns2014675 cyrus/lmtpunix[7840]: autocreateinbox: User alain, INBOX was successfully created in partition default
Oct 15 23:09:28 ns2014675 cyrus/lmtpunix[7840]: autocreateinbox: User alain, subfolder INBOX.Learn creation succeeded.
Oct 15 23:09:28 ns2014675 cyrus/lmtpunix[7840]: autocreateinbox: User alain, subfolder INBOX.Learn.Ham creation succeeded.
Oct 15 23:09:28 ns2014675 cyrus/lmtpunix[7840]: autocreateinbox: User alain, subscription to INBOX.Learn.Ham succeeded
Oct 15 23:09:28 ns2014675 cyrus/lmtpunix[7840]: autocreateinbox: User alain, subfolder INBOX.Learn.Spam creation succeeded.
Oct 15 23:09:28 ns2014675 cyrus/lmtpunix[7840]: autocreateinbox: User alain, subscription to INBOX.Learn.Spam succeeded
Oct 15 23:09:28 ns2014675 cyrus/lmtpunix[7840]: autocreateinbox: User alain, subfolder INBOX.Drafts creation succeeded.
Oct 15 23:09:28 ns2014675 cyrus/lmtpunix[7840]: autocreateinbox: User alain, subscription to INBOX.Drafts succeeded
Oct 15 23:09:28 ns2014675 cyrus/lmtpunix[7840]: autocreateinbox: User alain, subfolder INBOX.Sent creation succeeded.
Oct 15 23:09:28 ns2014675 cyrus/lmtpunix[7840]: autocreateinbox: User alain, subscription to INBOX.Sent succeeded
Oct 15 23:09:28 ns2014675 cyrus/lmtpunix[7840]: autocreateinbox: User alain, subfolder INBOX.SpamMail creation succeeded.
Oct 15 23:09:28 ns2014675 cyrus/lmtpunix[7840]: autocreateinbox: User alain, subscription to INBOX.SpamMail succeeded
Oct 15 23:09:28 ns2014675 cyrus/lmtpunix[7840]: autocreateinbox: User alain, subfolder INBOX.Trash creation succeeded.
Oct 15 23:09:28 ns2014675 cyrus/lmtpunix[7840]: autocreateinbox: User alain, subscription to INBOX.Trash succeeded
Oct 15 23:09:28 ns2014675 cyrus/lmtpunix[7840]: User alain, Inbox subfolders, created 7, subscribed 6

[1] http://email.uoa.gr/download/cyrus/cyrus-imapd-2.2.13/
[2] http://bugs.debian.org/cgi-bin/bugreport.cgi?msg=25;filename=85-autocreate.dpatch;att=1;bug=435598

Subscribe to Blog via Email

Enter your email address to subscribe to this blog and receive notifications of new posts by email.

5 Comments

  1. J’ai d’abord commencé par essayer sur une lenny, mais pas moyen de faire fonctionner le patch. Ensuite, je suis tombé sur ton blog (très bien fait d’ailleurs !). J’ai essayé d’appliquer cette méthode sur lenny… en vain.
    Enfin, je me dis que je vais installer une etch, appliquer ton tuto, puis transporter le paquet .deb vers ma lenny. Mais là encore je coince.

    J’ai suivi exactement les lignes décrites ci-dessus, mais rien n’y fait.
    J’utilise la version de debian 4.0r8 et la version de cyrus est : 2.2.13-10+etch4.

    Est-il possible de me donner les versions exactes utilisées lors de l’installation ? Sinon, peux-tu me donner ton paquet déjà patché?
    Merci d’avance.

    • Me again, once again,
      Here the steps i’ve followed on debian etch 4r08 to get cyrus patched:

      1/ get the sources of cyrus
      # apt-get source cyrus-imapd-2.2

      2/ copy the debian patch (2nd link)
      # cp 85-autocreate.dpatch cyrus-imapd-2.2-2.2.13/debian/patches/

      3/ edit the ‘cyrus-imapd-2.2-2.2.13/debian/patches/00list’ file

      4/ DO NOT try to apply any patch

      5/ run the build command
      # cd cyrus-imapd-2.2-2.2.13
      # debuild -us -uc

    • salut,

      je n’ai actuellement plus d’accès Internet, donc il est compliqué pour moi de te répondre, je le fais dès que ce problème appartient au passé !

      merci

Leave a Reply to oZemCancel Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

As MySQL Community Manager, I am an employee of Oracle and the views expressed on this blog are my own and do not necessarily reflect the views of Oracle.

You can find articles I wrote on Oracle’s blog.