Go Back   HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials > ISPConfig 2 > Tips/Tricks/Mods

Do you like HowtoForge? Please consider supporting us by becoming a subscriber.
Reply
 
Thread Tools Display Modes
  #1  
Old 17th April 2006, 06:08
hastlaug hastlaug is offline
Member
 
Join Date: Apr 2006
Posts: 30
Thanks: 0
Thanked 1 Time in 1 Post
Default Some hints for Horde IMP with ISPConfig

Although this post seems long: Read it - it's (almost) just copy and paste in 2 positions. No big changes. Don't be afraid

If you setup Horde IMP as webmailer, you might want to have the sender mail address and the sender name correctly be set.

That's not that easy because you need (non-existing) hook functions retrieving the data. But as I wrote such functions for me, you don't need to do this again

First locate the horde config files.
In horde3/config/prefs.php change the following:

Code:
$_prefs['fullname'] = array(
    'value' => '',
    'locked' => false,
    'shared' => true,
    'type' => 'text',
    'hook' => true,
    'desc' => _("Your full name:")
);

$_prefs['from_addr'] = array(
    'value' => '',
    'locked' => true,
    'shared' => true,
    'type' => 'text',
    'hook' => true,
    'desc' =>  _("Your From: address:")
);
Especially 'hook' has to be true. I suggest setting 'locked' of 'from_addr' to true if you don't want users to be able to modify their from-address.

Then you have to add the following to your horde3/config/hooks.php:

Code:
if (!function_exists('_prefs_hook_from_addr')) {
  function _prefs_hook_from_addr($user=null) {
    $dsn = 'mysql://sqluser:sqlpass@localhost/db_ispconfig';

    if (is_null($user)) {
      $user = Auth::getAuth();
    }

    $db =& DB::connect($dsn, true);
    if (PEAR::isError($db)) {
      return $user;
    }

    $query  = 'SELECT user_email,domain_domain FROM (isp_isp_user INNER JOIN isp_dep ON (isp_isp_user.doc_id=child_doc_id AND isp_isp_user.doctype_id=child_doctype_id))';
    $query .= ' INNER JOIN isp_isp_domain ON (parent_doc_id=isp_isp_domain.doc_id AND parent_doctype_id=isp_isp_domain.doctype_id) WHERE user_username=' . $db->quote($user);
    $result =& $db->query($query);

    if ($result->fetchInto($row, DB_FETCHMODE_ASSOC)) {
      $return = $row['user_email'] . "@" . $row['domain_domain'];
    } else {
      $return = $query;
    }

    $db->disconnect();

    return $return;
  }
}

if (!function_exists('_prefs_hook_fullname')) {
  function _prefs_hook_fullname($user=null) {
    $dsn = 'mysql://sqluser:sqlpass@localhost/db_ispconfig';

    if (is_null($user)) {
      $user = Auth::getAuth();
    }

    $db =& DB::connect($dsn, true);
    if (PEAR::isError($db)) {
      return $user;
    }

    $query = 'SELECT * FROM isp_isp_user WHERE user_username=' . $db->quote($user);
    $result =& $db->query($query);

    if ($result->fetchInto($row, DB_FETCHMODE_ASSOC)) {
      $return = $row['user_name'];
    } else {
      $return = $user;
    }

    $db->disconnect();

    return $return;
  }
}
Make sure you replace sqluser by your sql user with sufficient rights to query the ispconfig database and replace sqlpassword by its password. Maybe you also want to replace localhost by the correct sql server and db_ispconfig by the correct sql database. Please note that you have these changes TWO times in the code above.

Done

Last edited by hastlaug; 18th April 2006 at 00:37.
Reply With Quote
The Following User Says Thank You to hastlaug For This Useful Post:
ghesty (17th August 2007)
Sponsored Links
  #2  
Old 2nd May 2006, 23:07
Cirox Cirox is offline
Member
 
Join Date: Mar 2006
Posts: 36
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi,

thx for your hints.

greetings cirox
Reply With Quote
  #3  
Old 15th July 2006, 12:26
SupuS SupuS is offline
HowtoForge Supporter
 
Join Date: May 2006
Posts: 196
Thanks: 66
Thanked 13 Times in 11 Posts
Default

Hi

I have mysql 5 and horde 3.1.2 and your script doesn't work for me as it should .. sql query:

