HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials

HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials (
-   Installation/Configuration (
-   -   IMAP Default Folders (

themachine 5th November 2005 23:55

IMAP Default Folders
I'm trying to find the settings for the default MailDir config (if possible) or does ispconfig just run like a 'mkmaildir' command?

Basically, I was the folders "Drafts" "Sent" "Spam" and "Trash" to exist by default.

falko 6th November 2005 15:23

ISPConfig does not create the folders within Maildir. It just tells Postfix/Sendmail to deliver emails to Maildir, and when the first email arrives, then the folders are created.

But you can use the command maildirmake (see man maildirmake or ) to create custom folders. To do this automatically, you can change the function user_insert() in /root/ispconfig/scripts/lib/config.lib.php.

Cirox 6th April 2006 22:23


i think about the right code to put into this user_insert() function to set up a subfolder "Virus" and "Spam" in maildir for each user automaticly. But i really dont know how. Can you write down such code to put into at the right place ? Many thanks!

greetings cirox

falko 6th April 2006 23:40

Have a look at

man maildirmake
It should give you an idea.

Cirox 7th April 2006 10:36


ok i have read the man maildirmake, but i only know how to make shared folders an folders/subfolders for each user individually. But for me it will be important that this described subfolders will be made automaticly when mails arrive for each user which is created.

So i dont know how to put in in user_insert().


greetings cirox

falko 7th April 2006 12:49

Do you have PHP programming knowledge? You could do it with a foreach loop, for example.

Cirox 7th April 2006 16:28


i dont have php coding knowledge, thats my problem ....

greetings cirox

falko 8th April 2006 02:53

Have a look at the function user_insert() in /root/ispconfig/scripts/lib/config.lib.php. Somewhere around line 702 you could add something like this:

PHP Code:

exec("maildirmake ...");

Cirox 30th April 2006 12:07


i cant solve the problem, here is the code around line 702:


// User-Mail-Datei anlegen, sonst evtl. Fehler bei Autoresponder
      $mod->log->phpcaselog(touch("/var/spool/mail/".$user_username), "create /var/spool/mail/".$user_username, $this->FILE, __LINE__);
      $mod->log->caselog("chown $user_username:mail /var/spool/mail/$user_username &> /dev/null", $this->FILE, __LINE__);
      $mod->log->caselog("chmod 600 /var/spool/mail/$user_username", $this->FILE, __LINE__);

now i want to create automaticly two folders "spam" and "virus" for each new mailbox.

How to put into? Can you change the code, see above?

greetings cirox

falko 30th April 2006 15:27

You would use something like this:

PHP Code:

// User-Mail-Datei anlegen, sonst evtl. Fehler bei Autoresponder
$mod->log->phpcaselog(touch("/var/spool/mail/".$user_username), "create /var/spool/mail/".$user_username$this->FILE__LINE__);
$mod->log->caselog("chown $user_username:mail /var/spool/mail/$user_username &> /dev/null"$this->FILE__LINE__);
$mod->log->caselog("chmod 600 /var/spool/mail/$user_username"$this->FILE__LINE__);
  } else {
exec("maildirmake ...");

All times are GMT +2. The time now is 04:04.

Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.