• Introducing WebPros Cloud - a fully managed infrastructure platform purpose-built to simplify the deployment of WebPros products !  WebPros Cloud enables you to easily deliver WebPros solutions — without the complexity of managing the infrastructure.
    Join the pilot program today!
  • Support for BIND DNS has been removed from Plesk for Windows due to security and maintenance risks.
    If a Plesk for Windows server is still using BIND, the upgrade to Plesk Obsidian 18.0.70 will be unavailable until the administrator switches the DNS server to Microsoft DNS.

How to enable disabled php functions only to webmail?

DoniyorS

New Pleskian
For security reasons we are disabling certain php functions for all domains thru custom /etc/php.d/security.ini , but then webmail stops to work. How we can enable that functions only to webmail but keeping it disabled for all domains?
 
In what way does webmail stop working?

If we are talking about horde and all that's wrong is that you can't send messages, then you can make a configuration change in horde to solve this problem. The issue is that by default horde tries to send messages via sendmail, which is prevented if you disable certain php functions.

Horde can instead be configured to use SMTP -- and this works fine with the usual set of "dangerous" php functions disabled.

The changes need to be made in horde's conf.php. I think it is in somewhere like /etc/psa/webmail/horde/horde/conf.php but if it isn't there I'm sure you'll be able to find it.

Look for $conf['mailer']['type'] in that file, and change it from sendmail to smtp
Then add a new line directly beneath it: $conf['mailer']['params']['host'] = 'localhost';

This tip was originally posted by fellow PPE "breun", so if this solution works for you then he is the person to say thanks to :)
 
Thank you, It worked!
conf.php was under /etc/psa-webmail/horde/horde (also under /usr/share/psa-horde/config)
It had option "if safemode=1 then smtp else sendmail" i commented out "sendmail" and "if" and leaved only smtp with auth=true (because i disabled localhost from trusted list. spammers were hacking clients web sites and were sending tons of spams via script from localhost)

Unfortunatly i couldn't find conf file for atmail to use smtp, so i just disabled it.
 
Back
Top