Sorry about being impatient, it's just I'm like a kid when I get a new toy.
Anyhow I figured out the problem. It was caused by the mysql database and the hosts used in the grant entries.
First let me say I am running zimbra in a vserver. And in a vserver localhost has a different behaviour than ordinary server, since localhost resolves to 192.168.XXX.YYY instead of 127.0.0.1 in the /etc/hosts file.
So what I did is I logged into mysql, and changed localhost.localdomain for zimbra-test.myserver.com domain in the user and db tables for user zimbra, and that fixed the problem.
Code:
cd /opt/zimbra/mysql/bin
./mysql -h zimbra-test.unigiciel.com --port 7306
#------
# Mysql code start
use mysql;
update user set Host = 'zimbra-test.myserver.com' where Host = 'localhost.localdomain' and User = 'zimbra' ;
update db set Host = 'zimbra-test.myserver.com' where Host = 'localhost.localdomain' and User = 'zimbra' ;
quit
# Mysql code finished
su - zimbra
zmcontrol stop
zmcontrol start
I figured out the problem wasn't with tomcat but rather with mysql when I noticed this error message in the ~zimbra/log/zimbra.log file.
Code:
java.sql.SQLException
MESSAGE: Access denied for user 'zimbra'@'zimbra-test.unigiciel.com' (using password: YES)
Previously I was only looking at these log files:
/var/log/messages
/var/log/zimbra.log
/opt/zimbra/tomcat/logs/catalina.out