martes, 20 de abril de 2010

Horde Webmail + poppassd | Debian Lenny o Squeeze

Horde webmail supera sin ningún problema a squirrelmail por la facilidad de uso y por la documentación existente sobre el, pero antes de proceder a la configuración de horde debemos tener instalado minimamente Postfix ya funcionando con algún filtro de virus como clamav u otro en este ejemplo usaremos spamassassin y tendremos configurado postfix, la versión Webmail de Horde que configuraremos administra los usuarios directamente desde linux es decir, tendremos crear o añadir usuarios a linux manualmente o tal vez hacer algo así como un php gui para añadirlos manualmente desde la web.

Primeramente Debemos configurar Postfix con SMTP-AUTH y TLS con IMAP, para este ejemplo use: sandi.org como dominio podemos cambiar ese valor según nuestras necesidades.


apt-get install postfix sasl2-bin libsasl2-modules procmail


Aceptamos los valores por defecto .

Escribimos y también aceptamos los valores por defecto de:

dpkg-reconfigure postfix


Ok ahora estos son los pasos posteriores, preferentemente hacerlos todos individualmente, linea por linea en la terminal.


postconf -e 'smtpd_sasl_local_domain ='
postconf -e 'smtpd_sasl_auth_enable = yes'
postconf -e 'smtpd_sasl_security_options = noanonymous'
postconf -e 'broken_sasl_auth_clients = yes'
postconf -e 'smtpd_sasl_authenticated_header = yes'
postconf -e 'smtpd_recipient_restrictions =
permit_sasl_authenticated,permit_mynetworks,reject_unauth_destination'
postconf -e 'inet_interfaces = all'
echo 'pwcheck_method: saslauthd' >> /etc/postfix/sasl/smtpd.conf
echo 'mech_list: plain login' >> /etc/postfix/sasl/smtpd.conf
mkdir /etc/postfix/ssl
cd /etc/postfix/ssl/
openssl genrsa -des3 -rand /etc/hosts -out smtpd.key 1024
chmod 600 smtpd.key
openssl req -new -key smtpd.key -out smtpd.csr
openssl x509 -req -days 3650 -in smtpd.csr -signkey smtpd.key -out smtpd.crt
openssl rsa -in smtpd.key -out smtpd.key.unencrypted
mv -f smtpd.key.unencrypted smtpd.key
openssl req -new -x509 -extensions v3_ca -keyout cakey.pem -out cacert.pem -days 3650
postconf -e 'myhostname = sandi.org'
postconf -e 'smtpd_tls_auth_only = no'
postconf -e 'smtp_use_tls = yes'
postconf -e 'smtpd_use_tls = yes'
postconf -e 'smtp_tls_note_starttls_offer = yes'
postconf -e 'smtpd_tls_key_file = /etc/postfix/ssl/smtpd.key'
postconf -e 'smtpd_tls_cert_file = /etc/postfix/ssl/smtpd.crt'
postconf -e 'smtpd_tls_CAfile = /etc/postfix/ssl/cacert.pem'
postconf -e 'smtpd_tls_loglevel = 1'
postconf -e 'smtpd_tls_received_header = yes'
postconf -e 'smtpd_tls_session_cache_timeout = 3600s'
postconf -e 'tls_random_source = dev:/dev/urandom'
mkdir -p /var/spool/postfix/var/run/saslauthd


Ahora debemos editar el archivo saslauthd

nano /etc/default/saslauthd


#cambiar a yes si se encuentra en lo la linea START=

START=yes
DESC="SASL Authentication Daemon"
NAME="saslauthd"
MECHANISMS="pam"
MECH_OPTIONS=""
THREADS=5
#Debe escribirse correctamente la linea de abajo:
OPTIONS="-c -m /var/spool/postfix/var/run/saslauthd -r"


En la terminal añadir postfix a sasl

adduser postfix sasl

reiniciar postfix

/etc/init.d/postfix restart

iniciar saslauthd

/etc/init.d/saslauthd start


Ahora instalar los paquetes para pop3 e imap

apt-get install courier-authdaemon courier-base courier-imap courier-imap-ssl courier-pop courier-pop-ssl courier-ssl gamin libgamin0 libglib2.0-0


Ahora hacer lo siguiente

