Installation Guide: IMP 3.0 on RedHat 7.2



Index
1. Introduction
2. Prerequisites
3. Configuring Apache
    3.1 Configure the VirtualHost
    3.2 Create the directories
    3.3 Test Apache
4. Configuring Horde
    4.1 Download and untar Horde
    4.2 Download and untar Pear
    4.3 Configure mysql
    4.4 Configure Horder config files
    4.5 Test Horde
5. Configuring IMP
    5.1 Download and untar IMP
    5.2 Configure Horde for IMP
    5.3 Configure IMP config files
    5.4 Test IMP
6. Configuring Turba
    6.1 Download and untar Turba
    6.2 Configure Horde for Turba
    6.3 Configure MySQL for Turba
    6.4 Test Turba
7. Configuring poppassd
    7.1 Download and untar poppassd-ceti
    7.2 Download and untar passwd for IMP
    7.3 Configure Horde for Passwd
    7.4 Configure IMP for Passwd
    7.5 Configure Passwd config files
    7.6 Test Passwd
8. Troubleshooting/Notes
9. Links
10. About
















 
 





1. Introduction
In this document we describe step by step instructions on how to configure IMP 3.0 from www.horde.org in a Linux box running RedHat Linux 7.2
This guide may help you configure a basic installation of IMP so you can later tweak IMP to your specific requirement.
We use the .tar.gz instalation method.

After reading this guide you should be able to have up and running:
Horde, IMP, Turba, poppassd and the Passwd module for Horde.

We will use a sample Linux server with this caracteristics:
Intranet IP:
192.168.1.1
Internet IP:
192.168.1.2
Hostname:
mail.example.com
Domain:
example.com
smtp server:
mail.example.com
IMAP server:
WU-IMAP 2000
IMAP host:
localhost
IMAP folder:
~/mail/
SQL server:
MySQL
SQL host:
localhost

Versions used:
RedHat:
7.2
Horde:
2.0
IMP:
3.0
Turba:
1.0
Pear:
4.1.0

Modules Used:
Horde:
PHP Framework
IMP:
Horde IMAP Client
Turba:
Horde Contact Manager
Passwd:
Horde Password changer

Many file will have to be edited in Horde, and to indicate wich file should be edited, we will use a table like this:
here will be the path of the file
here will be the
lines that you should
edit/add in this file




2. Prerequisites
In order to follow this instructions, you need to have RedHat Linux 7.2 and this RPM installed:
apache-1.3.22-2
php-4.0.6-12
php-imap-4.0.6-12
php-ldap-4.0.6-12
php-mysql-4.0.6-12
mysql-3.23.41-1
mysqlclient9-3.23.22-6
mysql-server-3.23.41-1
imap-2000c-15
sendmail-8.11.6-3

I'm sure this guide can be used for other distributions(Debian, SuSE, Mandrake, etc), but I don't have access to them right now.
You need to have all this rpm installed and running. Test that all this rpm are working properly before installing and configuring Horde.

3. Configuring Apache
The installation directory will be:
/var/www/html/mail/

3.1 Configure the VirtualHost
Edit the apache config file and add a VirtualHost :

3.1.1 /etc/httpd/conf/httpd.conf
/etc/httpd/conf/httpd.conf
# add this lines
NameVirtualHost 192.168.1.1
NameVirtualHost 192.168.1.2

<VirtualHost 192.168.1.1 192.168.1.2>
    ServerAdmin webmaster@example.com
    DocumentRoot /var/www/html/mail/horde/imp
    ServerName mail.example.com
    ErrorLog /var/log/httpd/mail/error_log
    CustomLog /var/log/httpd/mail/access_log combined

    Alias /horde /var/www/html/mail/horde/
    Alias /horde/ /var/www/html/mail/horde/
</VirtualHost>

3.2 Create the directories
Create all the necesary directories:
# mkdir -p /var/www/html/mail/horde/imp
# mkdir -p /var/log/httpd/mail/

3.3 Test Apache
restart apache for the changes to take effect:
# service httpd restart
creating a temporary file:
# touch /var/www/html/mail/horde/imp/test.html
and browsing to:
http://mail.example.com/

4. Configuring Horde
Once Apache is setup, we need to configure Horde.

4.1 Download and untar Horde:
# cd /tmp
# wget -c --passive-ftp ftp://ftp.horde.org/pub/horde/tarballs/horde-2.0.tar.gz
# tar xzf horde-2.0.tar.gz -C /var/www/html/mail
# cd /var/www/html/mail
# mv horde-2.0 horde

