• Dear Pleskians! The Plesk Forum will be undergoing scheduled maintenance on Monday, 7th of July, at 9:00 AM UTC. The expected maintenance window is 2 hours.
    Thank you in advance for your patience and understanding on the matter.

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