cd /etc/courier


Borrar:

rm -f /etc/courier/imapd.pem
rm -f /etc/courier/pop3d.pem

Editar imapd.cnf

nano /etc/courier/imapd.cnf


[...]
CN=sandi.org
[...]

Editar pop3d,cnf


nano /etc/courier/pop3d.cnf


[...]
CN=sandi.org
[...]

Crear los certificados pop3 e imap

mkimapdcert && mkpop3dcert


Reiniciar los servicios

/etc/init.d/courier-imap-ssl restart


En la terminal:

postconf -e 'home_mailbox = Maildir/'


postconf -e 'mailbox_command ='


/etc/init.d/postfix restart


/etc/init.d/courier-pop-ssl restart


Instalar Mutt para ver los correos desde consola.

apt-get install mutt


Configurar Mutt


nano /etc/Muttrc


set folder="~/Maildir"
set mask="!^\\.[^.]"
set mbox="~/Maildir"
set record="+.enviados"
set postponed="+.borradores"
set spoolfile="~/Maildir"


Ahora a provar el envio y recepción con telnet enviandonos un mensaje de nosotros a nosotros mismos en este ejemplo usare mi usuario de linux gary.

En la terminal hacer:

telnet localhost smtp

Esperamos a que se conecte y listo!

Trying 127.0.0.1...
Connected to localhost.loaldomain.
Escape character is '^]'.
220 sandi.org ESMTP Postfix (Debian/GNU)

Ahora esta conectado probar enviando un correo escribiendo lo siguiente, primero el remitente.

mail from:

Al hacer enter devuelve lo siguiente

250 2.1.0 Ok

Ahora el destinatario:

rcpt to:


250 2.1.5 Ok

Ahora el comando para escribir el texto del correo.

data



354 End data with .

ahora a escribir

Aki va el texto y luego pulso un enter y el punto luego otro enter para salir el . es algo asi como salir de redacción
.

Escribir . y pulsar enter para salir

250 2.0.0 Ok: queued as 5E72D4805E

Esto nos dice que fue enviado correctamente.

quit

Salir del envio desde terminal

221 2.0.0 Bye


Ahora nos logeamos o abrimos una terminal como el usuario al que enviamos el correo y verificamos que llego el correo.


=================================================================================
q:Salir d:Sup. u:Recuperar s:Guardar m:Nuevo r:Responder g:Grupo ?:Ayuda
1 F Aug 16 To undisclosed- (0,1K) (este es el correo que nos autoenviamos)
=================================================================================


Ahora debemos instalar spamassassin y configurarlo

apt-get install spamassassin spamc


groupadd -g 5001 spamd


useradd -u 5001 -g spamd -s /sbin/nologin -d /var/lib/spammassassin spamd


mkdir /var/lib/spamassassin


chown spamd:spamd /var/lib/spamassassin/


Editar el archivo spamassassin para configurar.

nano /etc/default/spamassassin


ENABLED=1
SAHOME="/var/lib/spamassassin/"
OPTIONS="--create-prefs --max-children 5 --username spamd --helper-home-dir ${SAHOME} -s ${SAHOME}spamd.log"
PIDFILE="${SAHOME}spamd.pid"
CRON=0


posteriormente el archivo local.cf

nano /etc/spamassassin/local.cf


rewrite_header Subject [***** SPAM _SCORE_ *****]
required_score 2.0
report_safe 0
use_bayes 1
use_bayes_rules 1
bayes_auto_learn 1
skip_rbl_checks 0
use_razor2 0
use_dcc 0
use_pyzor 0


Ahora a reiniciar el servicio de spamassassin

/etc/init.d/spamassassin start

Bien en este punto es donde tenemos configurado el correo electronico.

Ahora configuraremos Horde pero debemos tener los siguientes paquetes instalados.


apt-get install libapache2-mod-php5 php5-gd php5-mysql php5-mcrypt php5-imap php5-tidy php5-cli php-pear memcached php5-memcache libmagic-dev libgeoip-dev make php5-dev unrtf libwpd-tools xlhtml source-highlight ppthtml rpm wv enscript fortunes aspell-en aspell-es gnupg openssl ca-certificates


Extensa la lista pero son los paquetes que "si o si" debe tener nuestro servidor Debian para soportar correctamente horde webmail.