4.2 Download and untar Pear
In RH7.2, we already have a version of Pear installed in /usr/share/php by the php rpm package, but we need the latest version of Pear from Horde.
So, we backup the Pear version that comes with RedHat and install the new one. Remember that if you update your php rpms, you need to do this procedure again.
# cd /usr/share
# mv php php.4.0.6.redhat
# cd /tmp
# wget -c --passive-ftp ftp://ftp.horde.org/pub/horde/tarballs/pear-4.1.0.tar.gz
# tar xzf pear-4.1.0.tar.gz -C /usr/share
# cd /usr/share
# mv pear-4.1.0 php
# chown root.root -R php

4.3 Configure mysql
Check that mysql is running:
# service mysqld restart
Create the horde database:
# cd horde/scripts/db
# vi mysql_create.sql # choose a password
# mysql < mysql_create.sql # create the tables
Test to see if you can connect to the database:
# mysql -h localhost -u horde -p
Exit mysql with the command 'exit'
If you can't connect, look a the throubleshooting guide before continuing

4.4 Configure Horde config files
Go to:
# cd horde/config
and make a copy of the default configuration files:
# for foo in *.dist; do cp -v $foo `basename $foo .dist`; done
Then edit the folowing files:
4.4.1 /horde/config/horde.php
/horde/config/horde.php
// don't use compresion. RedHat's PHP does not have zlib support
$conf['compress_pages'] = false;

// use IMAP to authenticate users
$conf['auth']['driver'] = 'imap';
$conf['auth']['params'] = array();
$conf['auth']['params']['dsn'] = '{localhost/imap:143}INBOX';

// use MySQL to store Horde Stuff
$conf['prefs']['driver'] = 'sql';
$conf['prefs']['params'] = array();
$conf['prefs']['params']['phptype'] = 'mysql';
$conf['prefs']['params']['hostspec'] = 'localhost';
$conf['prefs']['params']['username'] = 'horde';
$conf['prefs']['params']['password'] = 'my_passwd';
$conf['prefs']['params']['database'] = 'horde';
$conf['prefs']['params']['table'] = 'horde_prefs';

// the sendmail, not SMTP, to send emails
$conf['mailer']['type'] = 'sendmail';

Add the user 'apache' to the list of trusted users to sendmail:
4.4.2 /etc/mail/trusted-users
Allow user apache to send emails as other user
/etc/mail/trusted-users
apache

4.4.3 /horde/config/lang.php
Configure the default language for Horde
/horde/config/lang.php
// look down for the list of aliases
$nls['defaults']['language'] = 'en_US';
//$nls['defaults']['language'] = 'es_ES';

4.5 Test Horde
Test the initial configuration of horde by browsing:
http://mail.example.com/horde/test.php
http://mail.example.com/horde/
If you see some errors, look at the troubleshooting guide before continuing.
5. Configuring IMP
5.1 Download and untar IMP:
# cd /tmp
# wget -c --passive-ftp ftp://ftp.horde.org/pub/imp/tarballs/imp-3.0.tar.gz
# tar xzf imp-3.0.tar.gz -C /var/www/html/mail/horde
# cd /var/www/html/mail/horde
# mv imp-3.0 imp

5.2 Configure Horde for IMP
Edit this files to allow IMP to run under Horde:
5.2.1 /horde/config/registry.php
Register IMP in Horde
/horde/config/registry.php
// uncoment the folowing
$this->registry['auth']['login'] = 'imp';
$this->registry['auth']['logout'] = 'imp';

// uncoment the folowing
$this->applications['imp'] = array(
    'fileroot' => dirname(__FILE__) . '/../imp',
    'webroot' => $this->applications['horde']['webroot'] . '/imp',
    'icon' => '/horde/imp/graphics/imp.gif',
    'name' => _("Mail"),
    'allow_guests' => true,
    'show' => true
);


5.3 Configure IMP config files
Go to:
# cd horde/imp/config
and make a copy of all the default config files:
# for foo in *.dist; do cp -v $foo `basename $foo .dist`; done

Now, edit this IMP config files in /horde/imp/config
5.3.1 /horde/imp/config/servers.php
/horde/imp/config/servers.php
// edit this lines
$servers['imap'] = array(
    'name' => 'IMAP Server',
    'server' => 'localhost',
    'protocol' => 'imap',
    'port' => 143,
    'folders' => 'mail/',
    'namespace' => '',
    'maildomain' => 'example.com',
    'smtphost' => 'mail.example.com',
    'realm' => '',
    'preferred' => 'true'
);


