106DovecotMariaDB - amagerard/Mail GitHub Wiki
RedHat10/Mail
| 1- Network | 2- Postfix | 3- Dovecot | 4- Postfixadmin | 5- PostfixMariaDB | 6- DovecotMariaDB | 
|---|---|---|---|---|---|
| 7- RelaySmtp | 8- Troubleshoot | 9- Selinux | 10- GnomeShell | 11- Maintenance | 
6. Dovecot-MariaDB
6.1 Part Three (3/3).
Configure Dovecot to use MySQL / MARIADB database.
6.2 Installation.
dnf install -y dovecot-mysql
6.3 Configuration.
vi /etc/dovecot/conf.d/10-mail.conf
mail_location = maildir:~/Maildir  
mail_home = /var/vmail/%d/%n  
vi /etc/dovecot/conf.d/10-auth.conf
auth_username_format = %u  
!include auth-sql.conf.ext  
#!include auth-system.conf.ext  
auth_debug = yes  
auth_debug_passwords = yes  
vi /etc/dovecot/dovecot-sql.conf.ext
driver = mysql  
connect = host=localhost dbname=postfixadmin user=postfixadmin password=D51mAB49!  
#  
default_pass_scheme = DES-CRYPT  
#  
password_query = SELECT username AS user,password FROM mailbox WHERE username = '%u' AND active='1'  
#  
user_query = SELECT maildir, 2000 AS uid, 2000 AS gid FROM mailbox WHERE username = '%u' AND active='1'  
#  
iterate_query = SELECT username AS user FROM mailbox  
systemctl restart dovecot
6.4 Test
Create 2 mail accounts from postfixadmin.
Use Geary (https://flathub.org/en/apps/org.gnome.Geary) and add the 2 email accounts.
Send and receive messages between the 2 email accounts.
IMAP 143 TLS , 993 SSL
SMTP 587 TLS , 465 SSL