disable_functions in php.ini for webmail

Support/Development for PHP
biggles
Forum Regular
Forum Regular
Posts: 806
Joined: Tue Jul 15, 2008 2:38 pm
Location: Sweden
Contact:

Re: disable_functions in php.ini for webmail

Unread post by biggles »

breun wrote:
Anyway, what we're doing might be even more interesting. We're not using Suhosin, but have popen (and exec and all their friends) disabled globally and configure Horde to use SMTP instead of sendmail. Problem solved!
Interesting... How did you do that? I guess it has something to do with horde configuration in /etc/psa-horde/horde/conf.xml
breun
Long Time Forum Regular
Long Time Forum Regular
Posts: 2813
Joined: Sat Aug 20, 2005 9:30 am
Location: The Netherlands

Re: disable_functions in php.ini for webmail

Unread post by breun »

No, not conf.xml, but conf.php. So, /etc/psa-horde/horde/conf.php on Plesk 8 or /etc/psa/webmail/horde/horde/conf.php on Plesk 9.

Change $conf['mailer']['type'] from 'sendmail' to 'smtp' and add this line:

Code: Select all

$conf['mailer']['params']['host'] = 'localhost';
Updates to psa-horde might overwrite this change.
Lemonbit Internet Dedicated Server Management
biggles
Forum Regular
Forum Regular
Posts: 806
Joined: Tue Jul 15, 2008 2:38 pm
Location: Sweden
Contact:

Re: disable_functions in php.ini for webmail

Unread post by biggles »

Works like a charm! Thanks a lot!
breun
Long Time Forum Regular
Long Time Forum Regular
Posts: 2813
Joined: Sat Aug 20, 2005 9:30 am
Location: The Netherlands

Re: disable_functions in php.ini for webmail

Unread post by breun »

With the latest update of psa-horde (psa-horde-3.1.7 build92091210.12) for Plesk 9 the path to conf.php has changed to /etc/psa-webmail/horde/horde/conf.php

Apply the change again there.
Lemonbit Internet Dedicated Server Management
faris
Long Time Forum Regular
Long Time Forum Regular
Posts: 2321
Joined: Thu Dec 09, 2004 11:19 am

Re: disable_functions in php.ini for webmail

Unread post by faris »

Thanks for the update Breun.

Please can this be added to the Wiki? Maybe under "Plesk hints and tips - Horde" (as well as others).
--------------------------------
<advert>
If you want to rent a UK-based VPS that comes with friendly advice and support from a fellow ART fan, please get in touch.
</advert>
breun
Long Time Forum Regular
Long Time Forum Regular
Posts: 2813
Joined: Sat Aug 20, 2005 9:30 am
Location: The Netherlands

Re: disable_functions in php.ini for webmail

Unread post by breun »

Go ahead, it's a wiki. :)
Lemonbit Internet Dedicated Server Management
faris
Long Time Forum Regular
Long Time Forum Regular
Posts: 2321
Joined: Thu Dec 09, 2004 11:19 am

Re: disable_functions in php.ini for webmail

Unread post by faris »

I've never been able to register on it. I forget what the problem was. I'll try again....

EDIT: Hmm... I seem to be registered on the wiki and have been for some time. Interesting.
--------------------------------
<advert>
If you want to rent a UK-based VPS that comes with friendly advice and support from a fellow ART fan, please get in touch.
</advert>
User avatar
mikeshinn
Atomicorp Staff - Site Admin
Atomicorp Staff - Site Admin
Posts: 4149
Joined: Thu Feb 07, 2008 7:49 pm
Location: Chantilly, VA

Re: disable_functions in php.ini for webmail

Unread post by mikeshinn »

EDIT: Hmm... I seem to be registered on the wiki and have been for some time. Interesting.
Its your doppelgänger!
breun
Long Time Forum Regular
Long Time Forum Regular
Posts: 2813
Joined: Sat Aug 20, 2005 9:30 am
Location: The Netherlands

Re: disable_functions in php.ini for webmail

Unread post by breun »

On some servers we use max_load and per_source limits in /etc/xinitd.d/smtp_psa and /etc/xinitd.d/smtps_psa so evildoers cannot overload the server with mail traffic. However, when the server load reaches max_load, this also means webmail users cannot send e-mail. I wanted to configure webmail to use submission (SMTP on port 587), because there are no load limits on that, but somehow setting $conf['mailer']['params']['port'] = 587; does not seem to work (webmail still uses SMTP via port 25). According to various posts I found this setting should work for Horde. Anyone here has any ideas?
Lemonbit Internet Dedicated Server Management
faris
Long Time Forum Regular
Long Time Forum Regular
Posts: 2321
Joined: Thu Dec 09, 2004 11:19 am

Re: disable_functions in php.ini for webmail

Unread post by faris »

Could it be because submission requires auth, and even localhost has to auth?

Faris.
--------------------------------
<advert>
If you want to rent a UK-based VPS that comes with friendly advice and support from a fellow ART fan, please get in touch.
</advert>
breun
Long Time Forum Regular
Long Time Forum Regular
Posts: 2813
Joined: Sat Aug 20, 2005 9:30 am
Location: The Netherlands

Re: disable_functions in php.ini for webmail

Unread post by breun »

I think you're right, faris. Though I didn't expect Horde to fall back to trying port 25 after trying port 587 without auth and then give an error message about port 25 when it is not available (disabled it for testing), but that might be what's happening here. I'll dig in some more when I have time.
Lemonbit Internet Dedicated Server Management
BruceLee
Forum Regular
Forum Regular
Posts: 879
Joined: Sat Mar 28, 2009 6:58 pm
Location: Germany

Re: disable_functions in php.ini for webmail

Unread post by BruceLee »

thanks breun for the solution to get rid of the php limitations.
I have configured to use smtp in horde. But I have a problem with mails people send from horde to an account that is located on the server.
due to graylisting via spamdyke people are not able to send mails wiht this error:
Failed to add recipient: mail@domain.tld [SMTP: Invalid response code received from server (code: 421, response: Your address has been graylisted. Try again later.)]"
127.0.0. is whitlisted.
anyone have a clue how to get rid of this?
thanks for any help
breun
Long Time Forum Regular
Long Time Forum Regular
Posts: 2813
Joined: Sat Aug 20, 2005 9:30 am
Location: The Netherlands

Re: disable_functions in php.ini for webmail

Unread post by breun »

Since there is no local queue involved when using SMTP sending the message has to succeed at the first try or, well... it will fail. :)

So yeah, graylisting is not compatible with using SMTP for webmail.
Lemonbit Internet Dedicated Server Management
BruceLee
Forum Regular
Forum Regular
Posts: 879
Joined: Sat Mar 28, 2009 6:58 pm
Location: Germany

Re: disable_functions in php.ini for webmail

Unread post by BruceLee »

thanks breun, that makes sence. maybe the submission port would work.
have you tried changing port number in this file to set port 587?
/etc/psa-webmail/horde/imp/servers.php

baesd on:
http://kb.parallels.com/article_22_837_en.html
breun
Long Time Forum Regular
Long Time Forum Regular
Posts: 2813
Joined: Sat Aug 20, 2005 9:30 am
Location: The Netherlands

Re: disable_functions in php.ini for webmail

Unread post by breun »

Last time I checked Horde configs contain code that hardcode port 25 for SMTP. If you manage to convince Horde to use port 587 you will also need to configure authentication somehow.
Lemonbit Internet Dedicated Server Management
Post Reply