Also, at the moment, I am not able to log into Squirrelmail. I have added my site (moodle) to my server and redirected apache to point to /var/www/moodle and am now not able to log into /webmail. Any ideas how to rectify this problem also?
First you should undo your changes in apache. Sites get added trogh ispconfig and ispconfig creates the directories where the site files ahve to be uploaded. So if you site is e.g. named mydomain.tld, then the web directory for your site is /var/www/mydomain.tld/web/ and not /var/www/moodle/
The imap connection does not work because the maildir yould not be created by ispconfig. Check if there are any jobs in the jobqueue in the ispconfig monitor and if there are any errors listed in the system log in the ispconfig monitor. Beside that, did you modify any paths in ispconfig under System > server config ?