5.3.2 /horde/imp/config/pref.php
Optional, edit this file for better customization
/horde/imp/config/pref.php
// user language
// look at /horde/config/lang.php for language aliases
$_prefs['language'] = array(
    'value' => 'en_US',
    'locked' => false,
    'shared' => true,
    'type' => 'select',
    'desc' => _("Select your preferred language:")
);

// user folder path
// this is the directory under the user home dir
// set it to ~/mail/
$_prefs['folders'] = array(
    'value' => 'mail/',
    'locked' => true,
    'shared' => false,
    'type' => 'text',
    'desc' => _("Path to your mail folders:")
);

// user default mailbox
// the default inbox canot be changed
$_prefs['mailbox'] = array(
    'value' => 'INBOX',
    'locked' => true,
    'shared' => false,
    'type' => 'implicit'
);

// use IMAP subscribe?
// show only folders subscribed by IMAP
$_prefs['subscribe'] = array(
    'value' => 1,
    'locked' => true,
    'shared' => false,
    'type' => 'checkbox',
    'desc' => _("Use IMAP folder subscriptions")
);

// sent mail folder
// Use the same name as in Mozilla, Outlook Express, etc
$_prefs['sent_mail_folder'] = array(
    'value' => 'Sent',
    'locked' => false,
    'shared' => true,
    'type' => 'implicit'
);

// trash folder
// Use the same name as in Mozilla, Outlook Express, etc
$_prefs['trash_folder'] = array(
    'value' => 'Trash',
    'locked' => false,
    'shared' => false,
    'type' => 'implicit'
);


5.4 Test IMP
Now is time to test IMP, browse to:
http://mail.example.com/
and login with a valid username/passwd.
Try sending and email to another server and to yourself.
If you have any troubles, look at the troubleshooting guide before continuing.

6. Configuring Turba
Now we have up and running Horde and IMP and we need a contact manager, alias, Address Book.

6.1 Download and untar Turba
# cd /tmp
# wget -c --passive-ftp ftp://ftp.horde.org/pub/turba/tarballs/turba-1.0.tar.gz
# tar xzf turba-1.0.tar.gz -C /var/www/html/mail/horde
# cd /var/www/html/mail/horde
# mv turba-1.0 turba

6.1.1 Configure Turba config files
# cd horde/turba/config
and make a copy of all the default config files:
# for foo in *.dist; do cp -v $foo `basename $foo .dist`; done

6.2 Configure Horde for Turba
Edit this files to allow Turba to run under Horde.

6.2.1 /horde/config/registry.php
Register Turba in Horde
/horde/config/registry.php
// uncoment this
$this->applications['turba'] = array(
    'fileroot' => dirname(__FILE__) . '/../turba',
    'webroot' => $this->applications['horde']['webroot'] . '/turba',
    'icon' => '/horde/turba/graphics/turba.gif',
     'name' => _("Addressbook"),
    'allow_guests' => false,
     'show' => true
);


6.2.2 /horde/imp/config/conf.php
Configure in IMP an icon for Turba
/horde/imp/config/conf.php
$conf['menu']['apps'] = array('turba');


6.2.3 /horde/turba/config/conf.php
Configure in Turba an icon for IMP
/horde/turba/config/conf.php
$conf['menu']['apps'] = array('imp');


6.2.4 /horde/turba/config/prefs.php
/horde/turba/config/prefs.php
// user language
// set the same default language as Horde and IMP
$_prefs['language'] = array(
    'value' => 'en_US',
    'locked' => false,
    'shared' => true,
    'type' => 'select',
    'desc' => _("Select your preferred language:")
);


