[imp] Some small hints about installing horde/imp on Redhat 7.2 [was : anyone have step-by-step instructions for IMP 3.0 on Redhat 7.2?]

Timo Boettcher spida@gmx.net
Wed, 20 Feb 2002 12:34:35 +0100


Hi Timo,

Nachricht vom Dienstag, 19. Februar 2002, 23:08:41:

TB> Ok, here we go.

TB> I worked this up from my .bash_history, my memory and the INSTALL and
TB> README files found everywhere. I'm not sure that this is the method I
TB> used, since I made many mistakes and had to turn back, and just now my
TB> installation isn't quiet working.
TB> So: If something doesn't work or is stupid, please tell me.

TB> Timo Boettcher

TB> Some small hints about installing horde/imp on Redhat 7.2

TB> Required:
TB> - Some Linux box, preferrably with Redhat 7.2 since this was written with a Redhat 7.2 box as reference
TB> - working make environment
TB> - internet-connection (or at least, the posiibility to obtain the mentioned files)
TB> - wget, ftpget
TB> - perl
TB> - [aspell]
TB> - time, nerves
TB> - a working backup (since I refuse to give any warranty about this, even that this does anything)
TB> - everything I have forgotten


TB> First get and install openssl. You'll need it for various things.
TB>         cd /usr/src
TB>         wget http://www.openssl.org/source/openssl-0.9.6c.tar.gz
TB>         tar xvzf openssl-0.9.6c.tar.gz
TB>         cd openssl-0.9.6c
TB>         ./config
TB>         make
TB>         make test
TB>         make install

TB> Let's create some self-signed certificate.
TB>         cd /usr/local/ssl/certs/
TB>         openssl req -new -x509 -nodes -out imapd.pem -keyout imapd.pem -days 365

TB> Get and install libmcrypt.
TB>         cd /usr/src
TB>         ftpget ftp://mcrypt.hellug.gr/pub/mcrypt/libmcrypt/libmcrypt-2.4.22.tar.gz
TB>         tar xvzf libmcrypt-2.4.22.tar.gz
TB>         cd libmcrypt-2.4.22
TB>         ./configure
TB>         make
TB>         make check
TB>         make install

TB> Get and install OpenSSH, since the versions in most distributions are not up-to-date and are said to be insecure.
TB>         cd /usr/src
TB>         ftpget ftp://ftp.openbsd.org/pub/OpenBSD/OpenSSH/portable/openssh-3.0.2p1.tar.gz
TB>         tar xvzf openssh-3.0.2p1.tar.gz
TB>         cd openssh-3.0.2p1
TB>         ./configure
TB>         make
TB> Doing "make install" will generate a new host-key
TB>         make install
        
TB> Get and install some smtp-mailserver. Sendmail seems to be quiet bugggy, so I decided in favor of postfix.
TB>         cd /usr/src
TB>         wget http://postfix.portal-to-web.de/dist/official/postfix-20010228-pl08.tar.gz
TB>         tar xvzf postfix-20010228-pl08.tar.gz
TB>         cd postfix-20010228-pl08
TB> "make" will ask you some questions. The defaults were OK for me.
TB>         make

Configure it in /etc/postfix/main.cf
          mydomain = myserver.net

          myorigin = $mydomain

          mydestination = $myhostname, localhost.$mydomain $mydomain

This is for pop-before-smtp, which will be installed just after that
          smtpd_recipient_restrictions = permit_mynetworks,reject_non_fqdn_recipient,
                check_client_access hash:/etc/postfix/pop-before-smtp, check_relay_domain
Here is still some work to be done...

        
TB> to start postfix, upon each reboot, let some script call
TB>         /usr/sbin/postfix start


TB> If you want to use your mailserver with clients except horde/imp from anywhere out of the internet, you should put up some protective measures against being an "open-relay".
TB>         cd /usr/src
TB>         wget http://people.oven.com/bet/pop-before-smtp/pop-before-smtp-1.28.tar.gz
TB>         tar xvzf pop-before-smtp-1.28.tar.gz
TB>         cd pop-before-smtp-1.28
TB> Install the script
TB>         cp pop-before-smtp /usr/sbin/
TB> Install the init-script 
TB>         cp init-redhat-alex /etc/init.d/pop-before-smtp
TB>         cd contrib
TB> Get the necessary perl-modules
TB>         ./getfromcpan
TB> or
TB>         perl -MCPAN -e 'install Time::HiRes'
TB>         perl -MCPAN -e 'install File::Tail'
TB>         perl -MCPAN -e 'install Date::Parse'
TB>         perl -MCPAN -e 'install Net::Netmask'

