Mail not being delivered

Discussion in 'Installation/Configuration' started by PacketPaul, Oct 4, 2007.

  1. PacketPaul

    PacketPaul New Member

    Here is the log file of a message being received:

    Oct 4 13:51:42 new postfix/local[24100]: 41538A60069: to=<[email protected]>, relay=local, delay=0.17, delays=0.16/0.01/0/0, dsn=2.0.0, status=sent (delivered to maildir)

    Yet, I can not find the mail message anywhere?

    Under /var/spool/mail:
    -rw------- 1 web6_paul mail 0 Oct 4 11:04 web6_paul

    Under ~/web6_paul/Maildir:
    (empty directory)

    Under ~/web6_paul/mail:
    drwx------ 4 web6_paul web6 4096 Oct 4 01:22 .imap
    -rw------- 1 web6_paul web6 0 Oct 4 01:22 inbox
    -rw------- 1 web6_paul web6 0 Oct 4 01:22 Junk E-mail
    -rw------- 1 web6_paul web6 12 Oct 4 01:22 .subscriptions

    When I view the account via squirrelmail, it shows no messages in the inbox.

    Any ideas?

    Thanks!

    Paul
     
  2. mlz

    mlz Member

    Under Maildir there should be the following directories:

    cur
    new
    tmp

    (and maybe dovecot-uidlist as a file) Sounds like your Maildirs are not setting up right.
     
  3. PacketPaul

    PacketPaul New Member


    Thanks for your help. Any suggestions on how to fix my setup? I imagine I need to do more then simply create the directories.

    Thanks!

    Paul
     
  4. falko

    falko Super Moderator Howtoforge Staff

    What's in your /etc/postfix/main.cf?
     
  5. PacketPaul

    PacketPaul New Member

    Ok, I think I have this issue fixed. For whatever reason they virtusertable was not setup correct. I deleted then recreated the site and mail is now being delivered to Maildir.

    But, there is now another issue. Dovecot can not find the mailbox. I am using a chroot environment and ISPConfig does not seem to setup the passwd file home directory correct when creating the user.

    When I create a new user under a site, the home directory in the password file is:

    web5_paul:x:10002:10005:paul:/var/www/web5/./:/bin/bash

    This causes Dovecot to look for the mailbox under /var/www/web5/Mailbox.

    The password file should be:

    web5_paul:x:10002:10005:paul:/var/www/web5/./user/web5_paul:/bin/bash

    Notice the home directory difference.

    I realize I can edit the dovecot.conf file to tell it to look for Maildir under :~/user/%u/Maildir, but I would prefer to have the password home directory correct.

    Ideas?

    Paul
     
  6. falko

    falko Super Moderator Howtoforge Staff

    Is web5_paul the admin of the site? Then /var/www/web5 is the correct homedir, and there should be a symlink from /var/www/web5/Maildir to /var/www/web5/user/web5_paul/Maildir.
     
  7. PacketPaul

    PacketPaul New Member

    The directory /var/www/web5 is the root directory of the chroot environment and should never be used as the home directory for any user, including the administrator. The home directories for all users should fall under /var/www/web5/users. In the current version if ISPConfig, the administrator is given his own home directory, but the passwd file incorrectly points to the root directory, and not the home directory.

    Using /var/www/web5 as the home directory for the administrator in a chroot environment breaks e-mail under CentOS 5. The symbolic links created codes the full pathway (i.e. /var/www/web6/users/web5_admin/Webdir). This pathway is not available in a chroot environment! Thus the administrator can not receive mail in a chroot environment, assuming Dovecot has been properly setup to use chroot.

    One solution would be to use relative pathways when creating the link, but in my opinion the best solution is to make the administrators directory /var/www/web5/./users/web5_admin thus giving the administrator his own home directory. Plus it makes the end-user "feel" as if they are receiving their own little private linux system.

    I have hacked /root/ispconfig/scripts/lib/config.lib.php and /root/ispconfig/scripts/lib/config.inc.php to modify the chroot environment and would be happy to submit it to the development team for consideration. There are a few things I need to fix first and I want to make sure it is fully tested.



    Paul
     
  8. falko

    falko Super Moderator Howtoforge Staff

    The admin is given his own directory in the user directory but it's not his homedir. His homedir is /var/www/web5. It's intended like that.
     
  9. PacketPaul

    PacketPaul New Member

    Yes, but under a chroot environment it breaks Dovecot and is contrary to Unix/Linux standards.

    Dovecot tries to find mail under ~/Maildir. In a chroot environment, the link is broken. Thus Dovecot simply "sees" an empty Maildir file. Plus there are a number of programs that assume the home directory in the passwd file is accurate and consistent.

    The design team seems to have gone through a lot of effort to make the admin directory the top level directory by linking all of the necessary files from the /user folder the the top level. The problem is the links break in a chroot environment causing a big mess.

    What was the reasoning for making the admin's home directory the root directory of the site?

    Thanks for your help!

    Paul
     
  10. falko

    falko Super Moderator Howtoforge Staff

    We did this so that the admin can browse all directories within the root.
     

Share This Page