blob: 859fe809f73d93e7704668936fda4a5072550679 [file] [log] [blame]
Matthias Andreas Benkard12a57352021-12-28 18:02:04 +01001<div role="tabpanel" class="tab-pane" id="tab-config-dkim">
2 <div class="panel panel-default">
3 <div class="panel-heading">{{ lang.admin.dkim_keys }}</div>
4 <div class="panel-body">
5 <div class="btn-group" data-toggle="button" style="margin-bottom: 20px;">
6 <a class="btn btn-sm btn-xs-third visible-xs-block visible-sm-inline visible-md-inline visible-lg-inline btn-default active" href="#" data-toggle="collapse" data-target=".dkim_key_valid">{{ lang.admin.dkim_key_valid }}</a>
7 <a class="btn btn-sm btn-xs-third visible-xs-block visible-sm-inline visible-md-inline visible-lg-inline btn-default active" href="#" data-toggle="collapse" data-target=".dkim_key_unused">{{ lang.admin.dkim_key_unused }}</a>
8 <a class="btn btn-sm btn-xs-third visible-xs-block visible-sm-inline visible-md-inline visible-lg-inline btn-default active" href="#" data-toggle="collapse" data-target=".dkim_key_missing">{{ lang.admin.dkim_key_missing }}</a>
9 <div class="clearfix visible-xs"></div>
10 </div>
11 {% for domain, domain_data in dkim_domains %}
12 {% if domain_data.dkim %}
13 <div class="row collapse in dkim_key_valid">
14 <div class="col-md-1"><input type="checkbox" data-id="dkim" name="multi_select" value="{{ domain }}"></div>
15 <div class="col-md-3">
16 <p>{{ lang.admin.domain }}: <strong>{{ domain }}</strong>
17 <p class="dkim-label"><span class="label label-success">{{ lang.admin.dkim_key_valid }}</span></p>
18 <p class="dkim-label"><span class="label label-primary">{{ lang.admin.dkim_domains_selector }} '{{ domain_data.dkim.dkim_selector }}'</span></p>
19 <p class="dkim-label"><span class="label label-info">{{ domain_data.dkim.length }} bit</span></p>
20 </p>
21 </div>
22 <div class="col-md-8">
23 <pre>{{ domain_data.dkim.dkim_txt }}</pre>
24 <p data-toggle="modal" data-target="#showDKIMprivKey" id="dkim_priv" style="cursor:pointer;margin-top:-8pt" data-priv-key="{{ domain_data.dkim.privkey }}"><small><i class="bi bi-arrow-return-right"></i> {{ lang.admin.dkim_private_key }}</small></p>
25 </div>
26 <hr class="visible-xs visible-sm">
27 </div>
28 {% else %}
29 <div class="row collapse in dkim_key_missing">
30 <div class="col-md-1"><input class="dkim_missing" type="checkbox" data-id="dkim" name="multi_select" value="{{ domain }}" disabled></div>
31 <div class="col-md-3">
32 <p>{{ lang.admin.domain }}: <strong>{{ domain }}</strong><br><span class="label label-danger">{{ lang.admin.dkim_key_missing }}</span></p>
33 </div>
34 <div class="col-md-8"><pre>-</pre></div>
35 <hr class="visible-xs visible-sm">
36 </div>
37 {% endif %}
38 {% for alias_domain, alias_domain_data in domain_data.alias_domains %}
39 {% if alias_domain_data.dkim %}
40 <div class="row collapse in dkim_key_valid">
41 <div class="col-md-1"><input type="checkbox" data-id="dkim" name="multi_select" value="{{ alias_domain }}"></div>
42 <div class="col-md-2 col-md-offset-1">
43 <p><small>↳ Alias-Domain: <strong>{{ alias_domain }}</strong></small>
44 <p class="dkim-label"><span class="label label-success">{{ lang.admin.dkim_key_valid }}</span></p>
45 <p class="dkim-label"><span class="label label-primary">Selector '{{ alias_domain_data.dkim.dkim_selector }}'</span></p>
46 <p class="dkim-label"><span class="label label-info">{{ alias_domain_data.dkim.length }} bit</span></p>
47 </p>
48 </div>
49 <div class="col-md-8">
50 <pre>{{ alias_domain_data.dkim.dkim_txt }}</pre>
51 <p data-toggle="modal" data-target="#showDKIMprivKey" id="dkim_priv" style="cursor:pointer;margin-top:-8pt" data-priv-key="{{ alias_domain_data.dkim.privkey }}"><small><i class="bi bi-arrow-return-right"></i> Private key</small></p>
52 </div>
53 <hr class="visible-xs visible-sm">
54 </div>
55 {% else %}
56 <div class="row collapse in dkim_key_missing">
57 <div class="col-md-1"><input class="dkim_missing" type="checkbox" data-id="dkim" name="multi_select" value="{{ alias_domain }}" disabled></div>
58 <div class="col-md-2 col-md-offset-1">
59 <p><small>↳ Alias-Domain: <strong>{{ alias_domain }}</strong><br></small><span class="label label-danger">{{ lang.admin.dkim_key_missing }}</span></p>
60 </div>
61 <div class="col-md-8"><pre>-</pre></div>
62 <hr class="visible-xs visible-sm">
63 </div>
64 {% endif %}
65 {% endfor %}
66 {% endfor %}
67 {% for blind, data in dkim_blind_domains|filter(data => data.dkim is not null) %}
68 <div class="row collapse in dkim_key_unused">
69 <div class="col-md-1"><input type="checkbox" data-id="dkim" name="multi_select" value="{{ blind }}"></div>
70 <div class="col-md-3">
71 <p>{{ lang.admin.domain }}: <strong>{{ blind }}</strong>
72 <p class="dkim-label"><span class="label label-warning">{{ lang.admin.dkim_key_unused }}</span></p>
73 <p class="dkim-label"><span class="label label-primary">Selector '{{ data.dkim.dkim_selector }}'</span></p>
74 <p class="dkim-label"><span class="label label-info">{{ data.dkim.length }} bit</span></p>
75 </p>
76 </div>
77 <div class="col-md-8">
78 <pre>{{ data.dkim.dkim_txt }}</pre>
79 <p data-toggle="modal" data-target="#showDKIMprivKey" id="dkim_priv" style="cursor:pointer;margin-top:-8pt" data-priv-key="{{ data.dkim.privkey }}"><small><i class="bi bi-arrow-return-right"></i> Private key</small></p>
80 </div>
81 <hr class="visible-xs visible-sm">
82 </div>
83 {% endfor %}
84
85 <div class="mass-actions-admin">
86 <div class="btn-group btn-group-sm">
87 <button type="button" id="toggle_multi_select_all" data-id="dkim" class="btn btn-sm btn-xs-half visible-xs-block visible-sm-inline visible-md-inline visible-lg-inline btn-default"><i class="bi bi-check-all"></i> {{ lang.mailbox.toggle_all }}</button>
88 <button type="button" data-action="delete_selected" name="delete_selected" data-id="dkim" data-api-url="delete/dkim" class="btn btn-sm btn-xs-half visible-xs-block visible-sm-inline visible-md-inline visible-lg-inline btn-danger"><i class="bi bi-trash"></i> {{ lang.admin.remove }}</button>
89 <div class="clearfix visible-xs"></div>
90 </div>
91 </div>
92
93 <legend style="margin-top:40px">{{ lang.admin.dkim_add_key }}</legend>
94 <form class="form" data-id="dkim" role="form" method="post">
95 <div class="form-group">
96 <label for="dkim_add_domains">{{ lang.admin.domain_s }}</label>
97 <input class="form-control input-sm" id="dkim_add_domains" name="domains" placeholder="example.org, example.com" required>
98 <small><i class="bi bi-arrow-return-right"></i> <a href="#" id="dkim_missing_keys">{{ lang.admin.dkim_domains_wo_keys }}</a></small>
99 </div>
100 <div class="form-group">
101 <label for="dkim_selector">{{ lang.admin.dkim_domains_selector }}</label>
102 <input class="form-control input-sm" id="dkim_selector" name="dkim_selector" value="dkim" required>
103 </div>
104 <div class="form-group">
105 <select data-style="btn btn-default btn-sm" class="form-control" id="key_size" name="key_size" title="{{ lang.admin.dkim_key_length }}" required>
106 <option data-subtext="bits">1024</option>
107 <option data-subtext="bits">2048</option>
108 </select>
109 </div>
110 <button class="btn btn-sm visible-xs-block visible-sm-inline visible-md-inline visible-lg-inline btn-success" data-action="add_item" data-id="dkim" data-api-url='add/dkim' data-api-attr='{}' href="#"><i class="bi bi-plus-lg"></i> {{ lang.admin.add }}</button>
111 </form>
112
113 <legend data-target="#import_dkim" style="margin-top:40px;cursor:pointer" unselectable="on" data-toggle="collapse">
114 <i style="font-size:10pt;" class="bi bi-plus-square"></i> {{ lang.admin.import_private_key }}
115 </legend>
116 <div id="import_dkim" class="collapse">
117 <form class="form" data-id="dkim_import" role="form" method="post">
118 <div class="form-group">
119 <label for="dkim_import_domain">{{ lang.admin.domain }}:</label>
120 <input class="form-control input-sm" id="dkim_import_domain" name="domain" placeholder="example.org" required>
121 </div>
122 <div class="form-group">
123 <label for="dkim_import_selector">{{ lang.admin.dkim_domains_selector }}:</label>
124 <input class="form-control input-sm" id="dkim_import_selector" name="dkim_selector" value="dkim" required>
125 </div>
126 <div class="form-group">
127 <label for="private_key_file">{{ lang.admin.private_key }}: (RSA PKCS#8)</label>
128 <textarea class="form-control input-sm" rows="10" name="private_key_file" id="private_key_file" required placeholder="-----BEGIN RSA KEY-----"></textarea>
129 </div>
130 <div class="form-group">
131 <label>
132 <input type="checkbox" name="overwrite_existing" value="1"> {{ lang.admin.dkim_overwrite_key }}
133 </label>
134 </div>
135 <button class="btn btn-sm visible-xs-block visible-sm-inline visible-md-inline visible-lg-inline btn-default" data-action="add_item" data-id="dkim_import" data-api-url='add/dkim_import' data-api-attr='{}' href="#"><i class="bi bi-plus-lg"></i> {{ lang.admin.import }}</button>
136 </form>
137 </div>
138
139 <legend data-target="#duplicate_dkim" style="margin-top:40px;cursor:pointer" unselectable="on" data-toggle="collapse">
140 <i style="font-size:10pt;" class="bi bi-plus-square"></i> {{ lang.admin.duplicate_dkim }}
141 </legend>
142 <div id="duplicate_dkim" class="collapse">
143 <form class="form-horizontal" data-id="dkim_duplicate" role="form" method="post">
144 <div class="form-group">
145 <label class="control-label col-sm-2" for="from_domain">{{ lang.admin.dkim_from }}:</label>
146 <div class="col-sm-10">
147 <select data-style="btn btn-default btn-sm"
148 data-live-search="true"
149 data-id="dkim_duplicate"
150 title="{{ lang.admin.dkim_from_title }}"
151 name="from_domain" id="from_domain" class="full-width-select form-control" required>
152 {% for dkim_domain in dkim_domains_with_keys %}
153 <option value="{{ dkim_domain }}">{{ dkim_domain }}</option>
154 {% endfor %}
155 </select>
156 </div>
157 </div>
158 <div class="form-group">
159 <label class="control-label col-sm-2" for="to_domain">{{ lang.admin.dkim_to }}:</label>
160 <div class="col-sm-10">
161 <select
162 data-live-search="true"
163 data-style="btn btn-default btn-sm"
164 data-id="dkim_duplicate"
165 title="{{ lang.admin.dkim_to_title }}"
166 name="to_domain" id="to_domain" class="full-width-select form-control" multiple required>
167 {% for domain in all_domains %}
168 <option value="{{ domain }}">{{ domain }}</option>
169 {% endfor %}
170 </select>
171 </div>
172 </div>
173 <button class="btn btn-sm visible-xs-block visible-sm-inline visible-md-inline visible-lg-inline btn-default" data-action="add_item" data-id="dkim_duplicate" data-api-url='add/dkim_duplicate' data-api-attr='{}' href="#"><i class="bi bi-clipboard-plus"></i> {{ lang.admin.duplicate }}</button>
174 </form>
175 </div>
176 </div>
177 </div>
178</div>