#Habilitar el soporte de IMAP en php sobre Cent OS 6 64bits
#Crear un script llamado setup-imap.sh
nano setup-imap.sh
#Pegar el siguiente texto
####### Inicio script
#!/bin/sh # Script for PHP-IMAP installation. 0.1b # Written by Martynas Bendorius (smtalk) CWD=`pwd` OS=`uname` #Is it a 64-bit OS? B64=0 B64COUNT=`uname -m | grep -c 64` if [ "$B64COUNT" -eq 1 ]; then B64=1 LD_LIBRARY_PATH=/lib64:/usr/lib64:/usr/local/lib64:/lib:/usr/lib:/usr/local/lib export LD_LIBRARY_PATH fi if [ ! -e /usr/include/krb5.h ] && [ -e /etc/redhat-release ]; then echo "Installing krb5-devel" yum -y install krb5-devel fi VERSION=2006k URL="ftp://ftp.cac.washington.edu/imap/old/imap-${VERSION}.tar.Z" FILENAME=imap-${VERSION} TARBALL=${FILENAME}.tar.Z echo "Downloading ${TARBALL}..." wget -O ${TARBALL} ${URL} tar xzf ${TARBALL} cd ${FILENAME} echo "Installing ${FILENAME}..." if [ ${OS} = "FreeBSD" ]; then if [ ${B64} -eq 0 ]; then make bsf else make bsf EXTRACFLAGS=-fPIC fi else perl -pi -e 's#SSLDIR=/usr/local/ssl#SSLDIR=/etc/pki/tls#' src/osdep/unix/Makefile perl -pi -e 's#SSLINCLUDE=\$\(SSLDIR\)/include#SSLINCLUDE=/usr/include/openssl#' src/osdep/unix/Makefile perl -pi -e 's#SSLLIB=\$\(SSLDIR\)/lib#SSLLIB=/usr/lib/openssl#' src/osdep/unix/Makefile if [ ${B64} -eq 0 ]; then make slx else make slx EXTRACFLAGS=-fPIC fi fi echo "Copying files to /usr/local/php-imap" mkdir -p /usr/local/php-imap/include mkdir -p /usr/local/php-imap/lib chmod -R 077 /usr/local/php-imap cp -f c-client/*.h /usr/local/php-imap/include/ cp -f c-client/*.c /usr/local/php-imap/lib/ cp -f c-client/c-client.a /usr/local/php-imap/lib/libc-client.a cd .. rm -rf ${FILENAME} exit 0;
####### Fin script
#Hacerlo ejecutable
chmod +x setup-imap.sh
#Ejecutarlo
./setup-imap.sh
#Agregar el siguiente codigo a /usr/local/directadmin/custombuild/configure/suphp/configure.php5
--with-imap=/usr/local/php-imap \ --with-imap-ssl \
#Recompilar php
cd /usr/local/directadmin/custombuild
./build php n
#############################################
#Guia manual
#############################################
#Habilitar soporte IMAP en Apache2 bajo DirectAdmin (Cent OS)
#Para recompilar apache2 en su instalación DirectAdmin bajo CentOS habilitando el soporte IMAP deberá:
# 1.- Instalar las librerias libc-client:
# CentOS 32 bits:
yum -y install libc-client-devel.i386 rpm
# CentOS 64 bits:
#yum -y install libc-client-devel.x86_64 rpm
# 2.- Acceder al directorio de custombuild de directadmin:
cd /usr/local/directadmin/custombuild
# PHP CLI 3.- Editar el archivo de configuración /ap2/configure.php5 (atento, solo la última línea no tiene “\” en el final):
vi configure/ap2/configure.php5
# Agregar esto
--with-imap=/usr/lib/dovecot/imap \
--with-imap-ssl
# PHP CLI
vi /usr/local/directadmin/custombuild/configure/ap2/configure.php5
# Agregar esto
--with-imap \
--with-imap-ssl \
# PHP CGI
vi /usr/local/directadmin/custombuild/configure/suphp/configure.php5
# Agregar esto
"--with-imap" \
"--with-imap-ssl" \
# 4.- Recompilar apache:
./build php n
# 5.- Reiniciar apache:
service httpd restart
# Con esto, IMAP estará instalado.