Primeramente Descargar la ultima version de horde webmail desde su web en http://www.horde.org
horde-webmail-1.2.3.tar.gz, luego copiar a la carpeta /var/www/ usaremos la carpeta /var/www/webmail/


cp horde-webmail-1.2.3.tar.gz /var/www/


cd /var/www/


tar xvf horde-webmail-1.2.3.tar.gz


mv horde-webmail-1.2.3 webmail

Ahora hacemos lo siguiente para instalar la base de datos y el usuario administrador


/usr/bin/php /var/www/webmail/scripts/setup.php


Horde Groupware Webmail Edition Configuration Menu
(0) Exit
(1) Configure database settings
(2) Create database or tables
(3) Configure administrator settings
(4) Update from an older Horde Groupware Webmail Edition version


Type your choice: 1


Type your choice: 1
What database backend should we use? [false]
(false) [None]
(dbase) dBase
(ibase) Firebird/InterBase
(fbsql) Frontbase
(ifx) Informix
(msql) mSQL
(mssql) MS SQL Server
(mysql) MySQL
(mysqli) MySQL (mysqli)
(oci8) Oracle
(odbc) ODBC
(pgsql) PostgreSQL
(sqlite) SQLite
(sybase) Sybase


Type your choice: mysql


Request persistent connections? [0]
(1) Yes
(0) No


Type your choice: 0


Username to connect to the database as* [] root
Password to connect with [] passwordderoot


How should we connect to the database? [unix]
(unix) UNIX Sockets
(tcp) TCP/IP


Type your choice: tcp


Database server/host* [] mail.sandi.org


Port the DB is running on, if non-standard [3306]


Database name to use* [] webmail


Internally used charset* [utf-8]
Use SSL to connect to the server? [0]
(1) Yes
(0) No


Type your choice:0


Certification Authority to use for SSL connections []
Split reads to a different server? [false]
(false) Disabled
(true) Enabled


Type your choice:false


Writing main configuration file
Done configuring database settings.


Horde Groupware Webmail Edition Configuration Menu
(0) Exit
(1) Configure database settings
(2) Create database or tables
(3) Configure administrator settings
(4) Update from an older Horde Groupware Webmail Edition version

Type your choice: 2

Should we create the database for you? If yes, you need to provide a database
user that has permissions to create new databases on your system. If no, we
will only create the database tables for you. [y]
(y) Yes
(n) No

Type your choice: y


Database superuser for creating the database if necessary for your database system: root


Specify a password for the database user: passwordderoot
Loading database module...
[ OK ] Successfully created the database webmail.
[ OK ] Successfully created the global tables.
[ OK ] Successfully created the tables for Mail (imp).
[ OK ] Successfully created the tables for Filters (ingo).
[ OK ] Successfully created the tables for Address Book (turba).
[ OK ] Successfully created the tables for Calendar (kronolith).
[ OK ] Successfully created the tables for Tasks (nag).
[ OK ] Successfully created the tables for Notes (mnemo).
Done creating tables.


Horde Groupware Webmail Edition Configuration Menu
(0) Exit
(1) Configure database settings
(2) Create database or tables
(3) Configure administrator settings
(4) Update from an older Horde Groupware Webmail Edition version

Type your choice: 3

Aqui seleccionamos al administrador del sistema webmail, en este caso el usuario gary.

Specify an existing mail user who you want to give administrator permissions (optional): gary


Writing main configuration file
Done configuring administrator settings.


Horde Groupware Webmail Edition Configuration Menu
(0) Exit
(1) Configure database settings
(2) Create database or tables
(3) Configure administrator settings
(4) Update from an older Horde Groupware Webmail Edition version

Type your choice: 0

Thank you for using Horde Groupware Webmail Edition!

Tal vez esta sea la parte mas dura de todo el proceso este script o el texto siguiente esta extraido de: http://howto.landure.fr/gnu-linux/debian-4-0-etch-en/install-horde-groupware-webmail-edition-on-debian-4-0-etch

Es recomendable copiar y pegar en la terminal todo lo que hay acontinuación:


/bin/sed -i -e 's/memory_limit = .*/memory_limit = 128M/' /etc/php5/apache2/php.ini
/bin/sed -i -e "s/^\(.*problems.*email.*=\).*;/\1 'sistemas@sandi.org';/" /var/www/webmail/config/conf.php
/bin/sed -i -e "s/^\(.*problems.*maildomain.*=\).*;/\1 ' sistemas@sandi.org';/" /var/www/webmail/config/conf.php
touch /var/log/horde.log
/bin/chown www-data:www-data /var/log/horde.log
/bin/chmod 0640 /var/log/horde.log
/bin/sed -i -e 's/\/tmp\/horde\.log/\/var\/log\/horde\.log/' /var/www/webmail/config/conf.php
/bin/cp /var/www/webmail/scripts/horde.logrotate /etc/logrotate.d/horde
/etc/init.d/apache2 restart
/bin/sed -i -e 's/^\(.*memcache.*enabled.*=\).*;/\1 true;/' /var/www/webmail/config/conf.php
/bin/sed -i -e "/^\(.*conf.*memcache.*enabled.*=\).*/i\
\$conf['memcache']['hostspec'] = array('localhost');\n\
\$conf['memcache']['port'] = array('11211');\n\
\$conf['memcache']['weight'] = array();\n\
\$conf['memcache']['persistent'] = false;\n\
\$conf['memcache']['compression'] = false;\n\
\$conf['memcache']['large_items'] = true;" /var/www/webmail/config/conf.php
/bin/mkdir /var/cache/horde
/bin/chown www-data:root /var/cache/horde
/bin/chmod 0700 /var/cache/horde
/bin/sed -i -e "/^\(.*conf.*umask.*=\).*/a\
\$conf['tmpdir'] = '/var/cache/horde';" /var/www/webmail/config/conf.php
/bin/cp /var/www/webmail/scripts/temp-cleanup.cron /etc/cron.daily/horde-temp-cleanup
/bin/chmod +x /etc/cron.daily/horde-temp-cleanup
/bin/sed -i -e 's/^\(TMP_DIR=\).*/\1\/var\/cache\/horde/' /etc/cron.daily/horde-temp-cleanup
/bin/echo "# /etc/cron.d/horde : crontab fragment for horde
# Horde Alarms
*/5 * * * * /usr/bin/php /var/www/webmail/scripts/alarms.php" \
| /usr/bin/tee /etc/cron.d/horde
/bin/chown www-data /var/lib/php5
sed -i -e 's/\/usr\/local\/bin\/xlhtml/\/usr\/bin\/xlhtml/' \
-e 's/\/usr\/local\/bin\/ppthtml/\/usr\/bin\/ppthtml/' \
/var/www/webmail/config/mime_drivers.php
sed -i -e "s/\/\/ \('deb'\)/\1/g" \
-e "s/\/\/ \('enscript'\)/\1/g" \
-e "s/\/\/ \('msword'\)/\1/g" \
-e "s/\/\/ \('msexcel'\)/\1/g" \
-e "s/\/\/ \('mspowerpoint'\)/\1/g" \
-e "s/\/\/ \('rpm'\)/\1/g" \
-e "s/\/\/ \('rtf'\)/\1/g" \
-e "s/\/\/ \('srchighlite'\)/\1/g" \
-e "s/\/\/ \('webcpp'\)/\1/g" \
-e "s/\/\/ \('wordperfect'\)/\1/g" \
/var/www/webmail/config/mime_drivers.php
/bin/sed -i -e "/^\(.*conf.*sessionhandler.*type.*=\).*/a\
\$conf['mime']['magic_db'] = '/usr/share/file/magic';" /var/www/webmail/config/conf.php
/bin/sed -i -e '/.*mime_drivers.*imp.*html.*=.*array.*/{n;d}' /var/www/webmail/imp/config/mime_drivers.php
/bin/sed -i -e "/.*mime_drivers.*imp.*html.*=.*array.*/a\
'inline' => true," /var/www/webmail/imp/config/mime_drivers.php
/bin/sed -i -e "s/^\(.*'value' =>\).*'sent-mail',/\1 'Sent',/" /var/www/webmail/imp/config/prefs.php
/bin/sed -i -e "s/^\(.*'value' =>\).*'drafts',/\1 'Drafts',/" /var/www/webmail/imp/config/prefs.php
/bin/sed -i -e "s/^\(.*'value' =>\).*'trash',/\1 'Trash',/" /var/www/webmail/imp/config/prefs.php
/bin/sed -i -e "s/^\(.*'value' =>\).*'Spam',/\1 'Junk',/" /var/www/webmail/imp/config/prefs.php
/bin/sed -i -e "s/^\(.*'value' =>\).*'sent-mail',/\1 '&AMk-l&AOk-ments envoy&AOk-s',/" /var/www/webmail/imp/config/prefs.php
/bin/sed -i -e "s/^\(.*'value' =>\).*'drafts',/\1 'Brouillons',/" /var/www/webmail/imp/config/prefs.php
/bin/sed -i -e "s/^\(.*'value' =>\).*'trash',/\1 '&AMk-l&AOk-ments supprim&AOk-s',/" /var/www/webmail/imp/config/prefs.php
/bin/sed -i -e 's/^\(.*mailbox.*show_preview.*=\).*;/\1 true;/' /var/www/webmail/imp/config/conf.php
/bin/sed -i -e 's/^\(.*mboxcache.*use_mboxcache.*=\).*;/\1 true;/' /var/www/webmail/imp/config/conf.php
/bin/sed -i -e "/^\(.*conf.*mboxcache.*use_mboxcache.*=\).*/i\
\$conf['mboxcache']['use_compress'] = false;\n\
\$conf['mboxcache']['preview_size'] = 1000;\n\
\$conf['mboxcache']['lifetime'] = 2592000;" /var/www/webmail/imp/config/conf.php
/bin/sed -i -e 's/^\(.*mlistcache.*use_mlistcache.*=\).*;/\1 true;/' /var/www/webmail/imp/config/conf.php
/bin/sed -i -e "/^\(.*conf.*mlistcache.*use_mlistcache.*=\).*/i\
\$conf['mlistcache']['lifetime'] = 604800;" /var/www/webmail/imp/config/conf.php
/bin/sed -i -e 's/^\(.*mailbox.*show_attachments.*=\).*;/\1 true;/' \
-e 's/^\(.*mailbox.*show_xpriority.*=\).*;/\1 true;/' \
/var/www/webmail/imp/config/conf.php
/bin/sed -i -e 's/^\(.*server.*cachejs.*=\).*;/\1 true;/' /var/www/webmail/imp/config/conf.php
/bin/sed -i -e "/^\(.*conf.*server.*cachejs.*=\).*/i\
\$conf['server']['cachejsparams']['timeout'] = 86400;\n\
\$conf['server']['cachejsparams']['mtime'] = false;" /var/www/webmail/imp/config/conf.php
/bin/sed -i -e 's/^\(.*server.*cachecss.*=\).*;/\1 true;/' /var/www/webmail/imp/config/conf.php
/bin/sed -i -e "/^\(.*conf.*server.*cachecss.*=\).*/i\
\$conf['server']['cachecssparams']['timeout'] = 86400;\n\
\$conf['server']['cachecssparams']['mtime'] = false;" /var/www/webmail/imp/config/conf.php
/bin/sed -i -e 's/^\(.*server.*cachejs.*=\).*;/\1 true;/' /var/www/webmail/dimp/config/conf.php
/bin/sed -i -e "/^\(.*conf.*server.*cachejs.*=\).*/i\
\$conf['server']['cachejsparams']['timeout'] = 86400;\n\
\$conf['server']['cachejsparams']['mtime'] = false;" /var/www/webmail/dimp/config/conf.php
/bin/sed -i -e 's/^\(.*server.*cachecss.*=\).*;/\1 true;/' /var/www/webmail/dimp/config/conf.php
/bin/sed -i -e "/^\(.*conf.*server.*cachecss.*=\).*/i\
\$conf['server']['cachecssparams']['timeout'] = 86400;\n\
\$conf['server']['cachecssparams']['mtime'] = false;" /var/www/webmail/dimp/config/conf.php
/bin/sed -i -e "/^\(.*conf.*portal.*fixed_blocks.*=\).*/a\
\$conf['fortune']['exec_path'] = '/usr/games/fortune';" /var/www/webmail/config/conf.php
/bin/sed -i \
-e "s/^\(.*spell.*driver.*=\).*;/\1 'aspell';/" \
-e "/^\(.*conf.*spell.*driver.*=\).*/i\
\$conf['spell']['path'] = '/usr/bin/aspell';" /var/www/webmail/imp/config/conf.php
/bin/sed -i -e "/^\(.*conf.*utils.*gnupg_keyserver.*=\).*/i\
\$conf['utils']['gnupg'] = '/usr/bin/gpg';" /var/www/webmail/imp/config/conf.php
/bin/sed -i -e "/^\(.*conf.*menu.*print.*=\).*/i\
\$conf['utils']['gnupg'] = '/usr/bin/gpg';" /var/www/webmail/mnemo/config/conf.php
/bin/sed -i -e "/^\(.*conf.*utils.*gnupg_timeout.*=\).*/a\
\$conf['utils']['openssl_cafile'] = '/etc/ssl/certs';\n\
\$conf['utils']['openssl_binary'] = '/usr/bin/openssl';" /var/www/webmail/imp/config/conf.php
/usr/bin/find /var/www/webmail -type f -wholename "*config/*" | /usr/bin/xargs /bin/chown -R root:www-data
/usr/bin/find /var/www/webmail -type f -wholename "*config/*" | /usr/bin/xargs /bin/chmod 0440
/usr/bin/find /var/www/webmail -type f -name "test.php" | /usr/bin/xargs /bin/chmod a-rwx
/usr/bin/find /var/www/webmail -type d -name "scripts" | /usr/bin/xargs /bin/chown -R root:root
/usr/bin/find /var/www/webmail -type d -name "scripts" | /usr/bin/xargs /bin/chmod -R go-rwx
/bin/chmod -R ugo-w /var/www/webmail
/bin/echo "# Secure PHP for horde
expose_php = Off
display_errors = Off
log_errors = On
register_globals = Off
" | tee /etc/php5/conf.d/horde.ini
/etc/init.d/apache2 restart


