![]() ![]() chmod o= /etc/postfix/mysql-virtual_ *.cfĬhgrp postfix /etc/postfix/mysql-virtual_ *.cf Step 4 Time to make the files readable for Postfix user. Query = SELECT email FROM users WHERE email='%s' nano /etc/postfix /mysql-virtual_email2email.cf Query = SELECT CONCAT (SUBSTRING_INDEX(email, 1), '/', SUBSTRING_INDEX (email, 1), '/') FROM users WHERE email= '%s'Īnd the last one for matching users to addresses. ![]() nano /etc/postfix /mysql-virtual_mailboxes.cf Query = SELECT destination FROM forwardings WHERE source='%s'Īnd another one, for the mail boxes. nano /etc/postfix /mysql-virtual_forwardings.cf Query = SELECT domain AS virtual FROM domains WHERE domain= '%s' hosts = 127.0. Be sure you use the same password as earlier: user = mail_admin nano /etc/postfix /mysql-virtual_domains.cfĪdd this to the file you just created. Now it’s time to configure Postfix to use MySQL to check for mailboxes. Restart MySQL /etc/inid.d /mysql restart Step 3 Choose your own password CREATE DATABASE mail USE mail GRANT SELECT, INSERT, UPDATE, DELETE ON mail.* TO 'localhost' IDENTIFIED BY 'mail_admin_password' GRANT SELECT, INSERT, UPDATE, DELETE ON mail.* TO 'localhost.localdomain' IDENTIFIED BY 'mail_admin_password' FLUSH PRIVILEGES CREATE TABLE domains ( domain varchar( 50) NOT NULL, PRIMARY KEY ( domain) ) CREATE TABLE forwardings (source varchar( 80) NOT NULL, destination TEXT NOT NULL, PRIMARY KEY (source) ) CREATE TABLE users (email varchar( 80) NOT NULL, password varchar( 20) NOT NULL, PRIMARY KEY (email) ) CREATE TABLE transport ( domain varchar( 128) NOT NULL default '', transport varchar( 128) NOT NULL default '', UNIQUE KEY domain ( domain) ) Set up MySQL for domains, users and email addresses.Īnd enter your password you chose in Step 1. This has nothing to do with your future email addresses. On the next screen, choose a domain name for your mail server. ![]() In the first step of the Postfix installation, choose “Internet Site”. When the GUI for MySQL password pops up, pick a secure password and dont loose it! apt-get install postfix postfix-mysql postfix-doc mysql-client mysql- server dovecot-common dovecot-imapd dovecot-pop3d libsasl2- 2 libsasl2-modules libsasl2-modules- sql sasl2- bin libpam-mysql openssl telnet mailutils You are assumed to have your own server or VPS with root access. If you want to set up your own mail hosting, just follow this guide. I’ve written a new post on this topic, with an easier setup using an installer that installs and set’s up everything. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. Archives
March 2023
Categories |