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.
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 http://www.die.net/doc/linux/man/man1/maildirmake.1.html ) to create custom folders. To do this automatically, you can change the function user_insert() in /root/ispconfig/scripts/lib/config.lib.php.
Hi, 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
Hi, 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(). thanks greetings cirox
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: if($mod->system->server_conf["use_maildir"]){ exec("maildirmake ...");}
Hi, i cant solve the problem, here is the code around line 702: Code: // User-Mail-Datei anlegen, sonst evtl. Fehler bei Autoresponder if(!$mod->system->server_conf["use_maildir"]){ if(!is_file("/var/spool/mail/".$user_username)){ $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
You would use something like this: PHP: // User-Mail-Datei anlegen, sonst evtl. Fehler bei Autoresponder if(!$mod->system->server_conf["use_maildir"]){ if(!is_file("/var/spool/mail/".$user_username)){ $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 ..."); }
Hi, dont worry, i think i am a little bit stupid ;-) Now i have this code: Code: } } else { exec("maildirmake -f Spam mail/Maildir"); } it wont work. So i dont understand it. If i start squirrelmail, the folders .drafts etc will be created, but my question is how knows maildirmake,if this, see code above, is the right folder to create the folder "Spam" ? So i changed the code, like above, then i create a new user in ispconfig and nothing happens. No folder "Spam" for this new user. I think the folder is the problem. Code: } } else { exec("maildirmake -f Spam /$user_username/Maildir"); } isnt right, too. if i create it manually , its no problem: Code: maildirmake -f Spam /var/www/web9/Maildir/ greetings cirox
You can try to use the full path to maildirmake in the script (run Code: which maildirmake to find out). /$user_username/Maildir would translate to something like /web1_someuser/Maildir which cannot be correct. Then use the same path in your script (of course, use the correct variables for the web ID and the username).
sorry to revive this old thread but I found a plugin for squirrelmail that does exactly this. here is the description of the plugin: This plugin automates creation of special folders and subscriptions. It tries to provide options that are available only in some IMAP servers. If your IMAP server provides similar tools, it is strongly recommended to use IMAP server's tools instead of this plugin. http://www.squirrelmail.org/plugin_view.php?id=245
Hi Tenaka, sorry to revive this old thread again, but I was trying to achieve the same thing and after installing the Squirrelmail package from the ISPConfig site, I noticed that you can set an option in the Squirrelmail config to "Auto Create Special Folders" without installing the plugin. I used the config perl script: /home/admispconfig/ispconfig/web/squirrelmail/config/conf.pl and "Set pre-defined settings for specific IMAP servers" to courier, then option 3 is "Folder Defaults", and option 16 is "Auto Create Special Folders". Of course I guess this only works if you're using Squirrelmail. Did you find another way?