
5th November 2005, 22:55
|
|
Senior Member
|
|
Join Date: Oct 2005
Location: Texas, USA
Posts: 109
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
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.
__________________
themachine
5dollarwhitebox.org
|

6th November 2005, 14:23
|
|
Super Moderator
|
|
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 41,665
Thanks: 1,896
Thanked 2,595 Times in 2,446 Posts
|
|
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/man...dirmake.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.
|

6th April 2006, 21:23
|
|
Member
|
|
Join Date: Mar 2006
Posts: 36
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
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
Last edited by Cirox; 6th April 2006 at 21:50.
|

6th April 2006, 22:40
|
|
Super Moderator
|
|
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 41,665
Thanks: 1,896
Thanked 2,595 Times in 2,446 Posts
|
|
Have a look at It should give you an idea.
|

7th April 2006, 09:36
|
|
Member
|
|
Join Date: Mar 2006
Posts: 36
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
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
|

7th April 2006, 11:49
|
|
Super Moderator
|
|
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 41,665
Thanks: 1,896
Thanked 2,595 Times in 2,446 Posts
|
|
Do you have PHP programming knowledge? You could do it with a foreach loop, for example.
|

7th April 2006, 15:28
|
|
Member
|
|
Join Date: Mar 2006
Posts: 36
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Hi,
i dont have php coding knowledge, thats my problem ....
greetings cirox
|

8th April 2006, 01:53
|
|
Super Moderator
|
|
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 41,665
Thanks: 1,896
Thanked 2,595 Times in 2,446 Posts
|
|
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:
if($mod->system->server_conf["use_maildir"]){ exec("maildirmake ..."); }
|

30th April 2006, 11:07
|
|
Member
|
|
Join Date: Mar 2006
Posts: 36
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
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
|

30th April 2006, 14:27
|
|
Super Moderator
|
|
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 41,665
Thanks: 1,896
Thanked 2,595 Times in 2,446 Posts
|
|
You would use something like this:
PHP 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__);
}
} else {
exec("maildirmake ...");
}
|
| Thread Tools |
|
|
| Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
All times are GMT +2. The time now is 01:01.
|
|
Recent comments
23 hours 39 min ago
1 day 4 hours ago
1 day 9 hours ago
1 day 10 hours ago
2 days 1 hour ago
2 days 1 hour ago
2 days 6 hours ago
2 days 12 hours ago
2 days 13 hours ago
2 days 14 hours ago