TB> Get an Imap-server (UW-Imapd includes the also-needed client-library)
TB>         cd /usr/src
TB>         ftpget ftp://ftp.cac.washington.edu/imap/imap-2001a.tar.Z
TB>         tar xvzf imap-2001a.tar.Z
TB>         cd imap-2001a/
TB>         make slx PASSWDTYPE=pam SSLTYPE=unix
TB>         touch /etc/cram-md5
TB>         chmod 0600 /etc/cram-md5
Copy the compiled programs to /usr/sbin
         cp scr/imapd/imapd /usr/sbin
         cp src/ipopd/imapd /usr/sbin

Set your [x]inetd to launch these on incoming connections
/etc/xinetd/imap
         service imap
         {
                 disable = no
                 socket_type             = stream
                 wait                    = no
                 user                    = root
                 server                  = /usr/sbin/imapd
                 log_on_success          += DURATION USERID
                 log_on_failure          += USERID
         }
/etc/xinetd/ipop3
         service pop3
         {
                 disable = no
                 socket_type             = stream
                 wait                    = no
                 user                    = root
                 server                  = /usr/sbin/ipop3d
                 log_on_success          += USERID
                 log_on_failure          += USERID
         }


TB> Get a db to store your user-settings. I decided to use postgres, but it should work with mysql just as fine.
TB>         cd /usr/src
TB>         ftpget ftp://ftp.postgresql.org/pub/source/v7.2/postgresql-7.2.tar.gz
TB>         tar xvzf postgresql-7.2.tar.gz
TB>         cd postgresql-7.2
TB>         ./configure --with-perl --with-openssl
TB>         make
TB>         make install
TB>         mkdir /usr/local/pgsql/data
TB>         chown postgres:postgres /usr/local/pgsql/data
TB>         /usr/local/pgsql/bin/initdb -D /usr/local/pgsql/data
TB>         cd /etc/httpd/htdocs/horde/scripts/db/
TB>         adduser postgres
        
TB> Get a new apache-webserver
TB>         cd /usr/src
TB>         wget http://www.apache.org/dist/httpd/apache_1.3.23.tar.gz
TB>         tar xvzf apache_1.3.23.tar.gz

TB> Get a new php and prepare to install as dynamic module
TB>         cd /usr/src
TB>         wget http://www.php.net/do_download.php?download_file=php-4.1.1.tar.gz
TB>         tar xvzf php-4.1.1.tar.gz
TB>         cd php-4.1.1
TB>         ./configure --with-apxs=/usr/local/apache/bin/apxs --with-gettext --enable-track-vars --with-xml --with-pgsql --with-mcrypt --with-imap
TB>         make
TB>         make install
TB> Make sure that the max attachment-size in /etc/php.ini is set to something reasonable
TB>         upload_max_filesize = 20M

TB> Build apache with the PHP module 
TB>         cd apache_1.3.23
TB>         ./configure --activate-module=src/modules/php4/libphp4.a --enable-module=rewrite --enable-shared=rewrite
TB>         make
TB>         make install
TB> Open /etc/httpd/conf/httpd.conf with your favorite editor and make sure that the following settings are set.
TB>         AddModule modules/php4/libphp4.a
        
TB>         ServerName www.yourserver.net
        
TB>         DocumentRoot "/etc/httpd/htdocs"
        
TB>         DirectoryIndex index.php
        
TB>         AddType application/x-httpd-php .php
TB> Save and close

TB> Update Pear (some shared php-code)      
TB>         cd /usr/src
TB>         ftpget ftp://ftp.horde.org/pub/horde/tarballs/pear-4.1.0.tar.bz2
TB>         cd pear-4.1.0
TB>         cp * /usr/local/lib/php

TB> Get extremly latest horde/turba/imp versions from cvs
TB>         cd /etc/httpd/htdocs
TB>         cvs -d anoncvs@anoncvs.uk.horde.org:/cvs co -r RELENG_2 horde
TB>         cd horde
TB>         cvs -d anoncvs@anoncvs.uk.horde.org:/cvs co -r RELENG_3 imp
TB>         cvs -d anoncvs@anoncvs.uk.horde.org:/cvs co -r RELENG_1 turba

