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

Do you like HowtoForge? Please consider supporting us by becoming a subscriber.
Reply
 
Thread Tools Display Modes
  #1  
Old 5th August 2011, 09:02
osterhase osterhase is offline
Member
 
Join Date: Jul 2011
Location: Germany
Posts: 61
Thanks: 6
Thanked 7 Times in 5 Posts
Default Changing the location of the sieve-filter-file

Hi there!

My story to migrate from an postfixadmin administrated mail-server to an ISPConfig managed one goes on: It all worked fine so far. The database is in place and existing users are able to send and receive mail. Their mailfilters are respected and used.

I've figured that ISPConfig is using a slightly different directory structure when a new mailbox is created than has been used before. Especially the filter-rule-file is created on a different place.

The location of the filterrule file in the current setup is /var/vmail/[domain]/[user]/sieve/dovecot.sieve whereas ISPConfig wants to use /var/vmail/[domain]/[user]/sieve

At first I've modfied /etc/dovecot/dovecot-sql.conf as follows:
Code:
user_query = SELECT email as user, maildir as home, CONCAT('maildir:', maildir, '') as mail, uid, gid, CONCAT('maildir:storage=', floor(quota/1024)) AS quota, CONCAT(maildir, '/sieve/dovecot.sieve') as sieve FROM mail_user WHERE email = '%u'
Next I've taught ISPConfig in /usr/local/ispconfig/server/plugins-enabled/maildeliver_plugin.inc.php the new location of the filterrule:
[Line 99]:
Code:
$sieve_file = $data["new"]["maildir"].'/sieve/dovecot.sieve';
My next problem is that in /usr/local/ispconfig/server/plugins-enabled/mail_plugin.inc.php the subfolder "sieve" is not created. I would like to create that folder when the subfolders Junk, Trash, Sent and Inbox are created. Due it is a normal folder and not a maildir I can't use existing code. To admit that: I'm not much of a php-coder. Is it sufficient to add the creation of that folder in the mentioned file - and - (I feel a bit ashamed) with which code-line?

The next point whereas ISPConfig creates a separate "Maildir" in a newly created mailbox, I want to have the folders Junk, Trash, Sent and the Inbox directly in /var/vmail/[domain]/[user]. So I have simply removed that bit in the mail_plugin.inc.php, from:
Code:
$maildomain_path .= '/Maildir';
to
Code:
$maildomain_path .= '';
two times. Is that suffiecient to fulfill my goal?

I would appreciate any help.

Uuh... btw: ISPConfig 3.0.3.3, Debain Squeeze (6.0), Postfix, Dovecot
Reply With Quote
Sponsored Links
  #2  
Old 5th August 2011, 09:13
till till is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 36,177
Thanks: 829
Thanked 5,414 Times in 4,257 Posts
Default

Quote:
My next problem is that in /usr/local/ispconfig/server/plugins-enabled/mail_plugin.inc.php the subfolder "sieve" is not created. I would like to create that folder when the subfolders Junk, Trash, Sent and Inbox are created. Due it is a normal folder and not a maildir I can't use existing code. To admit that: I'm not much of a php-coder. Is it sufficient to add the creation of that folder in the mentioned file - and - (I feel a bit ashamed) with which code-line?
The command to create a directory is:

mkdir("/path/to/the/directory");

Quote:
two times. Is that suffiecient to fulfill my goal?
Yes. But be aware that some email client will complain when you use a structure without the Maildir directory. We had that before but it causes errors in outlook if I remember correctly, as outlook requires that no other files or folders are in the directory that contains the mailfolders, otherwise it will display the foolders in the imap folder list and will show a error if someone tries to subscribe to that "non maildir" folder.
__________________
Till Brehm
--
Get ISPConfig support and the ISPConfig 3 manual from ispconfig.org.
Reply With Quote
  #3  
Old 5th August 2011, 09:31
osterhase osterhase is offline
Member
 
Join Date: Jul 2011
Location: Germany
Posts: 61
Thanks: 6
Thanked 7 Times in 5 Posts
Default

Hey till - thanks for your fast response. You really keep me crackin'

That MUAs throw errors on non-maildir-folders is quite news to me. Maybe I was just lucky my clients did not use such MUAs... (to change that stuff would be quite a major fuck-off). Anyways - have to prepare for a journey. I'll answer back as soon as I'm able to.
Reply With Quote
  #4  
Old 15th August 2011, 12:50
osterhase osterhase is offline
Member
 
Join Date: Jul 2011
Location: Germany
Posts: 61
Thanks: 6
Thanked 7 Times in 5 Posts
 
Default

I do not mean to rise this from the dead, but for the sake of completeness:

Code:
if(!is_dir($data['new']['dir'].'/sieve')) {
	mkdir($maildomain_path.'/sieve', 0700);
	exec("chown ".escapeshellcmd($mail_config['mailuser_name']).":".escapeshellcmd($mail_config['mailuser_group'])." ".escapeshellcmd($maildomain_path)."/sieve");
}
Thanks for your help!
Reply With Quote
The Following User Says Thank You to osterhase For This Useful Post:
falko (16th August 2011)
Reply

Bookmarks

Tags
filter, sieve

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
Postfix delivery problem erebus Installation/Configuration 8 29th July 2014 20:17
Freeradius and Mysql uvstudios HOWTO-Related Questions 4 19th February 2014 12:11
Forbidden 403; Samba access; config of maildeamon fawkes Installation/Configuration 4 14th January 2010 18:16
Chroot SSH + ISPConfig Norman Installation/Configuration 27 26th March 2007 03:40
Systemimager (rsync) doesn't copy all comedit HOWTO-Related Questions 11 19th January 2007 17:17


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


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