Skip to content

Commit

Permalink
Add compatibility with dkim domain type
Browse files Browse the repository at this point in the history
  • Loading branch information
Mazamazine committed Jan 15, 2024
1 parent 8d4ad7a commit bffcfd4
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 15 deletions.
30 changes: 15 additions & 15 deletions install/mysql.sql
Original file line number Diff line number Diff line change
Expand Up @@ -480,27 +480,27 @@ CREATE TABLE IF NOT EXISTS `domaines_type` (
) ENGINE=InnoDB COMMENT = 'Type of domains allowed';

INSERT IGNORE INTO `domaines_type` (name, description, target, entry, compatibility, only_dns, need_dns, advanced, enable,has_https_option) VALUES
('dkim', 'DKIM Key', 'TXT', '%SUB% IN TXT "%TARGET%"', 'txt,defmx,defmx2,mx,mx2,url,ip,ipv6', true, true, true, 'ADMIN', false),
('autodiscover', 'Email autoconfiguration', 'NONE', '%SUB% IN A @@PUBLIC_IP@@', 'txt,defmx,defmx2,mx,mx2', false, true, true, 'ADMIN', false),
('dkim', 'DKIM Key', 'TXT', '%SUB% IN TXT "%TARGET%"', 'vhost,txt,defmx,defmx2,mx,mx2,url,ip,ipv6', true, true, true, 'ADMIN', false),
('autodiscover', 'Email autoconfiguration', 'NONE', '%SUB% IN A @@PUBLIC_IP@@', 'txt,dkim,defmx,defmx2,mx,mx2', false, true, true, 'ADMIN', false),
-- Default vhost type to maintains compatibility across versions.
-- This is overloaded depending on the value of the https column in sub_domaines
('vhost', 'Locally hosted', 'DIRECTORY', '%SUB% IN A @@PUBLIC_IP@@', 'txt,defmx,defmx2,mx,mx2', false, false, false, 'ALL', true),
('vhost', 'Locally hosted', 'DIRECTORY', '%SUB% IN A @@PUBLIC_IP@@', 'txt,dkim,defmx,defmx2,mx,mx2', false, false, false, 'ALL', true),
-- The following 3 types (vhost-http, vhost-https, vhost-both) are overloads for vhost
-- and are "disabled" to not be available from the interface, but still be valid domaine types
-- when checking in m_ssl::updateDomain.
('vhost-http','Locally hosted with http->https', 'DIRECTORY', '%SUB% IN A @@PUBLIC_IP@@', 'txt,defmx,defmx2,mx,mx2', false, false, false, 'NONE', false),
('vhost-https','Locally hosted with http->https', 'DIRECTORY', '%SUB% IN A @@PUBLIC_IP@@', 'txt,defmx,defmx2,mx,mx2', false, false, false, 'NONE', false),
('vhost-both', 'Locally hosted with http and https', 'DIRECTORY', '%SUB% IN A @@PUBLIC_IP@@', 'txt,defmx,defmx2,mx,mx2', false, false, false, 'NONE', false),
('url', 'URL redirection', 'URL', '%SUB% IN A @@PUBLIC_IP@@', 'txt,defmx,defmx2,mx,mx2', false, false, false, 'ALL', false),
('ip', 'IPv4 redirect', 'IP', '%SUB% IN A %TARGET%', 'url,ip,ipv6,txt,mx,mx2,defmx,defmx2', true, true, false, 'ALL', false),
('ipv6', 'IPv6 redirect', 'IPV6', '%SUB% IN AAAA %TARGET%', 'ip,ipv6,txt,mx,mx2,defmx,defmx2', true, true, true, 'ALL', false),
('vhost-http','Locally hosted with http->https', 'DIRECTORY', '%SUB% IN A @@PUBLIC_IP@@', 'txt,dkim,defmx,defmx2,mx,mx2', false, false, false, 'NONE', false),
('vhost-https','Locally hosted with http->https', 'DIRECTORY', '%SUB% IN A @@PUBLIC_IP@@', 'txt,dkim,defmx,defmx2,mx,mx2', false, false, false, 'NONE', false),
('vhost-both', 'Locally hosted with http and https', 'DIRECTORY', '%SUB% IN A @@PUBLIC_IP@@', 'txt,dkim,defmx,defmx2,mx,mx2', false, false, false, 'NONE', false),
('url', 'URL redirection', 'URL', '%SUB% IN A @@PUBLIC_IP@@', 'txt,dkim,defmx,defmx2,mx,mx2', false, false, false, 'ALL', false),
('ip', 'IPv4 redirect', 'IP', '%SUB% IN A %TARGET%', 'url,ip,ipv6,txt,dkim,mx,mx2,defmx,defmx2', true, true, false, 'ALL', false),
('ipv6', 'IPv6 redirect', 'IPV6', '%SUB% IN AAAA %TARGET%', 'ip,ipv6,txt,dkim,mx,mx2,defmx,defmx2', true, true, true, 'ALL', false),
('cname', 'CNAME DNS entry', 'DOMAIN', '%SUB% CNAME %TARGET%', '', true, true, true, 'ALL', false),
('txt', 'TXT DNS entry', 'TXT', '%SUB% IN TXT "%TARGET%"', 'vhost,url,ip,ipv6,txt,mx,mx2,defmx,defmx2', true, true, true, 'ALL', false),
('mx', 'MX DNS entry', 'DOMAIN', '%SUB% IN MX 5 %TARGET%', 'vhost,url,ip,ipv6,txt,mx,mx2', true, true, true, 'ALL', false),
('mx2', 'secondary MX DNS entry', 'DOMAIN', '%SUB% IN MX 10 %TARGET%', 'vhost,url,ip,ipv6,txt,mx,mx2', true, true, true, 'ALL', false),
('defmx', 'Default mail server', 'NONE', '%SUB% IN MX 5 @@DEFAULT_MX@@.', 'vhost,url,ip,ipv6,txt,defmx2', true, true, true, 'ADMIN', false),
('defmx2', 'Default backup mail server', 'NONE', '%SUB% IN MX 10 @@DEFAULT_SECONDARY_MX@@.', 'vhost,url,ip,ipv6,txt,defmx', true, true, true, 'ADMIN', false),
('panel', 'AlternC panel access', 'NONE', '%SUB% IN A @@PUBLIC_IP@@', 'vhost,url,ip,ipv6,txt,mx,mx2,defmx,defmx2', false, false, true, 'ALL', false)
('txt', 'TXT DNS entry', 'TXT', '%SUB% IN TXT "%TARGET%"', 'vhost,url,ip,ipv6,txt,dkim,mx,mx2,defmx,defmx2', true, true, true, 'ALL', false),
('mx', 'MX DNS entry', 'DOMAIN', '%SUB% IN MX 5 %TARGET%', 'vhost,url,ip,ipv6,txt,dkim,mx,mx2', true, true, true, 'ALL', false),
('mx2', 'secondary MX DNS entry', 'DOMAIN', '%SUB% IN MX 10 %TARGET%', 'vhost,url,ip,ipv6,txt,dkim,mx,mx2', true, true, true, 'ALL', false),
('defmx', 'Default mail server', 'NONE', '%SUB% IN MX 5 @@DEFAULT_MX@@.', 'vhost,url,ip,ipv6,txt,dkim,defmx2', true, true, true, 'ADMIN', false),
('defmx2', 'Default backup mail server', 'NONE', '%SUB% IN MX 10 @@DEFAULT_SECONDARY_MX@@.', 'vhost,url,ip,ipv6,txt,dkim,defmx', true, true, true, 'ADMIN', false),
('panel', 'AlternC panel access', 'NONE', '%SUB% IN A @@PUBLIC_IP@@', 'vhost,url,ip,ipv6,txt,dkim,mx,mx2,defmx,defmx2', false, false, true, 'ALL', false)
;
UPDATE domaines_type SET create_tmpdir=true, create_targetdir=true WHERE target='DIRECTORY';

Expand Down
3 changes: 3 additions & 0 deletions install/upgrades/3.5.0.5.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
-- Add compatibility with dkim domain type. @see GH#549
UPDATE domaines_type SET compatibility=CONCAT_WS(',', compatibility, 'vhost') WHERE name='dkim' AND compatibility NOT LIKE '%vhost%';
UPDATE domaines_type SET compatibility=CONCAT_WS(',', compatibility, 'dkim') WHERE name IN (SELECT name FROM domaines_type WHERE compatibility like '%txt%' and name != 'dkim') AND compatibility NOT LIKE '%dkim%';

0 comments on commit bffcfd4

Please sign in to comment.