I have a CENTOS server running directadmin. The folder '/home/[account]/imap' and subfolders of this folder contain all email from the emailaccounts associated with this user. If i now run the following PHP code on one of the websites:
die(json_encode(scandir("/home/[account]/imap")));
I get the full email content of these mailboxes, which means php can just access all of the imap email. Because of this, it could only take a single malicious wordpress plugin or composer package to have all my emails leaked!
I would like to prevent php running on the server from accessing these folders. When i search google about this issue, nothing relevant comes up. This worries me. Does this mean that everyone has this 'problem'? Or is my directadmin/server just misconfigured?
Is there some setting in PHP, DirectAdmin or the server that i overlooked?
I have also thought about splitting the MAILserver from the WEBserver over 2 accounts for extra security. Could not find any information on this either?
Best regards and best wishes for 2023!
die(json_encode(scandir("/home/[account]/imap")));
I get the full email content of these mailboxes, which means php can just access all of the imap email. Because of this, it could only take a single malicious wordpress plugin or composer package to have all my emails leaked!
I would like to prevent php running on the server from accessing these folders. When i search google about this issue, nothing relevant comes up. This worries me. Does this mean that everyone has this 'problem'? Or is my directadmin/server just misconfigured?
Is there some setting in PHP, DirectAdmin or the server that i overlooked?
I have also thought about splitting the MAILserver from the WEBserver over 2 accounts for extra security. Could not find any information on this either?
Best regards and best wishes for 2023!
Last edited: