octubre
2009
Servidor de correo II
Continuando con nuestra instalación de un servidor de correo y ya teniendo los ingredientes instalados, ahora vamos a crear la base de datos. Asumimos que tenemos mysql instalado en nuestro servidor (casi por default cualquier distribución lo instala, en el caso particular de ubuntu que es el que estamos tratando ya lo trae).
Entramos a nuestra base de datos con la clave creada (o si no tiene simplemente dar enter):
root©correo:~# mysql -u root -p Enter password: Welcome to the MySQL monitor. Commands end with ; or g. Your MySQL connection id is 912 Type 'help;' or 'h' for help. Type 'c' to clear the buffer. mysql>
... ya estando dentro:
mysql> CREATE DATABASE `postfix` /*!40100 DEFAULT CHARACTER SET utf8 */ ; mysql> GRANT ALL PRIVILEGES ON postfix.* TO "postuser"@"localhost" IDENTIFIED BY "password" mysql> FLUSH PRIVILEGES; mysql> exit;
Ahora, entramos con el usuario y contraseña creados y creamos las tablas:
root©correo:~# mysql -u postuser -p postfix mysql> CREATE TABLE `alias` ( `address` varchar(255) NOT NULL default '', `goto` text NOT NULL, `domain` varchar(255) NOT NULL default '', `created` datetime NOT NULL default '0000-00-00 00:00:00', `modified` datetime NOT NULL default '0000-00-00 00:00:00', `active` tinyint(1) NOT NULL default '1', PRIMARY KEY (`address`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='Virtual Aliases'; mysql> CREATE TABLE `domain` ( `domain` varchar(255) NOT NULL default '', `description` varchar(255) NOT NULL default '', `aliases` int(10) NOT NULL default '0', `mailboxes` int(10) NOT NULL default '0', `maxquota` int(10) NOT NULL default '0', `transport` varchar(255) default NULL, `backupmx` tinyint(1) NOT NULL default '0', `created` datetime NOT NULL default '0000-00-00 00:00:00', `modified` datetime NOT NULL default '0000-00-00 00:00:00', `active` tinyint(1) NOT NULL default '1', PRIMARY KEY (`domain`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='Virtual Domains'; mysql> CREATE TABLE `mailbox` ( `username` varchar(255) NOT NULL default '', `password` varchar(255) NOT NULL default '', `name` varchar(255) NOT NULL default '', `maildir` varchar(255) NOT NULL default '', `quota` bigint(20) NOT NULL default '524288000', `domain` varchar(255) NOT NULL default '', `created` datetime NOT NULL default '0000-00-00 00:00:00', `modified` datetime NOT NULL default '0000-00-00 00:00:00', `active` tinyint(1) NOT NULL default '1', PRIMARY KEY (`username`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='Virtual Mailboxes';
De esta forma ya tendremos nuestras tablas de alias, dominios y usuarios virtuales. Ahora llenamos datos de pruebas, para efectos de pruebas utilizaremos el dominio example.org
mysql> INSERT INTO domain VALUES('example.org','Servidor de ejemplo',0,0,0,null,0,now(),now(),'1');
mysql> INSERT INTO alias VALUES('postmaster©example.org','toro©example.org','example.org',now(),now(),'1');
mysql> INSERT INTO mailbox VALUES('toro©example.org','secret','Jorge M','example.org/toro/',524288000,'example.org',now(),now(),'1');
OK, con esto tenemos creado el dominio virtual example.org, tenemos un alias postmaster©example.org que enviará el correo al usuario real (virtual en este caso) llamado toro©example.org. La tercera línea añadió el usuario toro©example.org con contraseña secret y el directorio example.org/toro/ que será relativo al que establezcamos en postfix (siguiente post).
Por ahora así lo dejaremos y continuaremos con la configuración de postfix en el siguiente artículo.
Está sustituido el ARROBA "@" por el símbolo © debido a un problemita con mi template del blog que sustituye los “@”.
Dos es mejor que uno... supongo :/ ]
del.icio.us Estrella este post
Entradas relacionadas:
Han escrito 2 comentarios de «Servidor de correo II»
germangv
Jueves 22 de octubre, 2009 12:11.-
esperemos que no terminen hackeandote… ya que andas regalando los codigos XD saludos!!!

(anonimo)Bruno
Lunes 16 de noviembre, 2009 18:57. [usuario no registrado en ymipollo.com]-
Pues esperando a que publiques la otra parte :) ¡Excelente How to!