Configuraciones porteriores y personalización general de Horde Webmail Edition.

Para cambiar el pie de firma por defecto editar:


nano /var/www/webmail/imp/config/trailer.txt


----------------------------------------------------------------
This message was sent using IMP, the Internet Messaging Program.


Cambiar lo que esta debajo por lo que sea conveniente por ejemplo:

----------------------------------------------------------------
Este mensaje fue enviado desde mail.sandi.org id jdjdjdjd


Cambiar la identidad por defecto:


Alrededor de la linea 105 en /var/www/webmail/lib/Horde/Identity.php exite lo siguiente
if (empty($identity['id'])) {
$identity['id'] = _("Default Identity");
}


podemos cambiarlo por ejemplo a:


if (empty($identity['id'])) {
$identity['id'] = _("Mi servidor de Ejemplo");
}


Esto para cambiar la identidad por defecto de todos los usuarios.

Ahora para establecer el tema por defecto en le archivo /var/www/webmail/config/prefs.php en la linea 304 tenemos


// UI theme
$_prefs['theme'] = array(
'value' => 'default',
'locked' => false,
'shared' => true,
'type' => 'select',
'desc' => _("Select your color scheme.")
);


Podemos cambiar para usar por ejemplo el tema tango-blue


// UI theme
$_prefs['theme'] = array(
'value' => 'tango-blue',
'locked' => false,
'shared' => true,
'type' => 'select',
'desc' => _("Select your color scheme.")
);