6.2.5 /horde/turba/config/sources.php
Configure Turba to use MySQL to store all the contact data
/horde/turba/config/sources.php
// complete this part of the config with the data
// of the database as in /horde/config/horde.php
// Also config the title to a know name in your locale
$cfgSources['localsql'] = array(
    'title' => 'IMP Address Book',
    'type' => 'sql',
    'params' => array(
        'phptype' => 'mysql',
        'hostspec' => 'localhost',
        'username' => 'horde',
        'password' => 'my_passwd',
        'database' => 'horde',
        'options' => '',
        'tty' => '',
        'port' => '5432',
        'protocol' => 'unix',
        'table' => 'turba_objects'
    ),
    ...


6.3 Configure MySQL for Turba
Now create the table in MySQL that Turba will use:
# cd /horde/turba/scripts/drivers/
# mysql < turba.sql
If the root user in MySQL needs a password to connect to the DB, use:
# mysql -u root -p < turba.sql

6.4 Test Turba
To test turba, browse to this address and login in the Turba link:
http://mail.example.com/horde/
Create a new entry in the address book and then go to IMP, then Options
and select to use the address book with name "IMP Address Book".

If you have any troubles, look at the troubleshooting guide before continuing.

7. Configure poppassd
Now that we have configure Horde with IMP and Turba, we need to provide our users with a method to change their password thru Horde.

7.1 Download and untar poppassd-ceti
Poppassd-ceti is a poppassd server that is modified from the poppassd provided from Qualcom/Eudora to support Linux PAM.
# cd /tmp
# wget -c http://www.samera.net/rpm/poppassd-ceti-1.8-4rh72.i386.rpm
# rpm -ivh poppassd-ceti-1.8-4rh72.i386.rpm

Optional: download and compile from the source code
# wget -c http://echelon.pl/pubs/poppassd-1.8.1.tar.gz
# tar xzf poppassd-1.8.1.tar.gz
# cd poppassd-1.8.1
# make
# make install
# vi /etc/xinetd.d/poppassd # create and edit this file
/etc/xinetd.d/poppassd
# default: off
# description: The POPPASSD service allows remote users to change their
#              password remotely via Eudora or NUPOP using a network
#              protocol on port 106.
#
service poppassd
{
        disable = no
        socket_type         = stream
        wait                    = no
        user                    = root
        server                  = /usr/sbin/poppassd
        #only_from             = localhost
        log_on_success     += USERID
        log_on_failure        += USERID
}


Enable the poppassd service:
# ntsysv
# service xinetd restart

7.2 Download and untar passwd for IMP
Download with a SSL capable browser from(only via https):
https://mail.ph.utexas.edu/patches/passwd/HEAD/passwd.tgz
to /tmp
# cd /tmp
# tar xzf passwd.tgz -C /var/www/html/mail/horde/
# cd /var/www/html/mail/horde/
# cd passwd

7.2.1 Configure Passwd config files
# cd horde/passwd/config
and make a copy of all the default config files:
# for foo in *.dist; do cp -v $foo `basename $foo .dist`; done

7.3 Configure Horde for Passwd
Edit Horde config files
7.3.1 /horde/config/registry.php
/horde/config/registry.php
$this->applications['passwd'] = array(
    'fileroot' => dirname(__FILE__) . '/../passwd',
    'webroot' => $this->applications['horde']['webroot'] . '/passwd',
    'icon' => $this->applications['horde']['webroot'] .
                 '/passwd/graphics/lock.gif',
    'name' => _("Password"),
    'allow_guests' => false,
    'show' => true
);


7.3.2 /horde/config/horde.php
Check the admin users in Horde, or you will get errors in Passwd module
/horde/config/horde.php
$conf['auth']['admins'] = array('');


7.4 Configure IMP for Passwd
7.4.1 /horde/imp/config/conf.php
Configure an icon for Passwd in IMP
/horde/imp/config/conf.php
$conf['menu']['apps'] = array('turba', 'passwd');


7.5 Configure Passwd config files
7.5.1 /horde/passwd/config/prefs.php
/horde/passwd/config/prefs.php
// user language
// config se same default language as Horde, IMP, Turba
$_prefs['language'] = array(
    'value' => 'en',
    'locked' => false,
    'shared' => true,
    'type' => 'select',
    'desc' => _("Select your preferred language:")
);


7.5.2 /horde/passwd/config/conf.php
Configure an icon for IMP in Passwd
/horde/passwd/config/prefs.php
$conf['menu']['apps'] = array('imp');


7.6 Test Passwd
Login into Passwd from Horde:
http://mail.example.com/horde/passwd/
and change your password.

Look at /var/log/messages for debug messages.

Any passwd of any lenght will be accepted beacuse poppassd is run as root. Maybe you will get warnings in /var/log/messages about short or easy passwords used, but your password will be changed.

8. Troubleshooting/Notes
Here you can find solutions to common problems

[Still to come, keep those feedback comming]

  • RedHat 7.3
    The instructions for RedHat 7.3 should be same as for RH7.2, just read some special advices for RH7.3 in this section.

  • Poppassd try to change a user passwd in the form: user@domain
    Probably this happends because you are using realms in IMP.
    If you use realms in /horde/imp/config/servers.php you have to configure Passwd not to pass the realm part of the user to poppassd in:
    /horde/passwd/config/conf.php :
    /horde/passwd/config/conf.php
    $conf['passwd']['remove_realm']= true;

  • Can't connect from Horde to the database
    Maybe there is a problem with the user horde. Look at the parameters in 4.4.1 and try using a diferent method to connect to the database using the same user. For example, if you use MySQL, try this command:
    $ mysql -D horde -h hostname -u user -p

  • /bin/passwd and Poppasswd
    If you use md5 and shadow in RedHat 7.2(enabled by default), be sure that the file:
    /etc/pam.d/poppassd
    have the same contents as in:
    /etc/pam.d/passwd
    In other words, /etc/pam.d/poppassd should be the same as /etc/pam.d/passwd:
    # cp -f /etc/pam.d/passwd /etc/pam.d/poppassd

  • Errors in /horde/passwd/templates/main.inc on line 23 ?

    Warning: Undefined index: admins in
    /horde/passwd/templates/main.inc on line 23
    Look at item 7.3.2 for the solution

  • Using PHP 4.1.2 and no IMAP/S
    If you use PHP 4.1.2 and can't connect to your IMAP server and your IMAP server does not support IMAP/S, use this config:
    /horde/imp/config/servers.php
    $servers['imap'] = array(
    ...
        'protocol' => 'imap/notls',
    ...

  • Debug messages in Horde
    To look for debug messages in Horde, configure:
    /horde/config/horde.php
    $conf['log']['enabled'] = true;
    $conf['log']['type'] = 'file';
    $conf['log']['name'] = '/tmp/horde.log';
    $conf['log']['priority'] = LOG_NOTICE;
    // log everything
    // $conf['log']['priority'] = LOG_DEBUG;

    Then look at the file /tmp/horde.log, for example:
    # grep -i error /tmp/horde.log
  • Problem with /tmp/mysql.sock
    I you see this error login into Horde:

    A fatal error has occurred object(db_error)(7) {
     ["error_message_prefix"]=>
     string(0) ""
     ["mode"]=>
     int(1)
     ["level"]=>
     int(1024)
     ["code"]=>
     int(-24)
     ["message"]=>
     string(24) "DB Error: connect failed"
     ["userinfo"]=>
     string(95) " [nativecode=Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)] ** Array"
     ["callback"]=>
     NULL
    }
    [/var/www/html/mail/horde/lib/Prefs/sql.php : 102]
    is because you are using the host 'localhost' as your MySQL host.
    You only need to edit your php.ini file like this:
    /etc/php.ini
    mysql.default_socket = /var/lib/mysql/mysql.sock
    and restart apache with:
    # service httpd restart
    For more information, look at Bug #60515 in bugzilla.redhat.com

  • Replacing sendmail with postfix
    Replace 'sendmail' with 'smtp' in point 4.4.1 like this:
    $conf['mailer']['type'] = 'smtp';
    Then, uninstall sendmail and install postfix.
    (Thanks to: Laurent DUBETTIER-GRENIER)
  • DNS verification
    Verify that you have DNS entries for all your servers.
    You can use this command to find out:
    $ host server.example.com
    (Thanks to: James)

  • Enable file uploads in PHP
    Check that you have file_uploads setup in /etc/php.ini like this:
    file_uploads = On
    In RedHat 7.3, file_uploads are disabled by default.
    (Thanks to: Jason and Aaron Hope)

  • Install pear-4.1.2 from RH 7.3
    As an alternative, you can install the pear rpm from the RedHat 7.3 distribution.
    This will help you maintain an installation based on RPM.
    (Thanks to: Aaron Hope)
  • Using STMP to send emails from IMP
    If you need that all the outgoing mail goes thruh your sendmail server via SMTP, you will have to configure Horde in a diferent way.
    This setup will help you for example if you parse your maillog file or use a Milter filter in sendmail.
    /horde/config/horde.php
    $conf['mailer']['type'] = 'smtp';

    $conf['mailer']['params'] = array();
    $conf['mailer']['params'] = array('server' => 'smtp.example.com');
    $conf['mailer']['params'] = array('port' => '25');

    Note: I tryed using the ssmtp package with IMP 2.x. In IMP 3.x I need more feedback on this setup.

9. Links
Here are the links to all software used in this document


10. About
This is my 0.02$ to the IMP project. Thanks to the Horde Team for this excelent Work!
Please fell free to send me comments and corrections.



Thanks to all the people who contributed or visited this page: Feedback users:
  • Peter Farrow
  • Francisco Ho
  • Jason Reusch
  • Christopher Thompson
  • Laurent DUBETTIER-GRENIER
  • James (no last name sended)
  • Jason (no last name sended jason at reusch.net)
  • Aaron Hope

HTML formated by Tidy.

 
 

Build with Mozilla 1.2b
Valid HTML 4.01!Valid CSS!

06-nov-2002

1