Alias Domains: Difference between revisions
Jump to navigation
Jump to search
(Created page with " Create alias domain Qmail & Dovecot 1) Create alias domain table and insert alias domain a) # mysql -u root -p vpopmail b) MariaDB [vpopmail]> create table aliasdomains ( domain char(96) not null, alias char(96) not null); c) MariaDB [vpopmail]> insert into aliasdomains (domain,alias) values ('domain.com','domain.org'); 2) Change dovecot mysql password query password_query = SELECT CONCAT( pw_name ,'@', pw_domain ) AS user, \ pw_passwd AS password, \...") |
No edit summary |
||
(4 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
Assumes Many-Domain backend | |||
Create alias domain Qmail & Dovecot | Create alias domain Qmail & Dovecot | ||
1) Create alias domain table and insert alias domain | 1) Create alias domain table and insert alias domain | ||
Line 21: | Line 23: | ||
+domainA.com-:domainA.com:89:89:/home/vpopmail/domains/domainA.com:-:: | +domainA.com-:domainA.com:89:89:/home/vpopmail/domains/domainA.com:-:: | ||
+domain.com-:domain.com:89:89:/home/vpopmail/domains/domain.com:-:: | +domain.com-:domain.com:89:89:/home/vpopmail/domains/domain.com:-:: | ||
+domain.org-: | <span style="color:red">+domain.org-:domain.com:89:89:/home/vpopmail/domains/domain.com:-::</span> |
Latest revision as of 20:18, 7 April 2024
Assumes Many-Domain backend
Create alias domain Qmail & Dovecot
1) Create alias domain table and insert alias domain
a) # mysql -u root -p vpopmail
b) MariaDB [vpopmail]> create table aliasdomains ( domain char(96) not null, alias char(96) not null);
c) MariaDB [vpopmail]> insert into aliasdomains (domain,alias) values ('domain.com','domain.org');
2) Change dovecot mysql password query
password_query = SELECT CONCAT( pw_name ,'@', pw_domain ) AS user, \
pw_passwd AS password, \
pw_dir as userdb_home, \
89 AS userdb_uid, \
89 AS userdb_gid \
FROM vpopmail vp \
LEFT JOIN aliasdomains ad ON ad.alias = '%d' \
WHERE ( vp.pw_domain = ad.domain OR vp.pw_domain = '%d') AND ( vp.pw_name = '%n' )
3) Test Dovecot:
doveadm auth test user@domain.com 'password'
doveadm auth test user@domain.org 'password'
4) Create domain alias for Qmail ( /var/qmail/users/assign )
a) # /home/vpopmail/bin/vaddaliasdomain domain.com domain.org
# cat /var/qmail/users/assign
+domainA.com-:domainA.com:89:89:/home/vpopmail/domains/domainA.com:-::
+domain.com-:domain.com:89:89:/home/vpopmail/domains/domain.com:-::
+domain.org-:domain.com:89:89:/home/vpopmail/domains/domain.com:-::