listo ahora todos los usuarios tendran el mismo tema/skin en el entorno web.

ahora para seleccionar un servidor por defecto editamos


/var/www/webmail/imp/config/servers.php


En la ultima parte podemos cambiar todo de manera que quede como se muestra acontinuación.


$servers['_prompt'] = array(
'name' => _("Choose a mail server:")
);


/* Example configurations: */

$servers['imap'] = array(
'name' => 'Sandi MailServer',
'server' => 'localhost',
'hordeauth' => false,
'protocol' => 'imap/notls',
'port' => 143,
);

ahora para quitar el pie de pagina de todo el webmail o cambiar la imagen editamos


/var/www/webmail/imp/config/motd.php


en la ultima linea añadimos <!-- --> para comentar:


<!--
<table width="100%">
<tr>
<td align="center"></td>
</tr>
</table>
-->

o cambiamos la imagen por defecto por otra.


<table width="100%"><tr><td align="center"><?php echo Horde::img('sandi-logo.png', _("Sandi.org"), '', $registry->getImageDir('horde')) ?></td></tr></table>

Para cambiar los correos por defecto editamos:


nano /var/www/webmail/config/hooks.php


y al final añadimos:


if (!function_exists('_passwd_hook_userdn')) {
function _passwd_hook_userdn($auth)
{
return 'uid=' . $auth . ',ou=people,o=sandi.org';
}
}


