ISPC3 SVN postfix mess?

Discussion in 'Developers' Forum' started by skeldof, Oct 31, 2008.

  1. skeldof

    skeldof New Member

    I'm not sure if I messed up something during the install of SVN ISPC3 (r490) but the mail delivery is not working correctly.

    I admit I modified the config (in the web gui) to use /var/vmail instead of /home/vmail. I created a test Client, Email domain (test2.com) and Email Mailbox [email protected]. The folder structure /var/vmail/test2.com/test2/[cur,new,tmp] was created (no Maildir folder?)

    When I send a mail locally postfix dumps it into /var/vmail/Maildir mbox file.

    I logged in to IMAP using Thunderbird and was met with an empty Inbox. Deleted folder was displayed as a subfolder of Inbox.

    Courier had created the folder courierimapkeywords and files courierimapsubscribed and courierimapuiddb, within /var/vmail/test2.com/test2/

    I'm used to working with exim4 and dovecot, so have no idea where to start debugging why postfix (or maildrop, or however it all fits together) doesn't deliver to the correct place or why .Trash appears as a subfolder to Inbox.
     
  2. till

    till Super Moderator Staff Member ISPConfig Developer

    It is possible that /var/maildir is not working correctly. I recommend to iuninstall ISPConfig 3 and reinstall it withour modifying this setting.
     
  3. skeldof

    skeldof New Member

    Sorry that's not really a solution. Something about the postfix settings is hardcoded, or not reading the database correctly when the mail folder is not in /home/vmail/...

    I did the same change on the 3.0.0.7 vmware that's linked in downloads: Change /home/vmail/[domain]/[localpart]/ to /var/vmail/[domain]/[localpart]/. The folder structure is created correctly but all mails end up in a /var/vmail/Maildir file.
     
  4. till

    till Super Moderator Staff Member ISPConfig Developer

    Changing the folder is not supporetd yet as it is hardcoded in some scripts, thats why I told you to not change it. I will remove it from the settings.
     
  5. skeldof

    skeldof New Member

    I finally got the delivery working correctly. The key problem was .mailfilter file I hadn't spotted in /home/vmail/.

    To anyone else (daft enough) wishing to move the Maildir folders:
    If you haven't installed yet:
    • Edit $ISPCONFIG/install/dist/conf/$YOURDISTRO.conf.php. Change $conf['postfix']['vmail_mailbox_base'] = '/home/vmail'; to point to where your mail will go.
    • Install ISPConfig3.
    • Edit the server's config to use the new mail path: System -> Server config -> $SERVER -> Mail. Update "Maildir Path" and "Homedir Path". (if till hasn't removed the option yet ;))

    If you have installed ISPConfig it's all a little messier:
    • I highly recommend not doing this if you have any mail users active in ISPConfig. Otherwise it'll involve lots of manual SQL updating in the mail_user table.
    • Move (or copy with "cp -a") /home/vmail to the new location.
    • Update /etc/passwd and change vmail's home to the new location.
    • Edit /etc/postfix/main.cf and change "virtual_mailbox_base" option to new location.
    • Edit newlocation/.mailfilter file. Change any reference of /home/vmail to the new location.
    • Edit the server's config to use the new mail path: System -> Server config -> $SERVER -> Mail. Update "Maildir Path" and "Homedir Path". (if till hasn't removed the option yet ;))
    • Update any current virtual mail users if you're crazy enough to ignore the warning
    • Restart postfix
     
  6. quentusrex

    quentusrex New Member

    Is this ready to be installed as a question during the install? "Where do you want the vmail folder?" Because having it in the var folder would really help with hosting. This way only the /var/ folder could be mounted to a different drive and would make backing up the servers much easier.
     
  7. skeldof

    skeldof New Member

    Almost. The problem is the static variable in the SQL. This is hard coded in install/tpl/server.ini.master which is simply inserted into the database (with safety quoting) during the install. This variable is what ISPConfig3 uses to generate the maildir location for a new mailbox.
     
  8. quentusrex

    quentusrex New Member

    Then that isn't much of a problem. If we know where the static variable is, then it can be changed during install. It actually makes it easier if there is only one location with the variable. Because then it becomes a matter of setting that static variable during install.
     

Share This Page