Skrevet av Emne: IMAP shared folders with Qmail and Courier-IMAP  (Lest 2789 ganger)

ATC

  • Gjest
IMAP shared folders with Qmail and Courier-IMAP
« på: 27. ſeptember 2008, 18:24 pm »
  • [applaud]0
  • [smite]0
  • When installing Qmail and Courier-IMAP, everything works fine except when mail is delivered directly to a shared folder; only the owner of the shared Maildir can see the messages.

    The reason is that the delivered message has ownership "user.user" and privileges 0600, instead of the ownership and privileges of the shared Maildir. For instance, if the messages are shared with all members of group "shared", the Maildir will be created with ownership "user.shared" and privileges "0770".

    Several quick-and-dirty solutions exist, most of them use inbox rules, procmail or some other hack to move messages from a temporary folder into the shared folder. None of them are fast and reliable enough to use in a production environment in our opinion. Which is why we came up with our own solution:



    ATC

    • Gjest
    [Solved] IMAP shared folders with Qmail and Courier-IMAP
    « Svar #1 på: 27. ſeptember 2008, 18:24 pm »
  • [applaud]0
  • [smite]0
  • 1. Manually "chgrp -R shared Maildir-shared/.Folder/" to whatever group you want, for instance "shared".

    2. Manually "chmod g+s Maildir-shared/.Folder/tmp/" so new messages will be owned by that group. ATC has suggested to the author of Courier-IMAP that future versions of his modified "maildirmake" makes this change for you, but until such time you have to do it yourself when creating the shared Maildir.

    3. Patch your qmail-local.c so new messages will automatically get the same group privileges as the "Maildir-shared/.Folder/tmp/" directory. The patch can be found here:
    http://home.atc.no/~floyd/qmailpatch.tgz

    After applying the patch, re-compile qmail as usual:
    "service qmail stop"
    "cd /usr/src/qmail-(version)"
    "make setup check"
    "service qmail start"

    The patch does not affect normal delivery in any way, the group permissions on a new message is only changed if the relevant "new" subdir group privileges have been changed.