Loading ...
Sorry, an error occurred while loading the content.

Postfix doesn't create maildirs

Expand Messages
  • Matthias Dietrich
    Hi list, I just installed Postfix with Courier and some addons (spam+anti virus) and it works fine! Except one thing: the Maildirs of the users are not
    Message 1 of 9 , May 2, 2009
    • 0 Attachment
      Hi list,

      I just installed Postfix with Courier and some addons (spam+anti
      virus) and it works fine! Except one thing: the Maildirs of the users
      are not created automatically! I don't think this is a desired
      behavior as this is a pain in the a** when someone without server
      access wants to create new mailboxes.

      I use Postfix with virtual mailboxes for virtual domain hosting.
      Authentication is done with mysql, creating of new mailboxes is done
      via postfixadmin. I add a new Domain (example.com) and Mailbox
      (postmaster). Trying to log in after that brings the following error
      in /var/log/syslog:

      imapd: chdir /var/spool/mail/example.com/postmaster/: No such file
      or directory

      If I mkdir this by hand and chown to the correct user
      (virtual:virtual), I can login (although SquirrelMail gets an error
      after login because no folders within the users Maildir exists).

      Could need a helping hand! Is there a config variable that enables
      creating these mailboxes? Or have I done anything wrong? Where to
      have a look? Or do you need the config files to see what could be
      wrong?

      Thanks,
      Matthias
    • Matthias Dietrich
      ... I m really new to mail servers and followed this tutorial: http://flurdy.com/docs/postfix/ When going through the tutorial I didn t thought about MDAs, but
      Message 2 of 9 , May 2, 2009
      • 0 Attachment
        Am 02.05.2009 um 22:15 schrieb Darren Pilgrim:
        > Mail store folder creation is the responsibility of your delivery
        > agent, but you didn't state which delivery agent you're using.

        I'm really new to mail servers and followed this tutorial: http://flurdy.com/docs/postfix/

        When going through the tutorial I didn't thought about MDAs, but as I
        see now there is none described there. If there is no "default" one,
        I missed that. A quick search said that maildrop would be a good
        choice. Do you agree?

        Thanks,
        Matthias

        --
        rainboxx Matthias Dietrich
        Freier Software Engineer

        rainboxx | Tel.: +49 (0) 151 / 50 60 78 64
        Tölzer Str. 19 | Mail: matt@...
        70372 Stuttgart | WWW : http://www.rainboxx.de

        XING: https://www.xing.com/profile/Matthias_Dietrich18
        GULP: http://www.gulp.de/profil/rainboxx.html
      • Thomas Pfaff
        ... I can only speak for myself, but I think it s pretty good. Easy to use and configure filters. I ve also integrated bogofilter that first classifies the
        Message 3 of 9 , May 2, 2009
        • 0 Attachment
          > A quick search said that maildrop would be a good choice.
          > Do you agree?

          I can only speak for myself, but I think it's pretty good.
          Easy to use and configure filters. I've also integrated
          bogofilter that first classifies the mail, then maildrop
          runs it through the filter rules before the final delivery.

          Excerpts from my ~/.mailfilter file:

          # ~/.mailfilter

          logfile $HOME/log/maildrop.log
          MAILDIR="$HOME/Maildir"

          xfilter "/usr/local/bin/bogofilter -u -e -p"
          if ( /^X-Bogosity: Spam/ )
          to $MAILDIR/.Spam
          if ( /^X-Bogosity: Unsure/ )
          to $MAILDIR/.Unsure

          to $MAILDIR/

          There's a lot more there to put mail from various mailing
          lists into the appropriate folder, but this should give
          you an idea.

          Thomas
        • mouss
          ... you need to create the /var/spool/mail/example.com directory. after that, postfix will create the maildir for each user. I am assuming that you deliver
          Message 4 of 9 , May 2, 2009
          • 0 Attachment
            Matthias Dietrich a écrit :
            > Hi list,
            >
            > I just installed Postfix with Courier and some addons (spam+anti virus)
            > and it works fine! Except one thing: the Maildirs of the users are not
            > created automatically! I don't think this is a desired behavior as this
            > is a pain in the a** when someone without server access wants to create
            > new mailboxes.
            >
            > I use Postfix with virtual mailboxes for virtual domain hosting.
            > Authentication is done with mysql, creating of new mailboxes is done via
            > postfixadmin. I add a new Domain (example.com) and Mailbox
            > (postmaster). Trying to log in after that brings the following error in
            > /var/log/syslog:
            >
            > imapd: chdir /var/spool/mail/example.com/postmaster/: No such file or
            > directory
            >

            you need to create the /var/spool/mail/example.com directory. after
            that, postfix will create the maildir for each user.

            I am assuming that you deliver with virtual (and not with an external MDA).

            > If I mkdir this by hand and chown to the correct user (virtual:virtual),
            > I can login (although SquirrelMail gets an error after login because no
            > folders within the users Maildir exists).
            >
            > Could need a helping hand! Is there a config variable that enables
            > creating these mailboxes? Or have I done anything wrong? Where to have
            > a look? Or do you need the config files to see what could be wrong?
            >
            > Thanks,
            > Matthias
            >
          • mouss
            ... well, since you use courier-imap, maildrop will be relatively easy to setup. it will also give you the ability to classify mail into folders based on
            Message 5 of 9 , May 2, 2009
            • 0 Attachment
              Matthias Dietrich a écrit :
              > Am 02.05.2009 um 22:15 schrieb Darren Pilgrim:
              >> Mail store folder creation is the responsibility of your delivery
              >> agent, but you didn't state which delivery agent you're using.
              >
              > I'm really new to mail servers and followed this tutorial:
              > http://flurdy.com/docs/postfix/
              >
              > When going through the tutorial I didn't thought about MDAs, but as I
              > see now there is none described there. If there is no "default" one, I
              > missed that. A quick search said that maildrop would be a good choice.
              > Do you agree?
              >

              well, since you use courier-imap, maildrop will be relatively easy to
              setup. it will also give you the ability to classify mail into folders
              based on maildrop rules.

              but maildrop will not create the maildirs automatically. you'll need to
              add commands to do that in maildroprc...
            • LuKreme
              ... send the welcome mail when you create the account in postfixadmin.. The Maildirs are not created until a mail is delivered. If you want to create them
              Message 6 of 9 , May 2, 2009
              • 0 Attachment
                On 2-May-2009, at 14:05, Matthias Dietrich wrote:
                > I use Postfix with virtual mailboxes for virtual domain hosting.
                > Authentication is done with mysql, creating of new mailboxes is done
                > via postfixadmin. I add a new Domain (example.com) and Mailbox
                > (postmaster). Trying to log in after that brings the following
                > error in /var/log/syslog:
                >
                > imapd: chdir /var/spool/mail/example.com/postmaster/: No such file
                > or directory

                send the welcome mail when you create the account in postfixadmin..
                The Maildirs are not created until a mail is delivered.

                If you want to create them manually the command is maildirmake.


                --
                There are 10 types of people in the world: Those who understand
                binary and those who don't.
              • Darren Pilgrim
                ... You re using Courier-IMAP, so yes. Maildrop can execute external programs using backtick expansion, so you can easily create a system-wide maildroprc that
                Message 7 of 9 , May 2, 2009
                • 0 Attachment
                  Matthias Dietrich wrote:
                  > Am 02.05.2009 um 22:15 schrieb Darren Pilgrim:
                  >> Mail store folder creation is the responsibility of your delivery
                  >> agent, but you didn't state which delivery agent you're using.
                  >
                  > When going through the tutorial I didn't thought about MDAs, but as I
                  > see now there is none described there. If there is no "default" one,
                  > I missed that. A quick search said that maildrop would be a good
                  > choice. Do you agree?

                  You're using Courier-IMAP, so yes. Maildrop can execute external
                  programs using backtick expansion, so you can easily create a
                  system-wide maildroprc that checks for (and creates, if missing) a
                  standard set of folders using Courier-IMAP's maildirmake program. If
                  you want them, I still have the scripts I used before I switched to Dovecot.
                • Matthias Dietrich
                  ... That doesn t work... If I create the domain directory, the dir for the user won t be created either. ... I m a bit confused about what I use now... In
                  Message 8 of 9 , May 2, 2009
                  • 0 Attachment
                    Am 02.05.2009 um 23:09 schrieb mouss:
                    > you need to create the /var/spool/mail/example.com directory. after
                    > that, postfix will create the maildir for each user.

                    That doesn't work... If I create the domain directory, the dir for
                    the user won't be created either.

                    > I am assuming that you deliver with virtual (and not with an
                    > external MDA).

                    I'm a bit confused about what I use now... In main.cf is says:

                    mailbox_command = procmail -a "$EXTENSION"

                    which was a default value after installation (note: it's a Ubuntu
                    system). In master.cf there are following lines:

                    maildrop unix - n n - - pipe
                    flags=DRhu user=vmail argv=/usr/bin/maildrop -d ${recipient}

                    maildrop was not installed before. In the database tables I created
                    while going through the tutorial was a "transport" column which
                    defaults to "virtual:"; but I cannot see where this column is read.
                    So...?


                    Am 02.05.2009 um 23:34 schrieb LuKreme:
                    > send the welcome mail when you create the account in postfixadmin..
                    > The Maildirs are not created until a mail is delivered.

                    Hell, yeah! That worked now! After I installed postfixadmin, the
                    mail sending process took so long that the apache crashed (no process
                    lived after submitting the form that should add new mailboxes :o!), so
                    I commented that thing out. Thanks for that hint... The domain
                    folder is created, too. Great :)!

                    However that still doesn't make sense to me, that the "reader" (IMAP)
                    "crashes" when there is no directory and the writer (MDA) needs to
                    create the directory. If I don't want to send the welcome mail I have
                    to initiate the Maildir creation process on my own. What would be the
                    best way to do that? Using procmail oder maildrop? Or is there a way
                    without using another software?

                    Thank you all that helped and mailed!

                    Regards,
                    Matthias
                  • mouss
                    ... did you send a message to the user? ... this is for local users, not virtual users. if you don t want procmail, just remove this. ... what matters first
                    Message 9 of 9 , May 2, 2009
                    • 0 Attachment
                      Matthias Dietrich a écrit :
                      >
                      > Am 02.05.2009 um 23:09 schrieb mouss:
                      >> you need to create the /var/spool/mail/example.com directory. after
                      >> that, postfix will create the maildir for each user.
                      >
                      > That doesn't work... If I create the domain directory, the dir for the
                      > user won't be created either.
                      >

                      did you send a message to the user?

                      >> I am assuming that you deliver with virtual (and not with an external
                      >> MDA).
                      >
                      > I'm a bit confused about what I use now... In main.cf is says:
                      >
                      > mailbox_command = procmail -a "$EXTENSION"
                      >

                      this is for "local" users, not virtual users. if you don't want
                      procmail, just remove this.

                      > which was a default value after installation (note: it's a Ubuntu
                      > system). In master.cf there are following lines:
                      >
                      > maildrop unix - n n - - pipe
                      > flags=DRhu user=vmail argv=/usr/bin/maildrop -d ${recipient}
                      >
                      > maildrop was not installed before. In the database tables I created
                      > while going through the tutorial was a "transport" column which defaults
                      > to "virtual:"; but I cannot see where this column is read. So...?
                      >

                      what matters first is postfix configuration. you should always send us
                      the output of 'postconf -n'.

                      >
                      > Am 02.05.2009 um 23:34 schrieb LuKreme:
                      >> send the welcome mail when you create the account in postfixadmin..
                      >> The Maildirs are not created until a mail is delivered.
                      >
                      > Hell, yeah! That worked now! After I installed postfixadmin, the mail
                      > sending process took so long that the apache crashed (no process lived
                      > after submitting the form that should add new mailboxes :o!), so I
                      > commented that thing out. Thanks for that hint... The domain folder is
                      > created, too. Great :)!
                      >
                      > However that still doesn't make sense to me, that the "reader" (IMAP)
                      > "crashes" when there is no directory and the writer (MDA) needs to
                      > create the directory. If I don't want to send the welcome mail I have
                      > to initiate the Maildir creation process on my own. What would be the
                      > best way to do that? Using procmail oder maildrop?

                      if you don't want to send a welcome message, then you need to create the
                      Maildir when you add the user. because maildrop and procmail won't be
                      run until a mail is received.

                      instead, use a script to add users to your "database" and at the same
                      time, create the necessary maildirs and folders.

                      > Or is there a way
                      > without using another software?
                      >
                      > Thank you all that helped and mailed!
                      >
                      > Regards,
                      > Matthias
                      >
                    Your message has been successfully submitted and would be delivered to recipients shortly.