• Please be aware: Kaspersky Anti-Virus has been deprecated
    With the upgrade to Plesk Obsidian 18.0.64, "Kaspersky Anti-Virus for Servers" will be automatically removed from the servers it is installed on. We recommend that you migrate to Sophos Anti-Virus for Servers.
  • The Horde webmail has been deprecated. Its complete removal is scheduled for April 2025. For details and recommended actions, see the Feature and Deprecation Plan.
  • We’re working on enhancing the Monitoring feature in Plesk, and we could really use your expertise! If you’re open to sharing your experiences with server and website monitoring or providing feedback, we’d love to have a one-hour online meeting with you.

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