después de tener funcionando la máquina virtual y poder ejecutar los tests, es hora de configurar el servidor que nos ayudará a probar los tests IMAP, primero hay que instalar el software necesario:
Activando IMAP en PHP
Por defecto el php no viene configurado con la extensión IMAP, de forma que hay que recompilar php para poder incluirla, lo primero es instalar algunas dependencias que la extensión necesita:
Se le pedirá de nuevo el password y que confirme que quiere instalar los dos paquetes, debería tener una salida (mas larga) como esta:
[sudo] password for tester:
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following extra packages will be installed:
mlock
Suggested packages:
uw-mailutils
The following NEW packages will be installed:
libc-client2007b mlock
0 upgraded, 2 newly installed, 0 to remove and 2 not upgraded.
Need to get 778kB of archives.
After this operation, 1618kB of additional disk space will be used.
Do you want to continue [Y/n]? Y
Get:1 http://us.archive.ubuntu.com intrepid/universe mlock 7:2007b~dfsg-2 [30.8kB]
Get:2 http://us.archive.ubuntu.com intrepid/universe libc-client2007b 7:2007b~dfsg-2 [747kB]
Fetched 778kB in 3s (203kB/s)
Selecting previously deselected package mlock.
(Reading database ... 60923 files and directories currently installed.)
Unpacking mlock (from .../mlock_7%3a2007b~dfsg-2_i386.deb) ...
Selecting previously deselected package libc-client2007b.
Unpacking libc-client2007b (from .../libc-client2007b_7%3a2007b~dfsg-2_i386.deb) ...
Processing triggers for man-db ...
Setting up mlock (7:2007b~dfsg-2) ...
Setting up libc-client2007b (7:2007b~dfsg-2) ...
Processing triggers for libc6 ...
ldconfig deferred processing now taking place
nos va a preguntar por el password de nuevo ( el password es 1234 ) y si realmente queremos instalar, a lo que respondemos con "Y", si todo sale bien, se verá algo como:
[sudo] password for tester:
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following extra packages will be installed:
dovecot-common
The following NEW packages will be installed:
dovecot-common dovecot-imapd
0 upgraded, 2 newly installed, 0 to remove and 2 not upgraded.
Need to get 4438kB of archives.
After this operation, 9114kB of additional disk space will be used.
Do you want to continue [Y/n]? Y
Get:1 http://us.archive.ubuntu.com intrepid-updates/main dovecot-common 1:1.1.4-0ubuntu1.2 [3517kB]
Get:2 http://us.archive.ubuntu.com intrepid-updates/main dovecot-imapd 1:1.1.4-0ubuntu1.2 [921kB]
Fetched 4438kB in 28s (158kB/s)
Selecting previously deselected package dovecot-common.
(Reading database ... 60651 files and directories currently installed.)
Unpacking dovecot-common (from .../dovecot-common_1%3a1.1.4-0ubuntu1.2_i386.deb) ...
Selecting previously deselected package dovecot-imapd.
Unpacking dovecot-imapd (from .../dovecot-imapd_1%3a1.1.4-0ubuntu1.2_i386.deb) ...
Processing triggers for ufw ...
Processing triggers for man-db ...
Setting up dovecot-common (1:1.1.4-0ubuntu1.2) ...
Creating config file /etc/dovecot/dovecot.conf with new version
Creating config file /etc/dovecot/dovecot-ldap.conf with new version
Creating config file /etc/dovecot/dovecot-sql.conf with new version
adduser: Warning: The home directory `/usr/lib/dovecot' does not belong to the user you are currently creating.
You already have ssl certs for dovecot.
Setting up dovecot-imapd (1:1.1.4-0ubuntu1.2) ...
* Restarting IMAP/POP3 mail server dovecot [ OK ]
{mospagebreak title=Configurando Dovecot}
Configurando Dovecot
ahora es necesario configurarlo, hay que editar el archivo de configuración del servidor de correo para hacerlo, escriba en la línea de comandos:
Se le pedirá dos veces que escriba el password para el nuevo usuario:
Enter new UNIX password:
Retype new UNIX password:
Es necesario crear el usuario que se usará en las pruebas, solo el usuario webmaster necesita password, la información de los passwords se guarda en el archivo /etc/dovecot/dovecotpass, para crearlo use el comando:
Ahora vamos a probar que el servidor esté corriendo y que nos podemos autenticar correctamente, en la línea de comandos escriba:
telnet localhost 143
Y debe obtener (en negrilla lo que ud debe escribir:
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
* OK Dovecot ready.
a login
1234
a OK Logged in.
b select inbox
* FLAGS (\Answered \Flagged \Deleted \Seen \Draft)
* OK [PERMANENTFLAGS (\Answered \Flagged \Deleted \Seen \Draft \*)] Flags permitted.
* 0 EXISTS
* 0 RECENT
* OK [UIDVALIDITY 1] UIDs valid
* OK [UIDNEXT 1] Predicted next UID
b OK [READ-WRITE] Select completed.
c list "" *
* LIST (\HasNoChildren \UnMarked) "/" "INBOX"
c OK List completed.
d logout
* BYE Logging out
d OK Logout completed.
Connection closed by foreign host.
Andrés F Vargas es un programador Colombiano, que le gusta el open source, en los últimos años se ha enfocado en el desarrollo y operación de aplicaciones web.