[2024-feb-29] Sad news: Eric Layton aka Nocturnal Slacker aka vtel57 passed away on Feb 26th, shortly after hospitalization. He was one of our Wiki's most prominent admins. He will be missed.

Welcome to the Slackware Documentation Project

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
howtos:network_services:postfix_dovecot_mysql:database [2015/02/16 21:09 (UTC)] astrogeekhowtos:network_services:postfix_dovecot_mysql:database [2015/06/11 14:42 (UTC)] (current) – [Creating Mail Database Tables] tim
Line 1: Line 1:
-===== Virtual Mail Server Database =====+====== Virtual Mail Server Database =====
 + 
 +This page is supplemental to main article: [[howtos:network_services:postfix_dovecot_mysql|Creating a Virtual Mail Server with Postfix, Dovecot and MySQL]]
  
 The database is used to provide configuration and authentication for your virtual mail domains and mail boxes. Email content is not stored in the database in this configuration. The database is used to provide configuration and authentication for your virtual mail domains and mail boxes. Email content is not stored in the database in this configuration.
Line 57: Line 59:
   * virtual_users - Contains an entry for each virtual mail box served   * virtual_users - Contains an entry for each virtual mail box served
   * virtual_aliases - Maps aliases (source) to actual mail boxes (destination)   * virtual_aliases - Maps aliases (source) to actual mail boxes (destination)
 +to create these tables, type
 +<code>mysql --user="mailuser" -p -e "CREATE TABLE virtual_domains( id INT NOT NULL AUTO_INCREMENT, name VARCHAR(50) NOT NULL, PRIMARY KEY ( id ) );" mailserver
 +
 +mysql --user="mailuser" -p -e "CREATE TABLE virtual_users( id INT NOT NULL AUTO_INCREMENT, domain_id INT NOT NULL , password VARCHAR(106) NOT NULL, email VARCHAR(100) NOT NULL, PRIMARY KEY ( id ) ,FOREIGN KEY (domain_id) REFERENCES virtual_domains(id));" mailserver
  
 +mysql --user="mailuser" -p -e "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) );" mailserver
 +</code> each time supplying the password you gave for the mysql mailuser user.
 ==== Adding Domain Entries ==== ==== Adding Domain Entries ====
 To add entries to the virtual_domains table using the mysql client: To add entries to the virtual_domains table using the mysql client:
Line 147: Line 155:
 For troubleshooting, use the queries shown above to verify the domains, email users and aliases in the database at any time, and to reset virtual user passwords. For troubleshooting, use the queries shown above to verify the domains, email users and aliases in the database at any time, and to reset virtual user passwords.
 [[howtos:network_services:postfix_dovecot_mysql|Return to main article page]] [[howtos:network_services:postfix_dovecot_mysql|Return to main article page]]
 +====== Sources ======
 +  * Originally written by [[wiki:user:astrogeek | astrogeek]]
 {{tag>howtos email postfix dovecot mysql}} {{tag>howtos email postfix dovecot mysql}}
 howtos:network_services:postfix_dovecot_mysql:database ()