Go Back   HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials > ISPConfig 2 > Installation/Configuration

Do you like HowtoForge? Please consider supporting us by becoming a subscriber.
Reply
 
Thread Tools Display Modes
  #1  
Old 5th November 2005, 22:55
themachine themachine is offline
Senior Member
 
Join Date: Oct 2005
Location: Texas, USA
Posts: 109
Thanks: 0
Thanked 0 Times in 0 Posts
Default 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
Reply With Quote
Sponsored Links
  #2  
Old 6th November 2005, 14:23
falko falko is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 41,701
Thanks: 1,900
Thanked 2,741 Times in 2,575 Posts
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/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.
__________________
Falko
--
Download the ISPConfig 3 Manual! | Check out the ISPConfig 3 Billing Module!

FB: http://www.facebook.com/howtoforge

nginx-Webhosting: Timme Hosting | Follow me on:
Reply With Quote
  #3  
Old 6th April 2006, 21:23
Cirox Cirox is offline
Member
 
Join Date: Mar 2006
Posts: 36
Thanks: 0
Thanked 0 Times in 0 Posts
Default

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.
Reply With Quote
  #4  
Old 6th April 2006, 22:40
falko falko is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 41,701
Thanks: 1,900
Thanked 2,741 Times in 2,575 Posts
Default

Have a look at
Code:
man maildirmake
It should give you an idea.
__________________
Falko
--
Download the ISPConfig 3 Manual! | Check out the ISPConfig 3 Billing Module!

FB: http://www.facebook.com/howtoforge

nginx-Webhosting: Timme Hosting | Follow me on:
Reply With Quote
  #5  
Old 7th April 2006, 09:36
Cirox Cirox is offline
Member
 
Join Date: Mar 2006
Posts: 36
Thanks: 0
Thanked 0 Times in 0 Posts
Default

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
Reply With Quote
  #6  
Old 7th April 2006, 11:49
falko falko is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 41,701
Thanks: 1,900
Thanked 2,741 Times in 2,575 Posts
Default

Do you have PHP programming knowledge? You could do it with a foreach loop, for example.
__________________
Falko
--
Download the ISPConfig 3 Manual! | Check out the ISPConfig 3 Billing Module!

FB: http://www.facebook.com/howtoforge

nginx-Webhosting: Timme Hosting | Follow me on:
Reply With Quote
  #7  
Old 7th April 2006, 15:28
Cirox Cirox is offline
Member
 
Join Date: Mar 2006
Posts: 36
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi,

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

greetings cirox
Reply With Quote
  #8  
Old 8th April 2006, 01:53
falko falko is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 41,701
Thanks: 1,900
Thanked 2,741 Times in 2,575 Posts
Default

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 ...");

__________________
Falko
--
Download the ISPConfig 3 Manual! | Check out the ISPConfig 3 Billing Module!

FB: http://www.facebook.com/howtoforge

nginx-Webhosting: Timme Hosting | Follow me on:
Reply With Quote
  #9  
Old 30th April 2006, 11:07
Cirox Cirox is offline
Member
 
Join Date: Mar 2006
Posts: 36
Thanks: 0
Thanked 0 Times in 0 Posts
Default

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
Reply With Quote
  #10  
Old 30th April 2006, 14:27
falko falko is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 41,701
Thanks: 1,900
Thanked 2,741 Times in 2,575 Posts
 
Default

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 ...");
  } 
__________________
Falko
--
Download the ISPConfig 3 Manual! | Check out the ISPConfig 3 Billing Module!

FB: http://www.facebook.com/howtoforge

nginx-Webhosting: Timme Hosting | Follow me on:
Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Virtual Users And Domains With Postfix, Courier And MySQL (+ SMTP-AUTH, Quota, SpamAs pontifex HOWTO-Related Questions 2 26th October 2005 17:54
Cyrus IMAP Configuration ?? kisong Installation/Configuration 20 26th October 2005 17:15
webpages only display default site bosei Installation/Configuration 9 9th September 2005 21:25
30 Default Imap Folders? adamluz Installation/Configuration 9 18th August 2005 23:45
my default webserver failed Venkatesh.S General 1 25th July 2005 10:11


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


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