Para cambiar los correos por defecto editamos


nano /var/www/webmail/config/registry.php


y cambiamos:


$this->applications['horde'] = array(
'fileroot' => dirname(__FILE__) . '/..',
'webroot' => _detect_webroot(),
'initial_page' => 'login.php',
'name' => _("Horde"),
'status' => 'active',
'templates' => dirname(__FILE__) . '/../templates',
'provides' => 'horde',
);


por


$this->applications['horde'] = array(
'fileroot' => dirname(__FILE__) . '/..',
'webroot' => _detect_webroot(),
'initial_page' => 'login.php',
'name' => _("C.A.S. Mail Server"),
//'name' => _(preg_replace('/^webmail./', '', $GLOBALS['HTTP_SERVER_VARS']['SERVER_NAME']) ),
'status' => 'active',
'templates' => dirname(__FILE__) . '/../templates',
'provides' => 'horde',
);


Instalar y configurar passwd
Descargar y descomprimir passwd donde tengamos instalado horde webmail:

wget ftp://ftp.horde.org/pub/passwd/passwd-h3-3.1.tar.gz


cp passwd-h3-3.1.tar.gz /var/www/webmail


tar xvf passwd-h3-3.1.tar.gz


mv passwd-h3-3.1 passwd


Instalar Poppassd y xinetd:

apt-get install poppassd xinetd


Buscar o editar en /etc/services solo debe existir un solo poppassd


poppassd 106/tcp


Editar poppassd en /etc/xinetd.d/
Añadimos lo sgte:


service poppassd
{
disable = no
socket_type = stream
wait = no
user = root
server = /usr/sbin/poppassd
log_on_success += HOST DURATION
log_on_failure += HOST
}


Editar poppassd en /etc/pam.d/

#%PAM-1.0
@include common-auth
@include common-password


Editar /var/www/webmail/passwd/config/conf.php y añadir:

$conf['menu']['apps'] = array('imp', 'ingo', 'kronolith', 'turba');
$conf['backend']['backend_list'] = 'hidden';
$conf['user']['change'] = true;
$conf['user']['refused'] = array('root', 'bin', 'daemon', 'adm', 'lp', 'shutdow$
$conf['password']['strengthtests'] = true;
$conf['hooks']['full_name'] = true;
$conf['hooks']['default_username'] = false;
$conf['hooks']['username'] = false;
$conf['hooks']['userdn'] = false;

Editar /var/www/webmail/config/registry.php y añadir esto:

$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,
'status' => 'active'
);


Editar /var/www/webmail/imp/config/conf.php y añadir esto al final:


$conf['menu']['apps'] = array('turba', 'passwd');


Editar /var/www/webmail/passwd/config/backends.php (borrar todo y poner solo lo siguiente:


'http://www.ejemplo.com',
'preferred' => '',
'password policy' => array(),
'driver' => 'poppassd',
'params' => array(
'host' => 'localhost',
'port' => 106
)
);


bien con esto probamos en un navegador la pagina webmail:


http://www.tuip.com/webmail


Espero a alguien le sirva, son recopilaciones de lo que hize en un pequeño tiempo que tenia.

Saludos desde Llallagua - Bolivia

2 comentarios:

  1. [...] This post was mentioned on Twitter by Gary Sandi Vigabriel. Gary Sandi Vigabriel said: Post: Horde Webmail + poppassd | Debian Lenny o Squeeze http://www.garysandi.com/?p=456 [...]

    ResponderEliminar
  2. Ecxelente!! grx!

    bueno en realidad a mi no me funciono aún:

    http://www.esdebian.org/foro/43447/corriendo-testphp-horde-webmail-luego-instalado-configurado

    ResponderEliminar