ispCP - Board - Support
Problem with ispCP folders - Printable Version

+- ispCP - Board - Support (http://www.isp-control.net/forum)
+-- Forum: ispCP Omega Support Area (/forum-30.html)
+--- Forum: System Setup & Installation (/forum-32.html)
+--- Thread: Problem with ispCP folders (/thread-11413.html)



Problem with ispCP folders - NIIcK - 08-17-2010 03:47 AM

Hello,

I had a hard drive mounted on /home that crashed. Upon installing ispCP I've instructed it to create all mail boxes in the /home/hosting/mail/virtual/ folder but since this hard drive crashed I had to mount /home into a new hard drive.

My question is: is there a script or something I can run so ispCP would create all the domain and users folders into the /home/hosting/mail/virtual/ folder as well as setting up all permissions without destroying my current configuration?

Thank you,

Nick


RE: Problem with ispCP folders - kilburn - 08-17-2010 05:17 PM

If I remember correctly, Maildir folders are automatically created by the delivery agent if they don't exist. Hence, you just have to create the "/home/hosting/mail/virtual" folder, "chown vmail:mail" it and wait for messages to come in...

It is also possible that the delivery agent refuses to create the parent (domain) folder though. If this is the case, you can use a quick script to create all the folders. For example, you could use the "domaint.tld.db" files created for the dns zones as a reference:
Code:
# cd /var/cache/bind
# for f in *.db; do mkdir /home/hosting/mail/virtual/${f%.db}; chown vmail:mail /home/hosting/mail/virtual/${f%.db}; done

Finally, as an alternative, you can also regenerate all the configurations using the ispcp-update (warning: this will regenerate all the panel-controlled configurations!):
Code:
# cp /etc/ispcp.conf /etc/ispcp.conf.old
# cd /var/www/ispcp/engine/setup
# perl ispcp-update
# rm /etc/ispcp.conf.old



RE: Problem with ispCP folders - NIIcK - 08-17-2010 07:02 PM

(08-17-2010 05:17 PM)kilburn Wrote:  If I remember correctly, Maildir folders are automatically created by the delivery agent if they don't exist. Hence, you just have to create the "/home/hosting/mail/virtual" folder, "chown vmail:mail" it and wait for messages to come in...

It is also possible that the delivery agent refuses to create the parent (domain) folder though. If this is the case, you can use a quick script to create all the folders. For example, you could use the "domaint.tld.db" files created for the dns zones as a reference:
Code:
# cd /var/cache/bind
# for f in *.db; do mkdir /home/hosting/mail/virtual/${f%.db}; chown vmail:mail /home/hosting/mail/virtual/${f%.db}; done

Finally, as an alternative, you can also regenerate all the configurations using the ispcp-update (warning: this will regenerate all the panel-controlled configurations!):
Code:
# cp /etc/ispcp.conf /etc/ispcp.conf.old
# cd /var/www/ispcp/engine/setup
# perl ispcp-update
# rm /etc/ispcp.conf.old

Thanks a lot mate! It worked with recreating the mail storage folder and set the right permissions for it. You're the man! Big Grin

Nick