TB>         cd config/
TB>         for foo in *.dist; do cp $foo `basename $foo .dist`; done
        
TB> Open horde.php with your favorite editor and set
TB>         $conf['auth']['driver'] = 'imap';
        
TB>         $conf['auth']['params']['dsn'] = '{www.yourserver.net/imap:143}INBOX';
        
TB>         $conf['prefs']['driver'] = 'sql';
        
TB>         $conf['prefs']['params']['phptype'] = 'pgsql';
TB>         $conf['prefs']['params']['hostspec'] = 'localhost';
TB>         $conf['prefs']['params']['username'] = 'horde';
TB>         $conf['prefs']['params']['password'] = 'yourpgsqlpassword';
TB>         $conf['prefs']['params']['database'] = 'horde';
TB>         $conf['prefs']['params']['table'] = 'horde_prefs';
        
TB>         $conf['category']['driver'] = 'none';
        
TB>         $conf['mailer']['params'] = array('sendmail_path' => '/usr/libexec/postfix/smtp');
TB> Save and Close.

TB> Open lang.php with your favorite editor and set your default language
TB>         $nls['defaults']['language'] = 'de_DE';
TB> Save and Close.

TB> Open registry.php with your favorite editor and comment _in_ everything about imp and turba
TB> Change login to imp, or you'll have to login twice
TB>         $this->registry['auth']['login'] = 'imp';
TB>         $this->registry['auth']['logout'] = 'imp';
        
TB>         $this->registry['mail']['compose'] = 'imp';
TB>         $this->registry['mail']['composePopup'] = 'imp';
        
TB>         $this->registry['contacts']['search'] = 'turba';
TB>         $this->registry['contacts']['add'] = 'turba';
TB>         $this->registry['contacts']['sources'] = 'turba';
TB>         $this->registry['contacts']['fields'] = 'turba';
                
TB>         $this->applications['imp'] = array(
TB>             'fileroot' => dirname(__FILE__) . '/../imp',
TB>             'webroot' => $this->applications['horde']['webroot'] . '/imp',
TB>             'icon' => '/horde/imp/graphics/imp.gif',
TB>             'name' => _("Mail"),
TB>             'allow_guests' => false,
TB>             'show' => true
TB>         );
        
TB>         $this->applications['turba'] = array(
TB>             'fileroot' => dirname(__FILE__) . '/../turba',
TB>             'webroot' => $this->applications['horde']['webroot'] . '/turba',
TB>             'icon' => '/horde/turba/graphics/turba.gif',
TB>             'name' => _("Addressbook"),
TB>             'allow_guests' => false,
TB>             'show' => true
TB>         );


TB> Save and Close.

TB>         cd ../imp/config/
TB>         for foo in *.dist; do cp $foo `basename $foo .dist`; done
        
TB> Open registry.php with your favorite editor and add your server. Comment out everything else
TB>         $servers['_prompt'] = array(
TB>             'name' => 'Choose a mail server:'
TB>         );

TB>         $servers['yourserver'] = array(
TB>             'name' => 'yourserver.net',
TB>             'server' => 'localhost',
TB>             'protocol' => 'imap',
TB>             'port' => 143,
TB>             'folders' => 'mail/',
TB>             'namespace' => '',
TB>             'maildomain' => 'yourserver.net',
TB>             'smtphost' => 'localhost',
TB>             'realm' => 'yourserver.net',
TB>             'preferred' => ''
TB>         );
        
TB> Save and close

TB> Open conf.php with your favorite editor
TB>         $conf['utils']['spellchecker'] = '/usr/bin/aspell';
TB> Save and Close  

TB> Initiallize the db
TB>         su postgres
TB>         /usr/local/pgsql/bin/createuser -P -D -A horde
TB> Enter yourpgsqlpassword from /etc/httpd/horde/conf/horde.php when asked
TB>         /usr/local/pgsql/bin/psql -d horde -U horde -f /etc/httpd/htdocs/horde/scripts/db/auth.sql
TB>         /usr/local/pgsql/bin/psql -d horde -U horde -f /etc/httpd/htdocs/horde/scripts/db/prefs.sql
TB>         /usr/local/pgsql/bin/psql -d horde -U horde -f /etc/httpd/htdocs/horde/scripts/db/category.sql
TB>         logout
TB> to start postgres, upon each reboot, let some script call
TB>         su postgres -c"/usr/local/pgsql/bin/pg_ctl start -D /usr/local/pgsql/data &"






 Timo