Installation Guide: IMP 3.1 on RedHat 7.3


Index
1. Introduction
2. Prerequisites
3. Configuring Apache
3.1 Configure PHP
3.2 Configure the VirtualHost
3.3 Create the directories
3.4 Test Apache
4. Configuring Horde
4.1 Download and Install Horde
4.2 Download and Install Pear
4.3 Configure mysql
4.4 Configure Horder config files
4.5 Test Horde
5. Configuring IMP
5.1 Download and Install IMP
5.2 Configure Horde for IMP
5.3 Configure IMP config files
5.4 Test IMP
6. Configuring Turba
6.1 Download and Install Turba
6.2 Configure Horde for Turba
6.3 Configure MySQL for Turba
6.4 Test Turba
7. Configuring Passwd
7.1 Download and Install poppassd-ceti
7.2 Download and Install Passwd
7.3 Configure Horde for Passwd
7.4 Configure IMP for Passwd
7.5 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.1 from www.horde.org in a Linux box running RedHat Linux 7.3
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 host:
mail.example.com
IMAP host:
localhost
IMAP folder:
~/mail/
SQL host:
localhost

Servers used:
SMTP Server: sendmail
SQL Server: MySQL
IMAP Server:
WU-IMAP 2001a

Versions used:
RedHat:
7.3
Horde:
2.1
IMP:
3.1
Turba:
1.1
Passwd:
2.1
Pear:
4.1.0 (form horde.org)

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 which file should be edited, we will use a table like this:
File: here will be the path of the file
Content:
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.3 and this RPM installed:
apache-1.3.23-14
php-4.1.2-7.3.4
php-imap-4.1.2-7.3.4
php-ldap-4.1.2-7.3.4
php-mysql-4.1.2-7.3.4
mysqlclient9-3.23.22-6
mysql-server-3.23.49-3
mysql-3.23.49-3
imap-2001a-10
sendmail-8.11.6-15

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 PHP
First, configure php in /etc/php.ini. This lines should be configured:
/etc/php.ini
file_uploads = On
short_open_tag = On

extension=imap.so
extension=ldap.so
extension=mysql.so

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

3.2.1 /etc/httpd/conf/httpd.conf
/etc/httpd/conf/httpd.conf
# make .htpasswd work
<Directory /var/www/html/mail/horde>
  AllowOverride All
</Directory>

# One NameVirtualHost per IP address
NameVirtualHost 192.168.1.1:80
NameVirtualHost 192.168.1.2:80

<VirtualHost 192.168.1.1:80 192.168.1.2:80>
    ServerAdmin webmaster@example.com
    DocumentRoot /var/www/html/mail/horde/imp
    ServerName mail.example.com
    Port 80
    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.3 Create the directories
Create all the necesary directories:
# mkdir -p /var/www/html/mail/horde/imp/
# mkdir -p /var/log/httpd/mail/

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

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

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

4.2 Download and Install Pear
In RH7.3, we already have a version of Pear installed in /usr/share/pear by the php rpm package.
This version works fine. But if you wan to install the latest version of Pear from Horde, you can do this procedure:
# cd /usr/share
# mv pear pear.4.1.2.redhat
# cd /tmp
# wget -c --passive-ftp ftp://ftp.horde.org/pub/horde/tarballs/pear-1.0.1.tar.gz
# tar xzf pear-1.0.1.tar.gz -C /usr/share
# cd /usr/share
# mv pear-1.0.1 pear
# chown root.root -R pear
Remember that if you update your php rpms, you need to do this procedure again.

4.3 Configure mysql
Check that mysql is running:
# service mysqld restart
Create the horde database:
# cd horde/scripts/db
# vi mysql_create.sql # >>>Important<<< edit the default password
# mysql < mysql_create.sql # create the tables
Test to see if you can connect to the database:
# mysql -h localhost -D horde -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
// Optional. RedHat's 7.3 PHP does have zlib support
$conf['compress_pages'] = true;

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

// use MySQL to store Horde Stuff
$conf['prefs']['driver'] = 'sql';
$conf['prefs']['params']['phptype'] = 'mysql';
$conf['prefs']['params']['hostspec'] = 'localhost';
$conf['prefs']['params']['username'] = 'horde';
$conf['prefs']['params']['password'] = '******';  /* <- edit this line */
$conf['prefs']['params']['database'] = 'horde';
$conf['prefs']['params']['table'] = 'horde_prefs';

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

