Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- *Creacion de las tablas en mysql
- mysql localhost -u root -p
- CREATE DATABASE postfix;
- GRANT SELECT, INSERT, UPDATE, DELETE ON postfix.* TO 'postusr'@'localhost' IDENTIFIED BY '1234';
- GRANT SELECT, INSERT, UPDATE, DELETE ON postfix.* TO 'postusr'@'localhost.localdomain' IDENTIFIED BY '1234';
- FLUSH PRIVILEGES;
- USE postfix;
- mysql -u root -p < archivo.sql
- (donde archivo.sql es lo siguiente)
- DROP TABLE IF EXISTS `users`;
- CREATE TABLE `users` (
- `id` varchar(128) NOT NULL default '',
- `address` varchar(128) NOT NULL default '',
- `crypt` varchar(128) NOT NULL default '',
- `clear` varchar(128) NOT NULL default '',
- `name` varchar(128) NOT NULL default '',
- `uid` smallint(5) unsigned NOT NULL default '1000',
- `gid` smallint(5) unsigned NOT NULL default '1000',
- `home` varchar(128) NOT NULL default '/',
- `domain` varchar(128) NOT NULL default '',
- `maildir` varchar(255) NOT NULL default '',
- `quota` bigint(20) DEFAULT '10485760',
- `imapok` tinyint(3) unsigned NOT NULL default '1',
- `bool1` tinyint(3) unsigned NOT NULL default '1',
- `bool2` tinyint(3) unsigned NOT NULL default '1',
- PRIMARY KEY (`id`),
- UNIQUE KEY `id` (`id`),
- UNIQUE KEY `address` (`address`),
- KEY `id_2` (`id`),
- KEY `address_2` (`address`)
- ) ENGINE=MyISAM DEFAULT CHARSET=latin1;
- DROP TABLE IF EXISTS `domains`;
- CREATE TABLE domains (
- domain varchar(50) NOT NULL,
- PRIMARY KEY (`domain`)
- ) TYPE=MyISAM;
- DROP TABLE IF EXISTS `forwardings`;
- CREATE TABLE `forwardings` (
- `source` varchar(80) NOT NULL,
- `destination` TEXT NOT NULL,
- PRIMARY KEY (`source`)
- ) TYPE=MyISAM;
- CONFIGURACION POSTFIX PARA USUARIOS VIRTUALES:
- editar /etc/postfix/main.cf
- agregar las lineas:
- virtual_alias_domains =
- virtual_mailbox_base = /home/vmail/
- virtual_uid_maps = static:5000
- virtual_gid_maps = static:5000
- virtual_alias_maps = mysql:/etc/postfix/mysql-virtual_forwardings.cf
- virtual_mailbox_domains = mysql:/etc/postfix/mysql-virtual_domains.cf
- virtual_mailbox_maps = mysql:/etc/postfix/mysql-virtual_mailboxes.cf
- ARCHIVOS DE CONFIGURACION EN /etc/postfix/
- #DOMINIOS VIRTUALES CON LOS QUE VA A TRABAJAR POSTFIX
- /etc/postfix/mysql-virtual_domains.cf
- user = postusr
- password = 1234
- dbname = postfix
- table = domains
- select_field = domain
- where_field = domain
- hosts = 127.0.0.1
- #CONFIGURACION DE FORWARDINGS
- /etc/postfix/mysql-virtual_forwardings.cf
- user = postusr
- password = 1234
- dbname = postfix
- table = forwardings
- select_field = destination
- where_field = source
- hosts = 127.0.0.1
- #CONFIGURACION DE LAS CASILLAS DE CORREO DE LOS USUARIOS
- /etc/postfix/mysql-virtual_mailboxes.cf
- user = postusr
- password = 1234
- dbname = postfix
- table = users
- select_field = maildir
- where_field = email
- hosts = 127.0.0.1
- CREAMOS UN USUARIO EN LA BASE DE DATOS: (modificar los datos)
- insert into users values ('dicor@midominio.com','dicor@midominio.com',encrypt('1234'),'','Diego Cordoba',5000,5000,'/home/vmail/','midominio.com','midominio.com/dicor/Maildir/',0,1,1,1);
- CREAMOS UN DOMINIO:
- INSERT INTO `domains` (`domain`) VALUES ('midominio.com');
- CREAMOS UN ALIAS:
- INSERT INTO `forwardings` (`source`, `destination`) VALUES ('ventas@midominio.com', 'dicor@midominio.com');
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement