Control Web Panel
WebPanel => E-Mail => Topic started by: Bestariweb Hosting on April 17, 2015, 06:38:04 AM
-
I have install Centos 6 with disk partition like this:
Filesystem Size Used Avail Use% Mounted on
rootfs 20G 9.7G 8.6G 54% /
/dev/root 20G 9.7G 8.6G 54% /
devtmpfs 3.9G 320K 3.9G 1% /dev
/dev/sda2 898G 158G 694G 19% /home
tmpfs 3.9G 0 3.9G 0% /dev/shm
/dev/root 20G 9.7G 8.6G 54% /var/named/chroot/etc/named
/dev/root 20G 9.7G 8.6G 54% /var/named/chroot/var/named
/dev/root 20G 9.7G 8.6G 54% /var/named/chroot/etc/named.conf
/dev/root 20G 9.7G 8.6G 54% /var/named/chroot/etc/named.rfc1912.zones
/dev/root 20G 9.7G 8.6G 54% /var/named/chroot/etc/rndc.key
/dev/root 20G 9.7G 8.6G 54% /var/named/chroot/usr/lib64/bind
/dev/root 20G 9.7G 8.6G 54% /var/named/chroot/etc/named.iscdlv.key
/dev/root 20G 9.7G 8.6G 54% /var/named/chroot/etc/named.root.key
is it possible to change mailbox folder from /var/vmail/domainname.com/account-name/ to another (example: /home/account/vmail/domainname.com/account-name/) ?
Thank you
-
Even I wanna know this. @Admin kindly reply
-
I have tried to supply you a script to do that but i think you cannot do that without cwp code changes. (and you cannot do that) so i don't think you can do.
For sure, you can move files, create a symlink and so on, the problem comes when you create the new inboxes.
You have to check wich user is the target of that domain inbox. This check has to be performed each time you move a folder and each time you create a new inbox, so it's a task of the CWP.
I don't figure out how can you check for user, otherwise you will not known where /home folder to put them.
-
probably the best way to test it would be creating a sym link.
-
probably the best way to test it would be creating a sym link.
This is partially true.
The symlink cannot handle a scenario with accounts set up with subdomains.
There isn't a way to check wich user have wich sudomain from a symlink... so if the cwp doesn't handle with that you will got UGLY fails when a user sets up a new account with an present domain.
-
I found a way, dont know it's exactly the same as your looking for but all the auto email creation stuff works and everything BUT if you rebuild the mail config for whatever reason you must do this again
this file also demonstrates me putting email in /home to follow the quota requirements change as your build needs this
tested on xfs system only
edit the main dovecot file
nano /etc/dovecot/dovecot.conf
and make sure
mail_location = maildir:/home/%u/%d/%n
save and exit
now the wierd part
edit this one
nano /etc/dovecot/dovecot-mysql.conf
and change all the /var/vmail links to the path you need mine is posted bellow
# following should all be on one line.
password_query = SELECT username as user, password, concat('/home/%d/', maildir) as userdb_home, concat('maildir:/home/%d/', maildir) as userdb_mail, 101 as userdb_uid, 12 as userdb_gid FROM mailbox WHERE username = '%u' AND active = '1'
# following should all be on one line
user_query = SELECT concat('/home/%d/', maildir) as home, concat('maildir:/home/%d/', maildir) as mail, 101 AS uid, 12 AS gid, CONCAT('*:messages=0:bytes=', quota) as quota_rule FROM mailbox WHERE username = '%u' AND active = '1'
iterate_query = SELECT username AS user FROM mailbox
I hope this helps it did work for me make sure to restart the dovecot service, and also move the email if needed it will not copy it
-
Thanks a lot @wes
The file
/etc/dovecot/dovecot-mysql.conf
will of course be updated by the CWP auto update feature, how are you doing about this?
;)
I found a way, dont know it's exactly the same as your looking for but all the auto email creation stuff works and everything BUT if you rebuild the mail config for whatever reason you must do this again
this file also demonstrates me putting email in /home to follow the quota requirements change as your build needs this
tested on xfs system only
edit the main dovecot file
nano /etc/dovecot/dovecot.conf
and make sure
mail_location = maildir:/home/%u/%d/%n
save and exit
now the wierd part
edit this one
nano /etc/dovecot/dovecot-mysql.conf
and change all the /var/vmail links to the path you need mine is posted bellow
# following should all be on one line.
password_query = SELECT username as user, password, concat('/home/%d/', maildir) as userdb_home, concat('maildir:/home/%d/', maildir) as userdb_mail, 101 as userdb_uid, 12 as userdb_gid FROM mailbox WHERE username = '%u' AND active = '1'
# following should all be on one line
user_query = SELECT concat('/home/%d/', maildir) as home, concat('maildir:/home/%d/', maildir) as mail, 101 AS uid, 12 AS gid, CONCAT('*:messages=0:bytes=', quota) as quota_rule FROM mailbox WHERE username = '%u' AND active = '1'
iterate_query = SELECT username AS user FROM mailbox
I hope this helps it did work for me make sure to restart the dovecot service, and also move the email if needed it will not copy it
-
Hi,
Are you using this solution?
I'm also interested in changing the mail folder to another location but like said above , future updates could mess things no?
I found a way, dont know it's exactly the same as your looking for but all the auto email creation stuff works and everything BUT if you rebuild the mail config for whatever reason you must do this again
this file also demonstrates me putting email in /home to follow the quota requirements change as your build needs this
tested on xfs system only
edit the main dovecot file
nano /etc/dovecot/dovecot.conf
and make sure
mail_location = maildir:/home/%u/%d/%n
save and exit
now the wierd part
edit this one
nano /etc/dovecot/dovecot-mysql.conf
and change all the /var/vmail links to the path you need mine is posted bellow
# following should all be on one line.
password_query = SELECT username as user, password, concat('/home/%d/', maildir) as userdb_home, concat('maildir:/home/%d/', maildir) as userdb_mail, 101 as userdb_uid, 12 as userdb_gid FROM mailbox WHERE username = '%u' AND active = '1'
# following should all be on one line
user_query = SELECT concat('/home/%d/', maildir) as home, concat('maildir:/home/%d/', maildir) as mail, 101 AS uid, 12 AS gid, CONCAT('*:messages=0:bytes=', quota) as quota_rule FROM mailbox WHERE username = '%u' AND active = '1'
iterate_query = SELECT username AS user FROM mailbox
I hope this helps it did work for me make sure to restart the dovecot service, and also move the email if needed it will not copy it
-
Anyway i've created an symbolic link for the vmail folder and at this time i havent found any issue with the email operations.
Everything seems to be correctly created in the vmail folder and no errors are ocurring .
What exactly are the issues expected with this solution ?
Thanks