incoming.pl outgoing.pl ownership is your gmail user/group.
I presume that as gmail user u have logged in to shell and run
*/10 * * * * /path/to/your/outgoing.pl run every 10 minutes.
*/5 * * * * /path/to/your/incoming.pl run every 5 minutes.
If this be it, then it is really unclear to me as to how your data/msgs got root ownership to begin with. It's not the cronjob but the crontab file of the user that i was referring to.
Also, if webmail.cgi/admin.cgi/ etc is also running as gmailuser, then how come the data/users/... got root ownership? You have configured your gmail as catchall mode I believe. If it's the pipe mode or something , then i have no experience on the same.