Servidor Correu: diferència entre les revisions
De FFAWiki
Línia 32: | Línia 32: | ||
* CREATE TABLE `virtual_domains` ( `id` INT NOT NULL AUTO_INCREMENT, `name` VARCHAR(50) NOT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; | * CREATE TABLE `virtual_domains` ( `id` INT NOT NULL AUTO_INCREMENT, `name` VARCHAR(50) NOT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; | ||
====== Taula correus virtuals ====== | |||
* CREATE TABLE `virtual_users` ( | |||
`id` INT NOT NULL AUTO_INCREMENT, | |||
`domain_id` INT NOT NULL, | |||
`password` VARCHAR(106) NOT NULL, | |||
`email` VARCHAR(120) NOT NULL, | |||
PRIMARY KEY (`id`), | |||
UNIQUE KEY `email` (`email`), | |||
FOREIGN KEY (domain_id) REFERENCES virtual_domains(id) ON DELETE CASCADE | |||
) ENGINE=InnoDB DEFAULT CHARSET=utf8; | |||
====== Taula alias virtuals ====== | |||
* CREATE TABLE `virtual_aliases` ( | |||
`id` INT NOT NULL AUTO_INCREMENT, | |||
`domain_id` INT NOT NULL, | |||
`source` varchar(100) NOT NULL, | |||
`destination` varchar(100) NOT NULL, | |||
PRIMARY KEY (`id`), | |||
FOREIGN KEY (domain_id) REFERENCES virtual_domains(id) ON DELETE CASCADE | |||
) ENGINE=InnoDB DEFAULT CHARSET=utf8; | |||
====Postfix==== | ====Postfix==== | ||
====Dovecot==== | ====Dovecot==== | ||
====Roundcube==== | ====Roundcube==== |
Revisió del 00:57, 10 set 2022
Postfix, Mysql, Dovecot i Roundcube
Preparació
Instal·lació
- sudo apt-get install postfix postfix-mysql dovecot-core dovecot-imapd dovecot-pop3d dovecot-lmtpd dovecot-mysql roundcube roundcube-core
Configuració
Mysql
- sudo mysql
Crear usuari i BD
- CREATE DATABASE mailserver;
- CREATE USER 'mailuser'@'127.0.0.1' IDENTIFIED BY 'password';
- GRANT SELECT ON mailserver.* TO 'mailuser'@'127.0.0.1';
- FLUSH PRIVILEGES;
Crear Taules
- USE mailserver;
Taula dominis virtuals
- CREATE TABLE `virtual_domains` ( `id` INT NOT NULL AUTO_INCREMENT, `name` VARCHAR(50) NOT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
Taula correus virtuals
- CREATE TABLE `virtual_users` (
`id` INT NOT NULL AUTO_INCREMENT, `domain_id` INT NOT NULL, `password` VARCHAR(106) NOT NULL, `email` VARCHAR(120) NOT NULL, PRIMARY KEY (`id`), UNIQUE KEY `email` (`email`), FOREIGN KEY (domain_id) REFERENCES virtual_domains(id) ON DELETE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
Taula alias virtuals
- CREATE TABLE `virtual_aliases` (
`id` INT NOT NULL AUTO_INCREMENT, `domain_id` INT NOT NULL, `source` varchar(100) NOT NULL, `destination` varchar(100) NOT NULL, PRIMARY KEY (`id`), FOREIGN KEY (domain_id) REFERENCES virtual_domains(id) ON DELETE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8;