Code:
$query  = 'SELECT user_email,domain_domain FROM (isp_isp_user INNER JOIN isp_dep ON (isp_isp_user.doc_id=child_doc_id AND isp_isp_user.doctype_id=child_doctype_id))';
    $query .= ' INNER JOIN isp_isp_domain ON (parent_doc_id=isp_isp_domain.doc_id AND parent_doctype_id=isp_isp_domain.doctype_id) WHERE user_username=' . $db->quote($user);
    $result =& $db->query($query);
returns 0 rows so if I want to send mail I see this query instead of email adress.

I'm not so good in sql lang and I am not able to find the thing what can resolve this problem. Any hints please?

Little note: in new version of horde I had to add

Code:
require_once 'DB.php';
before

Code:
$db =& DB::connect($dsn, true);
Reply With Quote
The Following User Says Thank You to SupuS For This Useful Post:
ghesty (17th August 2007)
  #4  
Old 28th March 2007, 19:19
johnquilmes johnquilmes is offline
Junior Member
 
Join Date: Jan 2007
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default Horde Groupware Webmail Edition

are you probe Horde Groupware Webmail Edition and install with ispconfig??

help my.. please,...!!
Reply With Quote
  #5  
Old 18th July 2007, 15:52
mthalmei mthalmei is offline
Junior Member
 
Join Date: Jul 2007
Posts: 1
Thanks: 0
Thanked 1 Time in 1 Post
Default

Thanks for this great hook.

But unfortunately as already written above this does not seem to be working with recent versions of horde and ispconfig.

I have investigated a little bit and found that by using the table isp_isp_web instead of isp_isp_domain this seems to work.

The code schould look like this:
PHP Code:
$query  'SELECT user_email,web_domain FROM (isp_isp_user INNER JOIN isp_dep ON (isp_isp_user.doc_id=child_doc_id AND isp_isp_user.doctype_id=child_doctype_id))';
$query .= ' INNER JOIN isp_isp_web ON (parent_doc_id=isp_isp_web.doc_id AND parent_doctype_id=isp_isp_web.doctype_id) WHERE user_username=' $db->quote($user);

...

$return $row['user_email'] . "@" $row['web_domain']; 
Reply With Quote
The Following User Says Thank You to mthalmei For This Useful Post:
ghesty (17th August 2007)
  #6  
Old 14th February 2008, 02:15
whitlebitle whitlebitle is offline
Junior Member
 
Join Date: Jan 2008
Posts: 17
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Is horde works with ISPCONFIG without a problem ?
Reply With Quote
  #7  
Old 26th February 2008, 13:58
gorni gorni is offline
Junior Member
 
Join Date: Feb 2008
Posts: 6
Thanks: 1
Thanked 0 Times in 0 Posts
Default

Yes, Horde Groupware Webmail Edition 1.1 RC2 perfectly works out of the box on ISPConfig 2.2.21. And also does the hooks mentionned above, with Mthalmei's patch...
Reply With Quote
  #8  
Old 27th February 2008, 02:03
whitlebitle whitlebitle is offline
Junior Member
 
Join Date: Jan 2008
Posts: 17
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thank you!

Where to download it and how to setup it to be like www.domain.com/webmail

like it is with uebimiau direct to domain.com/webmail

And is it possible to be setup without https like it is with packagaes: uebimiau and squirremail?
Reply With Quote
  #9  
Old 27th February 2008, 04:10
gorni gorni is offline
Junior Member
 
Join Date: Feb 2008
Posts: 6
Thanks: 1
Thanked 0 Times in 0 Posts
Default

You may download it from the Horde website at http://www.horde.org.

It just installs like any other PHP/MySQL web application on ISPConfig. Horde specific installation instructions are bundled in the package.

Horde will act like any ISPConfig site: you may or may not activate SSL (https) on it, at your convenience.
Reply With Quote
  #10  
Old 27th February 2008, 05:24
whitlebitle whitlebitle is offline
Junior Member
 
Join Date: Jan 2008
Posts: 17
Thanks: 0
Thanked 0 Times in 0 Posts
 
Default

Gorni,

Thank you very much.

On additional question: Does 2008-02-15: Horde Groupware Webmail Edition 1.0.5
works great as well on ispconfig ?
Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
cannot access ispconfig site Nu2Linux Installation/Configuration 13 3rd January 2009 15:29
FC4 Setup DNS and ISPCONFIG issues The General Installation/Configuration 7 15th May 2006 09:45
Users and websites aren't created Glorfindel Installation/Configuration 9 23rd February 2006 04:20
42goISP vs. ISPConfig nveid General 1 16th January 2006 09:07
Mirroring ISPConfig with DRBD rodriglm General 5 2nd January 2006 12:48


All times are GMT +2. The time now is 16:57.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.