Default Maildir structure

Discussion in 'Installation/Configuration' started by Hans-Linux, May 10, 2013.

  1. Hans-Linux

    Hans-Linux New Member

    OS: Debian 6
    ISPConfig version: 3.0.5.2
    Mail: Dovecot

    New Installation.

    I need to change the default IMAP Maildir layout generated for new mail accounts and subdirectories to:

    Maildir-|
    ______|./INBOX.Draft
    ______|./INBOX.Junk
    ______|./INBOX.Sent
    ______|./INBOX.Trash
    ______|/cur
    ______|/new
    ______|/tmp


    How can I do this?

    Thanks in advance

    Hans
     
  2. tahunasky

    tahunasky New Member

    Hi,

    You can specify and INBOX path in dovecots.conf file:

    mail_location = maildir:~/Maildir:INBOX=~/Maildir/.INBOX

    Then you set the rest of the folders up in the email client as dovecot only cares about INBOX, cur, new, tmp.

    For example, in windows live mail, you say where to store the emails that are sent, deleted, drafts and junk. So the client actually sends the email to the imap SENT folder when you send and email, or by default in windows live mail SENT ITEMS. Same with TRASH, or default DELETED ITEMS.

    You also do this with the webmail clients. In squirrelmail you can change the locations in the config file /config/config.php. eg:
    $default_folder_prefix = '';
    $trash_folder = 'Trash';
    $sent_folder = 'Sent';
    $draft_folder = 'Drafts';

    or in your case:
    $default_folder_prefix = '';
    $trash_folder = 'INBOX.Trash';
    $sent_folder = 'INBOX.Sent';
    $draft_folder = 'INBOX.Drafts';
     
    Last edited: May 11, 2013
  3. Hans-Linux

    Hans-Linux New Member

    Thanks for the information.

    We have to about 2,000 IMAP accounts to create and then transfer stored mails from an external hosting provider to these new IMAP accounts. The users use Evolution and Thunderbird on very low end diskless Gentoo systems. The sub accounts below /maildir/ should be automatically created when the user connect the first time with his Evolution or Thunderbird mail client and create the aforesaid directory structure, including /.INBOX.Junk.
    It can be easily be done with IRedMail, but requires a dedicated mail server, hardware and administration.
     
  4. till

    till Super Moderator Howtoforge Staff HowtoForge Supporter ISPConfig Developer

    ISPConfig uses Maildirs without prefixes. I recommend thyt you convert the maildir structure during migration to the one that ispconfig uses. This should be possible as batch job with a script.

    A prefix "INBOX" is typical for courier imap systems, on dovecot systems you dont have a prefix.
     
  5. tahunasky

    tahunasky New Member

    I would also just stick with the default maildir structure. If you intend sticking with ispconfig, do the conversion now and then you dont have to worry about it again if upgrading or transferring to a new server.
    It will also look better in Thunderbird/evolution, as the sent/junk/trash folder will all be top level and not hidden under INBOX.
     
    Last edited: May 14, 2013
  6. Hans-Linux

    Hans-Linux New Member

    Converting the Maildir structure is easy. The problem is to convert nearly 2000 Evolution clients.

    Will have to dig around and try to modify the configuration scripts.
     
  7. Hans-Linux

    Hans-Linux New Member

    [SOLVED] Default Maildir structure

    Modified mail_plugin.inc.php:
    line 132 to: if(!is_dir($data['new']['maildir'].'/.INBOX.Sent')) {
    line 135 to: $app->system->maildirmake($maildomain_path,$mail_config['mailuser_name'],'INBOX.Sent');

    line 137 to: if(!is_dir($data['new']['maildir'].'/.INBOX.Drafts')) {
    line 140 to: $app->system->maildirmake($maildomain_path,$mail_config['mailuser_name'],'INBOX.Drafts');

    line 142 to: if(!is_dir($data['new']['maildir'].'/.INBOX.Trash')) {
    line 145 to: $app->system->maildirmake($maildomain_path,$mail_config['mailuser_name'],'INBOX.Trash');

    line 147 to: if(!is_dir($data['new']['maildir'].'/.INBOX.Junk')) {
    line 150 to: $app->system->maildirmake($maildomain_path,$mail_config['mailuser_name'],'INBOX.Junk');
     

Share This Page