Bizarre problem solved!
I don't know what else to give as a title to this thread, but I thought it's worth posting.
A few weeks ago I started having strange problems with email accounts and DNS.
After a lot of work I realised that at some point overnight the /tmp directory was getting set with restrictive permissions, preventing certain services from using it.
As a temporary fix I set a cron job to reset the permissions.
Now I've found out what was doing the damage!
The new version of ISPConfig has a service to backup websites. It's run frm cron_daily.php. During the proces it checks the permissions of the backup folder and resets them if neccessary. Yes, you've guessed it, my backup directory was set to /tmp so ISPConfig was resetting permissions for the tmp directory.
Problem solved by setting the backup folder in ISPConfig (system:server configuration:server:...) to something other than /tmp!
Hope this solves problems for someone else!