imp-2.0.11(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.9.tar.gz http://www.apache.org
    PHP php-3.0.12.tar.gz http://www.php.net or
    http://www.php.jpnnet.com
    Postgre SQL postgresql-v6.5.3.tar.gz http://www.postgresql.org/
    UW-IMAP4 imap-4.7.tar.Z ftp://ftp.cac.washington.edu/imap/
    Horde/IMP horde-1.0.11.tar.gz
    imp-2.0.11.tar.gz
    patch-horde-1.0.10-1.0.11.gz
    patch-imp-2.0.10-2.0.11.gz
    http://www.horde.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
    
    # mkdir /usr/local/src/postgresql-6.5.3
    # chown postgres.users /usr/local/src/postgresql-6.5.3
    # mkdir /usr/local/pgsql
    # chown postgres.users /usr/local/pgsql
    
    # cp postgresql-6.5.3.tar.gz /usr/local/src/
    # su - postgres
    $ cd /usr/local/src
    $ tar xfz postgresql-6.5.3.tar.gz
    $ cd postgresql-6.5.3/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-6.5.3/src/interfaces/perl5/
    # make install
    
    $ cd /usr/local/src/postgresql-6.5.3/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-6.5.3/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.init start
    

    Install Apache

  • Uninstall RPM packege
    # rpm -qa
    ...
    apache-1.3.6-7
    ...
    # rpm -e apache-1.3.6-7
    
  • Install
    # cd /usr/local/src
    # tar xfz apache_1.3.9.tar.gz
    # cd apache_1.3.9
    # 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 slx
    # mkdir /usr/include/imap/
    # mkdir /usr/include/imap/lib
    # cp /usr/local/src/imap-4.7/c-client/c-client.a /usr/include/imap/lib
    # ln -s /usr/local/src/imap-4.7/c-client/ /usr/include/imap/include
    

    Install PHP

  • PHP
    # cd /usr/local/src
    # tar xfz php-3.0.12jp-beta4.tar.gz
    # cd php-3.0.12jp-beta4
    # ./configure --with-pgsql \
      --with-imap=/usr/include/imap \
      --with-apache=../apache_1.3.12 \
      --enable-track-vars \
      --with-apxs=/usr/local/apache/bin/apxs \
      --enable-i18n \
      --enable-mbregx
    # make
    # make install
    
  • Edit /usr/local/apache/conf/httpd.conf
    ...
    AddType application/x-httpd-php3 .php3
    AddType application/x-httpd-php3-source .phps
    ...
    DirectoryIndex index.html index.php3
    ...
    LoadModule php3_module        libexec/libphp3.so
    
  • Edit /usr/local/apache/conf/access.conf
    ...
    <Directory /usr/local/apache/htdocs/horde/imp>
    php3_magic_quotes_gpc Off
    </Directory>
    ...
    
  • Make /usr/local/lib/php3.ini
    # cd /usr/local/lib
    # cp /usr/local/src/php-3.0.12/php3.ini-dist ./php3.ini
    
  • Edit /usr/local/lib/php3.ini
    ...
    ;;;;;;;;;;;;;;;;;
    ; Data Handling ;
    ;;;;;;;;;;;;;;;;;
    magic_quotes_gpc         = Off  ; magic quotes for incoming GET/POST/Cookie data
    magic_quotes_runtime     = Off  ; magic quotes for runtime-generated data
    magic_quotes_sybase      = Off  ; Use Sybase-style magic quotes
    ...
    ;;;;;;;;;;;;;;;;;;;;;;
    ; Dynamic Extensions ;
    ;;;;;;;;;;;;;;;;;;;;;;
    extension=imap.so      ; Added for IMAP support
    extension=pgsql.so     ; Added for PostgreSql support
    extension=ldap.so      ; Added for LDAP support
    

    Install HORDE

  • Install
    # cd /usr/local/src
    # tar zxvf horde-1.0.11.tar.gz
    

    Install IMP

    # cd /usr/local/src/horde-1.0.11
    # tar zxvf imp-2.0.11.tar.gz
    # mv imp-2.0.11 imp
    # cd /usr/local/src/horde-1.0.11/lib/src
    # ./build.pl
    Ignoring missing options file build.opts: No such file or directory
    Building HORDE libraries......done.
    
    # cd /usr/local/src/horde-1.0.11/imp/lib/src
    # ./build.pl --database=postgres
    Ignoring missing options file build.opts: No such file or directory
    Building IMP libraries......done.
    

    Configuration

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

    Setup scripts

  • Enable setup script
    cd /usr/local/src/horde-1.0.11
    ./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 IMP database
    # su - postgres
    $ cd horde/imp/config/scripts
    $ psql template1 < pgsql_create.sql
    

    Back
    Google
    Web www.grape-info.com