2 chroot issues, one 'solved', one issue and question left (chroot and SMTP via PHP)


I have setup my Debian 9 server with the latest Virtualmin version. It’s running very well. Only I discovered two issues with chroot. I solved one (maybe needs a permanent fix for everybody in Virtualmin code). The other issue is not solved yet.

Issue 1 (solved): PHP is failing on multiple random functions. This was because ‘zoneinfo’ was missing. When I copied zoneinfo from /usr/share to my chrooted directory, it started working fine.
/home/chroot/VMINSERVERID/usr/share$ ls
perl perl5 terminfo vim zoneinfo

Issue 2 (not solved!):
PHP cannot send mails via an external SMTP server when chroot is active. It cannot create socket then.
Once I disable chroot for domain the email starts working.

Is there a way to fix this?

Thanks in advance


What error did you find in the VIrtual Server’s “error_log” when it was enabled?