OSEC

Neohapsis is currently accepting applications for employment. For more information, please visit our website www.neohapsis.com or email hr@neohapsis.com
 
From: Robin Whittle (rwfirstpr.com.au)
Date: Mon Jul 02 2001 - 10:55:17 CDT

  • Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]

    Thanks for the messages in response to my original queries a week ago.
    Thanks Wietse and Sam for these programs!

    I figured out where Courier IMAP expects its mailbox files to be - and
    it also took me a while to get the Postfix -> Courier Maildrop
    combination to deliver mail to where Courier IMAP expects it.

    This message reports on what I found.

    This is going to both the Postfix and the Courier lists, since I was not
    sure which program I had not properly configured.

    I started writing this as a question, but I solved it - so I am
    presenting it as an answer for other souls who travel this way. The
    trick is the config files in Maildrop before it is compiled. The config
    setting for Postfix does not seem to affect Maildrop's behaviour - at
    least for me.

    My newly compiled Maildrop executable is four times longer than the
    original - and I haven't figured out why. Does this matter? I wonder
    if it is full of debugging guff or just not using shared libraries, in
    which case, it makes little or no difference to performance.

    I have found that Courier IMAP, as I installed it on my RH7.1 system (by
    using rpm to compile it to an RPM package, and then installing the
    package without any changes) has the following arrangements for user
    blah:

      /home/blah/Maildir/

    This needs to be created by some means (say by the useradd and /etc/skel
    system). At my current stage of testing things, I use Courier's
    maildirmake binary:

      http://www.flounder.net/~mrsam/maildrop/maildirmake.html

    as the user blah, to make this directory. From /home/blah/ simply:

      maildirmake Maildir

    This /home/blah/Maildir/ directory is a Maildir format directory. Its
    owner is blah and it contains three subdirectories which, like itself,
    are chmod 700.

      /home/blah/Maildir/cur
      /home/blah/Maildir/new
      /home/blah/Maildir/tmp

    Together, these directories constitute a Maildir format "Inbox" which I
    can access with both Netscape 4.77 and Outlook Express.

    Furthermore, using the client (Netscape or Outlook Express) I can create
    mailboxes within this directory, and then mailboxes in those.

       (Netscape is configured as per:
          http://www.inter7.com/courierimap/README.imap.html )

    I did not build Courier IMAP with the
    --enable-workarounds-for-imap-client-bugs option - and I am getting
    quite a bit of flakiness with Netscape which I assume will be fixed when
    I recompile Courier IMAP with this option set.

    Each of these of these mailboxes is a Maildir directory with its three
    sub-directories.

    To the client they appear as a tree of directories and sub-directories,
    such as:

        Inbox
         |
         |--aaa
         |
         |--Trash
         |
         |--xxx
         |
         |--yyy
             |
             zzz
            
            
    Physically in the file system, they are as follows, not counting each
    directory's three subdirectories and two files which Courier IMAP puts
    in each one.

      /home/blah/Maildir/.aaa
      /home/blah/Maildir/.Trash
      /home/blah/Maildir/.yyy
      /home/blah/Maildir/.yyy.zzz

    Each can contain both messages and mailboxes.

    My problem was that I had not been able to get Postfix -> Maildrop to
    deliver mail to the correct location: the Maildir format directory:

      /home/blah/Maildir/

    (I want to use Maildir for its filtering capabilities, I think, but I
    haven't got that far yet. Postfix can deliver directly to Maildir
    directories. )

    If I create a Maildir format directory at:

      /var/spool/mail/blah/

    then Postfix -> Maildrop delivers the incoming emails there.

    There is nothing to configure at run-time for Courier Maildrop, as far
    as I know. All configuration is done by editing config.h files and
    recompilation. The relevant entries in /etc/postfix/main.cf are:

      home_mailbox = Maildir/ << This seems to have no effect!

      mailbox_command = /usr/bin/maildrop

      local_destination_concurrency_limit=1

         (Because Maildrop can only deliver one email at a time and so
          should not be asked to deliver to two or more local mailboxes
          at the same time.)

    I haven't used "mailbox_transport" or "fallback_transport".

    Should I set these to point to maildrop too?

    I restarted Postfix and still the mail goes to /var/spool/mail/blah/ .

    I tried writing a little debug script to echo to a file the env-vars
    which Postfix sets up when calling Maildrop, (USER, EXTENSION, DOMAIN
    and LOCAL) but was not successful. Postfix certainly is using Maildrop
    because happy messages in /var/log/maillog appear when it delivers a
    message. I get an error message with my debug script in place of
    Maildrop.

    I tried a symlink to make /var/spool/mail/blah point to
    /home/blah/Maildir but this didn't work, for reasons unknown, and I
    shouldn't have to resort to such a kludge.

    Scrutinising the "DEFAULT_DEF" section of:

      http://www.flounder.net/~mrsam/maildrop/INSTALL.html

    I find that I should set this DEFAULT_DEF to "./Mailbox" to make
    Maildrop deliver incoming mail as Qmail would, and as Courier IMAP
    expects, to /home/blah/Maildir/ .

    I had built Mailrop as root with a simple rpm command for the tar.gz
    file, and then installed the package. (This means I can easily
    uninstall it if I like.) When I built the package like this, I guess
    the autoconfigure stuff figured that I wasn't using this
    /home/blah/Maildir/ arrangement.

    Now I want to recompile just the maildir binary, without mucking around
    with RPM.

    In the unzipped source tree, in /maildrop-1.3.3/ , as root, I give the
    command:

       configure

    Now I want to alter this DEFAULT_DEF thang . . .

    It is mentined but commented out in the
    /maildrop-1.3.3/maildrop/config.h file which the configuration script
    has generated.

    (Or was it uncommented and set to /var/spool/mail? I am unsure. This
    report is a simplification of the path I took.)

    I uncomment it and make it:

    #define DEFAULT_DEF "./Maildir"

    Then I change back to the maildrop-1.3.3 directory and type "make".

    After it is all done, I have a new binary in the maildrop directory
    "maildrop". But it is 604,043 bytes, while the old one was 149,864.

    This size difference is a worry! Maybe it is not sharing libraries
    properly.

    I rename the old maildrop binary, copy the new one to /usr/bin/ and
    give it the right permissions:

       Set user ID
       Set group ID
       read execute
       read execute
       read execute

       Owner root
       Group mail

    Should I set the sticky bit to keep it in memory after it has run once?

    Success! The new executable delivers mail to /home/blah/Maildir .
    (Actually to the /new/ directory there.) Swapping back to the old one,
    incoming mail goes to /var/spool/blah/ again.

    So the problem is solved, but I am puzzled about the new Maildrop
    executable being so large.

    Next, I need to recompile Courier IMAP to make it tolerate whatever
    Netscape is doing to upset it.

    All this and more will be documented on my website in the future - a
    RH71-Postfix-Maildrop-Courier-IMAP-IMP-How-I-did-it page.

     - Robin

     http://www.firstpr.com.au
    -
    To unsubscribe, send mail to majordomopostfix.org with content
    (not subject): unsubscribe postfix-users