imp-2.2.0(webmail)

What is IMP?

IMP is a set of PHP scripts that implement an IMAP based webmail system. Assuming you have an account on a server that supports IMAP, you can theoretically use an installation of IMP to check your mail from anywhere that you have web access.

What does it require?

  • Dounload
    Application File URL
    Apache apache_1.3.12.tar.gz http://www.apache.org
    PHP php-3.0.16.tar.gz http://www.php.net or
    http://www.php.jpnnet.com
    PHPLIB phplib-7.2c.tar.gz http://www.horde.org/phplib >
    Postgre SQL postgresql-7.0.2.tar.gz http://www.postgresql.org/
    UW-IMAP4 imap-4.7.tar.Z ftp://ftp.cac.washington.edu/imap/
    Horde/IMP horde-1.2.0.tar.gz
    imp-2.2.0.tar.gz
    http://www.horde.org/
    wvWare wv-0.5.44.tar.gz
    http://www.wvware.com/
    xlHTML xlHtml-0.2.6-2rh61.i386.rpm
    xlHtml-cole-2.0.1-3rh61.i386
    http://www.xlhtml.org/

    Install Postgre SQL

  • Uninstall RPM Packages if installed
    # /etc/rc.d/init.d/postgresql stop
    # rpm -e postgresql-devel-6.4.2-3.i386.rpm
    # rpm -e postgresql-clients-6.4.2
    # rpm -e postgresql-6.4.2
    
  • Install
    # useradd postgres -g users -d /usr/local/pgsql
    # passwd postgres
    
    # cp postgresql-7.0.2.tar.gz /usr/local/src/
    # tar zxvf postgresql-7.0.2.tar.gz
    # chown postgres.users postgresql-7.0.2 -R
    # su - postgres
    $ cd /usr/local/src/postgresql-7.0.2/src/
    $ ./configure --with-perl --with-odbc --without-CXX > configure.log &
    $ tail -f configure.log
    $ make all >& make.all.log &
    $ tail -f make.all.log
    $ make install > make.install.log &
    $ tail -f make.install.log
    $ su - root
    # cd /usr/local/src/postgresql-7.0.2/src/interfaces/perl5/
    # make install
    
    $ cd /usr/local/src/postgresql-7.0.2/doc
    $ make install > make.install.log
    
  • Add to ~/.bashrc
    # Postgresql
    PATH="$PATH":/usr/local/pgsql/bin
    export POSTGRES_HOME=/usr/local/pgsql
    export PGLIB=$POSTGRES_HOME/lib
    export PGDATA=$POSTGRES_HOME/data
    export MANPATH="$MANPATH":$POSTGRES_HOME/man
    export LD_LIBRARY_PATH="$LD_LIBRARY_PATH":"$PGLIB"
    
  • Initdb
    $ initdb
    
  • Confugure
  • $ cd ~/data
    $ chmod u+w pg_hba.conf
    
  • Edit /usr/local/pgsql/data/pg_hba.conf
    ...
    # The above allows any user from any host with IP address 192.168.0.x to
    # connect to database template1 as the same username that ident on that host
    # identifies him as (typically his Unix username).  
    
    #host         all        192.168.0.1   255.255.255.255   reject
    host         all        0.0.0.0       0.0.0.0           trust
    
    # The above would allow anyone anywhere except from 192.168.0.1 to connect to
    # any database under any username.
    ...
    
  • Make start up script
    # cd /etc/rc.d/init.d
    # cp /usr/local/src/postgresql-7.0.2/contrib/linux/postgres.init.sh ./postgres.init
    # ln -s postgres.init ../rc5.d/S98postgres.init
    
  • Edit /etc/rc.d/init.d/postgres.init
    PGOPTS="-i -S -D/usr/local/pgsql/data"
    
  • Edit /etc/inittab to add following as a single line
    # PostgreSQL
    pg:2345:respawn:/bin/su - postgres -c "/usr/local/pgsql/bin/postmaster -S -D/usr/local/pgsql/data/ -i /usr/local/pgsql/server.log 2&1 /dev/null"
    
  • Start
    # cd /etc/rc.d/init.d
    # ./postgres.init install
    # ./postgres start
    
  • Create nobody user
    $ createuser nobody
    

    Install Apache

  • Install
    # cd /usr/local/src
    # tar xfz apache_1.3.12.tar.gz
    # cd apache_1.3.12
    # OPTIM="-O2" ./configure --enable-module=so
    # make
    # make install
    
  • Run
    # /usr/local/apache/bin/apachectrl start
    
  • Edit start up script /etc/rc.d/rc
    ...
    # Apache
    if [ -f /usr/local/apache/bin/apachectl ]; then
        echo -n "Starting Apache web server "
        /usr/local/apache/bin/apachectl start
        echo "."
    fi
    ...
    

    Install IMAP4

  • IMAP4
    # cd /usr/local/src
    # tar zxvf imap-4.7.tar.Z
    # cd imap-4.7
    # make lnp
    # cd c-client
    # cp c-client.a /usr/local/lib
    # mkdir /usr/local/include
    # cp rfc822.h /usr/local/include
    # cp mail.h /usr/local/include
    # cp linkage.h /usr/local/include
    # cp imapd/imapd /usr/sbin
    # cp ipopd/ipop3d /usr/sbin
    

    Install PHP

  • PHP
    # cd /usr/local/src
    # tar xfz php-3.0.16.tar.gz
    
    Change source code
    # cd php-3.0.16
    # ./configure --enable-i18n \
      --enable-mbregex \
      --enable-track-vars \
      --with-pgsql=/usr/local/pgsql \
      --with-apache=/usr/local/apache \
      --with-apxs=/usr/local/apache/bin/apxs \
      --with-gd=/usr/local \
      --with-imap=/usr/local
    # make
    # make install
    
  • Edit /usr/local/apache/conf/httpd.conf
    ...
    LoadModule php3_module        libexec/libphp3.so
    ...
    <IfModule mod_dir.c>
        DirectoryIndex index.html index.php3
    </IfModule>
    
    # And for PHP 3.x, use:
    #
    AddType application/x-httpd-php .php3
    AddType application/x-httpd-php-source .phps
    ...
    

    Install PHPLIB

  • Install
    # cd /usr/local/src
    # tar zxvf phplib-7.2c.tar.gz
    # cd phplib-7.2c
    # cp php /usr/local/apache/ -R
    
  • Edit php3.ini
    # cp /usr/local/src/php-3.0.12/php3.ini-dist /usr/local/lib/php3.ini
    
    ;;;;;;;;;;;;;;;;;
    ; Data Handling ;
    ;;;;;;;;;;;;;;;;;
    ...
    # auto_prepend_file       = "/usr/local/apache/php/prepend.php3"
    ...
    ...
    ;;;;;;;;;;;;;;;;;;;;;;;;;
    ; Paths and Directories ;
    ;;;;;;;;;;;;;;;;;;;;;;;;;
    include_path    = "/usr/local/apache/php"
    ...
    

    Install HORDE

  • Install
    # cd /usr/local/src
    # tar zxvf horde-1.2.0.tar.gz
    # cp horde-1.2.0 /usr/local/apache/htdocs/horde -R
    

    Install IMP

    # cd /usr/local/src/
    # tar zxvf imp-2.2.0.tar.gz
    # cp imp-2.2.0 /usr/local/apache/htdocs/horde/imp -R
    # chown nobody.nobody /usr/local/apache/htdocs/horde -R
    

    Configuration

  • Edit /usr/local/apache/htdocs/horde/phplib/local.inc
    ...
    /* To use an SQL database, uncomment and edit the following: */
    class HordeDB extends DB_Sql {
      var $Host = 'localhost';
      var $Database = 'horde';
      var $User = 'postgres';
      var $Password = 'password';
      var $Port = '';
    
      function halt($msg) {
        printf("<b>Database error (HordeDB):</b> %s<br>\n", $msg);
      }
    }
    
    class HordeCT extends CT_Sql {
      var $database_class = 'HordeDB';         // Which database class to use...
      var $database_table = 'active_sessions'; // and find our data in this table.
    }
    ...
    
  • Copy local.inc and overwrite
    # cp local.inc /usr/local/apache/php
    
  • Edit /usr/local/apache/php/prepend.php3
    ...
    require($_PHPLIB["libdir"] . "db_pgsql.inc");  /* Change this to match your datbase. */
    ...
    

    Setup scripts

  • Enable setup script
    # cd /usr/local/apache/htdocs/horde
    # ./install.sh
    
  • You should be able to point your browser to:
    http://yourimpserver/yourhordehome/setup.php3
    
  • When you are done be sure to disable it again!
    # ./secure.sh
    
  • Create HORDE database
  • Edit /usr/local/apache/htdocs/horde/scripts/database/pgsql_create.sql
    ...
    GRANT SELECT, INSERT, UPDATE ON active_sessions TO nobody;
    GRANT SELECT, INSERT, UPDATE ON imp_pref, imp_addr TO nobody;
    
    # su - postgres
    $ cd /usr/local/apache/htdocs/horde/scripts/database
    $ psql template1 < pgsql_create.sql
    
  • Create IMP database
    # su - postgres
    $ cd horde/imp/config/scripts
    $ psql template1 < pgsql_create.sql
    

    Customize for your site

  • Change into 'horde/imp/config' and make changes to the config files.
  • At this point I'd like to point out the use of a perl based script called impsetup.pl which is in 'horde/imp/config/scripts'. Since you are reading through the harder method of setting things up this script would make your life easier. Or you can continue on.

    Within the 'imp/config' directory are several .php3 files as well as a couple .txt files. These files store your customizable configuration options. defaults.php3 is the one you need to make changes to before IMP will function properly. The others can be left alone to begin with.

    'horde/imp/config/defaults.php3' contains a large number of defaults that you'll need to configure for your system, such as the default IMAP server, whether or not users can pick a different server, etc... The file is fairly well documented, so you should be able to pick out what you need to change fairly easily.

    There are several example config files sitting in horde/imp/config/examples. There are 2 that are designed to be almost plug and play for postgres and mysql installs. The only thing you would have to change is the hostnames and any options you want to disable/enable. These default files are under the impression that you configured your database using one of the database setup scripts located in 'horde/imp/config/scripts'.

    Please note that if you use this procedure, you need to chmod 000 horde/setup.php3 since you won't be using it - and IMP won't run for security reasons while it is readable.

    menu.txt is a new file that will allow you to add links to the menu. For more information on this please take a look at the menu.txt file itself.

    There is also a MOTD.html file in imp/config that will allow you to attach a message of the day to the bottom of the login screen.


    Back
    Google
    Web www.grape-info.com