4.4.2 /etc/mail/trusted-users
Add the user 'apache' to the list of trusted users to sendmail.
This will allow the local user apache to send emails as other users:
/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
You should see a page like this example

Then try this page:
http://mail.example.com/horde/
If you see some errors, look at the troubleshooting guide before continuing.

*Security Issue*
Make sure you can *not* see the contents of this URL:
http://mail.example.com/horde/config/

5. Configuring IMP
5.1 Download and Install IMP:
# cd /tmp
# wget -c --passive-ftp ftp://ftp.horde.org/pub/imp/tarballs/imp-3.1.tar.gz
# tar xzf imp-3.1.tar.gz -C /var/www/html/mail/horde
# cd /var/www/html/mail/horde
# mv imp-3.1/* imp/
# rmdir imp-3.1

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' => $this->applications['horde']['webroot'] . '/imp/graphics/imp.gif',
    'name' => _("Mail"),
    'allow_guests' => false,
    '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/notls',
    '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/prefs.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 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/horde/imp/test.php
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.

You should see a page like this example after you test the IMAP conection. Note that the is an error message in the example because in test.php the imap server should be configured as "imap/notls" in line 155.

*Security Issue*
Make sure you can *not* see the contents of this URL:
http://mail.example.com/horde/imp/config/

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 Install Turba
# cd /tmp
# wget -c --passive-ftp ftp://ftp.horde.org/pub/turba/tarballs/turba-1.1.tar.gz
# tar xzf turba-1.1.tar.gz -C /var/www/html/mail/horde
# cd /var/www/html/mail/horde
# mv turba-1.1 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' => $this->applications['horde']['webroot'] . '/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' => 'My Addressbook',
    'type' => 'sql',
    'params' => array(
        'phptype' => 'mysql',
        'hostspec' => 'localhost',
        'username' => 'horde',
        'password' => '******', /*Edit this line!!!*/
        'database' => 'horde',
        '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. Configuring Passwd
Now that we have configured Horde with IMP and Turba, we need to provide our users with a method to change their password via Horde. We will use the Passwd module from the Sork Project for this.

7.1 Download and Install poppassd-ceti
Poppassd-ceti is a poppassd server that is modified from the poppassd provided from Qualcom/Eudora to support Linux PAM.

7.1.1 Using RPM
The easier way to install is via rpm:
# cd /tmp
# wget -c http://www.samera.com.py/devel/rpm/poppassd-ceti-1.8.2-rh73.i386.rpm
# rpm -ivh poppassd-ceti-1.8.2-rh73.i386.rpm

7.1.2 Using .tar.gz
you can also install it after manually compiling the source code:
# wget -c http://echelon.pl/pubs/poppassd-1.8.2.tar.gz
# tar xzf poppassd-1.8.2.tar.gz
# cd poppassd-1.8.2
# 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
}

7.1.3 Enable the poppassd service
After installation(via rpm or .tar.gz), enable the poppassd service:
# ntsysv
# service xinetd restart

7.2 Download and Install Passwd
Now, we need to install the Passwd module from the Sork project:
# cd /tmp
# wget -c --passive-ftp ftp://ftp.horde.org/pub/passwd/tarballs/passwd-2.1.tar.gz
# tar xzf passwd-2.1.tar.gz -C /var/www/html/mail/horde
# cd /var/www/html/mail/horde
# mv passwd-2.1 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

Edit the only config file:
horde/passwd/config/conf.php
$conf['server']['driver'] = 'poppassd';

$conf['server']['params']['default'] = array(
  'host' => 'localhost',
  'port' => 106
);

$conf['menu']['apps'] = array('imp');

7.3 Configure Horde for Passwd
Edit Horde config files to support the Passwd module:
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.4 Configure IMP for Passwd
Configure an icon for Passwd in IMP
horde/imp/config/conf.php
$conf['menu']['apps'] = array('turba', 'passwd');

7.5 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 being 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]
  • 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.3(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

  • 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

  • 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)

  • 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 feel 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
  • Andrea `Zuse' Balestrero
  • Marcos Rivarola



 

This is a new CSS2 version of the guide. The HTML code is formated by Tidy




In Our Hearts




Made with Mozilla 1.4b
Valid HTML 4.01!Valid CSS!

06-jun-2003
1