blob: c1362c4f8b7998ce73c9115e959c846f71653946 [file] [log] [blame]
Matthias Andreas Benkardb382b102021-01-02 15:32:21 +01001<?php
2if (!isset($_SESSION['mailcow_cc_role'])) {
3 header('Location: /');
4 exit();
5}
6?>
7<!-- add mailbox modal -->
8<div class="modal fade" id="addMailboxModal" tabindex="-1" role="dialog" aria-hidden="true">
9 <div class="modal-dialog modal-lg">
10 <div class="modal-content">
11 <div class="modal-header">
12 <button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">×</span></button>
13 <h3 class="modal-title"><?=$lang['mailbox']['add_mailbox'];?></h3>
14 </div>
15 <div class="modal-body">
16 <form class="form-horizontal" data-cached-form="true" data-id="add_mailbox" role="form" autocomplete="off">
17 <div class="form-group">
18 <label class="control-label col-sm-2" for="local_part"><?=$lang['add']['mailbox_username'];?></label>
19 <div class="col-sm-10">
20 <input type="text" pattern="[A-Za-z0-9\.!#$%&'*+/=?^_`{|}~-]+" autocorrect="off" autocapitalize="none" class="form-control" name="local_part" required>
21 </div>
22 </div>
23 <div class="form-group">
24 <label class="control-label col-sm-2" for="domain"><?=$lang['add']['domain'];?></label>
25 <div class="col-sm-10">
26 <select class="full-width-select" data-live-search="true" id="addSelectDomain" name="domain" required>
27 <?php
28 foreach (mailbox('get', 'domains') as $domain) {
29 echo "<option>".htmlspecialchars($domain)."</option>";
30 }
31 ?>
32 </select>
33 </div>
34 </div>
35 <div class="form-group">
36 <label class="control-label col-sm-2" for="name"><?=$lang['add']['full_name'];?></label>
37 <div class="col-sm-10">
38 <input type="text" class="form-control" name="name">
39 </div>
40 </div>
41 <div class="form-group">
42 <label class="control-label col-sm-2" for="addInputQuota"><?=$lang['add']['quota_mb'];?>
43 <br /><span id="quotaBadge" class="badge">max. - MiB</span>
44 </label>
45 <div class="col-sm-10">
46 <input type="text" class="form-control" name="quota" min="0" max="" id="addInputQuota" disabled value="<?=$lang['add']['select_domain'];?>" required>
47 <small class="help-block">0 = ∞</small>
48 <div class="label label-warning addInputQuotaExhausted" style="display:none;"><?=$lang['warning']['quota_exceeded_scope'];?></div>
49 </div>
50 </div>
51 <div class="form-group">
52 <label class="control-label col-sm-2" for="password"><?=$lang['add']['password'];?> (<a href="#" class="generate_password"><?=$lang['add']['generate'];?></a>)</label>
53 <div class="col-sm-10">
54 <input type="password" data-pwgen-field="true" data-hibp="true" class="form-control" name="password" placeholder="" autocomplete="new-password" required>
55 </div>
56 </div>
57 <div class="form-group">
58 <label class="control-label col-sm-2" for="password2"><?=$lang['add']['password_repeat'];?></label>
59 <div class="col-sm-10">
60 <input type="password" data-pwgen-field="true" class="form-control" name="password2" placeholder="" autocomplete="new-password" required>
61 </div>
62 </div>
63 <div class="form-group">
64 <div class="col-sm-offset-2 col-sm-10">
65 <select name="active" class="form-control">
66 <option value="1" selected><?=$lang['add']['active'];?></option>
67 <option value="2"><?=$lang['add']['disable_login'];?></option>
68 <option value="0"><?=$lang['add']['inactive'];?></option>
69 </select>
70 </div>
71 </div>
72 <hr>
73 <div class="form-group">
74 <div class="col-sm-offset-2 col-sm-10">
75 <button class="btn btn-default" data-action="add_item" data-id="add_mailbox" data-api-url='add/mailbox' data-api-attr='{}' href="#"><?=$lang['admin']['add'];?></button>
76 </div>
77 </div>
78 </form>
79 </div>
80 </div>
81 </div>
82</div><!-- add mailbox modal -->
83<!-- add domain modal -->
84<div class="modal fade" id="addDomainModal" tabindex="-1" role="dialog" aria-hidden="true">
85 <div class="modal-dialog modal-lg">
86 <div class="modal-content">
87 <div class="modal-header">
88 <button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">×</span></button>
89 <h3 class="modal-title"><?=$lang['mailbox']['add_domain'];?></h3>
90 </div>
91 <div class="modal-body">
92 <form class="form-horizontal" data-cached-form="true" data-id="add_domain" role="form">
93 <div class="form-group">
94 <label class="control-label col-sm-2" for="domain"><?=$lang['add']['domain'];?></label>
95 <div class="col-sm-10">
96 <input type="text" autocorrect="off" autocapitalize="none" class="form-control" name="domain" required>
97 </div>
98 </div>
99 <div class="form-group">
100 <label class="control-label col-sm-2" for="description"><?=$lang['add']['description'];?></label>
101 <div class="col-sm-10">
102 <input type="text" class="form-control" name="description">
103 </div>
104 </div>
105 <div class="form-group">
106 <label class="control-label col-sm-2" for="aliases"><?=$lang['add']['max_aliases'];?></label>
107 <div class="col-sm-10">
108 <input type="number" class="form-control" name="aliases" value="400" required>
109 </div>
110 </div>
111 <div class="form-group">
112 <label class="control-label col-sm-2" for="mailboxes"><?=$lang['add']['max_mailboxes'];?></label>
113 <div class="col-sm-10">
114 <input type="number" class="form-control" name="mailboxes" value="10" required>
115 </div>
116 </div>
117 <div class="form-group">
118 <label class="control-label col-sm-2" for="defquota"><?=$lang['add']['mailbox_quota_def'];?></label>
119 <div class="col-sm-10">
120 <input type="number" class="form-control" name="defquota" value="3072" required>
121 </div>
122 </div>
123 <div class="form-group">
124 <label class="control-label col-sm-2" for="maxquota"><?=$lang['add']['mailbox_quota_m'];?></label>
125 <div class="col-sm-10">
126 <input type="number" class="form-control" name="maxquota" value="10240" required>
127 </div>
128 </div>
129 <div class="form-group">
130 <label class="control-label col-sm-2" for="quota"><?=$lang['add']['domain_quota_m'];?></label>
131 <div class="col-sm-10">
132 <input type="number" class="form-control" name="quota" value="10240" required>
133 </div>
134 </div>
135 <?php if (getenv('SKIP_SOGO') != "y") { ?>
136 <div class="form-group">
137 <div class="col-sm-offset-2 col-sm-10">
138 <div class="checkbox">
139 <label><input type="checkbox" value="1" name="gal" checked> <?=$lang['edit']['gal'];?></label>
140 <small class="help-block"><?=$lang['edit']['gal_info'];?></small>
141 </div>
142 </div>
143 </div>
144 <?php } ?>
145 <div class="form-group">
146 <div class="col-sm-offset-2 col-sm-10">
147 <div class="checkbox">
148 <label><input type="checkbox" value="1" name="active" checked> <?=$lang['add']['active'];?></label>
149 </div>
150 </div>
151 </div>
152 <hr>
153 <div class="form-group">
154 <label class="control-label col-sm-2" for="rl_frame"><?=$lang['acl']['ratelimit'];?></label>
155 <div class="col-sm-7">
156 <input name="rl_value" type="number" value="<?=(!empty($rl['value'])) ? $rl['value'] : null;?>" class="form-control" placeholder="disabled">
157 </div>
158 <div class="col-sm-3">
159 <select name="rl_frame" class="form-control">
160 <option value="s" <?=(isset($rl['frame']) && $rl['frame'] == 's') ? 'selected' : null;?>>msgs / second</option>
161 <option value="m" <?=(isset($rl['frame']) && $rl['frame'] == 'm') ? 'selected' : null;?>>msgs / minute</option>
162 <option value="h" <?=(isset($rl['frame']) && $rl['frame'] == 'h') ? 'selected' : null;?>>msgs / hour</option>
163 <option value="d" <?=(isset($rl['frame']) && $rl['frame'] == 'd') ? 'selected' : null;?>>msgs / day</option>
164 </select>
165 </div>
166 </div>
167 <hr>
168 <div class="form-group">
169 <label class="control-label col-sm-2"><?=$lang['add']['backup_mx_options'];?></label>
170 <div class="col-sm-10">
171 <div class="checkbox">
172 <label><input type="checkbox" value="1" name="backupmx"> <?=$lang['add']['relay_domain'];?></label>
173 <br>
174 <label><input type="checkbox" value="1" name="relay_all_recipients"> <?=$lang['add']['relay_all'];?></label>
175 <p><?=$lang['add']['relay_all_info'];?></p>
176 <label><input type="checkbox" value="1" name="relay_unknown_only" <?=(isset($result['relay_unknown_only']) && $result['relay_unknown_only']=="1") ? "checked" : null;?>> <?=$lang['add']['relay_unknown_only'];?></label>
177 <br>
178 <p><?=$lang['add']['relay_transport_info'];?></p>
179 <hr style="margin:25px 0px 0px 0px">
180 </div>
181 </div>
182 </div>
183 <hr>
184 <div class="form-group">
185 <div class="col-sm-offset-2 col-sm-10">
186 <?php if (getenv('SKIP_SOGO') != "y") { ?>
187 <button class="btn btn-default" data-action="add_item" data-id="add_domain" data-api-url='add/domain' data-api-attr='{}' href="#"><?=$lang['add']['add_domain_only'];?></button>
188 <button class="btn btn-default" data-action="add_item" data-id="add_domain" data-api-url='add/domain' data-api-attr='{"restart_sogo":"1"}' href="#"><?=$lang['add']['add_domain_restart'];?></button>
189 <?php } else { ?>
190 <button class="btn btn-default" data-action="add_item" data-id="add_domain" data-api-url='add/domain' data-api-attr='{}' href="#"><?=$lang['add']['add'];?></button>
191 <?php } ?>
192 </div>
193 </div>
194 <?php // TODO: Separate SOGo-related text
195 if (getenv('SKIP_SOGO') != "y") { ?>
196 <p><span class="glyphicon glyphicon-exclamation-sign text-danger"></span> <?=$lang['add']['post_domain_add'];?></p>
197 <?php } ?>
198 </form>
199 </div>
200 </div>
201 </div>
202</div><!-- add domain modal -->
203<!-- add resource modal -->
204<div class="modal fade" id="addResourceModal" tabindex="-1" role="dialog" aria-hidden="true">
205 <div class="modal-dialog modal-lg">
206 <div class="modal-content">
207 <div class="modal-header">
208 <button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">×</span></button>
209 <h3 class="modal-title"><?=$lang['mailbox']['add_resource'];?></h3>
210 </div>
211 <div class="modal-body">
212 <form class="form-horizontal" data-cached-form="true" role="form" data-id="add_resource">
213 <div class="form-group">
214 <label class="control-label col-sm-2" for="description"><?=$lang['add']['description'];?></label>
215 <div class="col-sm-10">
216 <input type="text" class="form-control" name="description" required>
217 </div>
218 </div>
219 <div class="form-group">
220 <label class="control-label col-sm-2" for="domain"><?=$lang['add']['domain'];?></label>
221 <div class="col-sm-10">
222 <select data-live-search="true" name="domain" title="<?=$lang['add']['select'];?>" required>
223 <?php
224 foreach (mailbox('get', 'domains') as $domain) {
225 echo "<option>".htmlspecialchars($domain)."</option>";
226 }
227 ?>
228 </select>
229 </div>
230 </div>
231 <div class="form-group">
232 <label class="control-label col-sm-2" for="domain"><?=$lang['add']['kind'];?></label>
233 <div class="col-sm-10">
234 <select name="kind" title="<?=$lang['add']['select'];?>" required>
235 <option value="location">Location</option>
236 <option value="group">Group</option>
237 <option value="thing">Thing</option>
238 </select>
239 </div>
240 </div>
241 <div class="form-group">
242 <label class="control-label col-sm-2" for="multiple_bookings_select"><?=$lang['add']['multiple_bookings'];?></label>
243 <div class="col-sm-10">
244 <select name="multiple_bookings_select" id="multiple_bookings_select" title="<?=$lang['add']['select'];?>" required>
245 <option value="0"><?=$lang['mailbox']['booking_0'];?></option>
246 <option value="-1" selected><?=$lang['mailbox']['booking_lt0'];?></option>
247 <option value="custom"><?=$lang['mailbox']['booking_custom'];?></option>
248 </select>
249 <div style="display:none" id="multiple_bookings_custom_div">
250 <hr>
251 <input type="number" class="form-control" name="multiple_bookings_custom" id="multiple_bookings_custom">
252 </div>
253 <input type="hidden" name="multiple_bookings" id="multiple_bookings">
254 </div>
255 </div>
256 <div class="form-group">
257 <div class="col-sm-offset-2 col-sm-10">
258 <div class="checkbox">
259 <label><input type="checkbox" value="1" name="active" checked> <?=$lang['add']['active'];?></label>
260 </div>
261 </div>
262 </div>
263 <div class="form-group">
264 <div class="col-sm-offset-2 col-sm-10">
265 <button class="btn btn-default" data-action="add_item" data-id="add_resource" data-api-url='add/resource' data-api-attr='{}' href="#"><?=$lang['admin']['add'];?></button>
266 </div>
267 </div>
268 </form>
269 </div>
270 </div>
271 </div>
272</div><!-- add resource modal -->
273<!-- add alias modal -->
274<div class="modal fade" id="addAliasModal" tabindex="-1" role="dialog" aria-hidden="true">
275 <div class="modal-dialog modal-lg">
276 <div class="modal-content">
277 <div class="modal-header">
278 <button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">×</span></button>
279 <h3 class="modal-title"><?=$lang['mailbox']['add_alias'];?></h3>
280 </div>
281 <div class="modal-body">
282 <form class="form-horizontal" data-cached-form="true" role="form" data-id="add_alias">
283 <input type="hidden" value="0" name="active">
284 <div class="form-group">
285 <label class="control-label col-sm-2" for="address"><?=$lang['add']['alias_address'];?></label>
286 <div class="col-sm-10">
287 <textarea autocorrect="off" autocapitalize="none" class="form-control" rows="5" name="address" id="address" required></textarea>
288 <p><?=$lang['add']['alias_address_info'];?></p>
289 </div>
290 </div>
291 <div class="form-group">
292 <label class="control-label col-sm-2" for="goto"><?=$lang['add']['target_address'];?></label>
293 <div class="col-sm-10">
294 <textarea id="textarea_alias_goto" autocorrect="off" autocapitalize="none" class="form-control" rows="5" id="goto" name="goto" required></textarea>
295 <p><?=$lang['add']['target_address_info'];?></p>
296 <div class="checkbox">
297 <label><input class="goto_checkbox" type="checkbox" value="1" name="goto_null"> <?=$lang['add']['goto_null'];?></label>
298 </div>
299 <div class="checkbox">
300 <label><input class="goto_checkbox" type="checkbox" value="1" name="goto_spam"> <?=$lang['add']['goto_spam'];?></label>
301 </div>
302 <div class="checkbox">
303 <label><input class="goto_checkbox" type="checkbox" value="1" name="goto_ham"> <?=$lang['add']['goto_ham'];?></label>
304 </div>
305 <?php if (getenv('SKIP_SOGO') != "y") { ?>
306 <hr>
307 <div class="checkbox">
308 <label><input type="checkbox" value="1" name="sogo_visible" checked> <?=$lang['edit']['sogo_visible'];?></label>
309 </div>
310 <p class="help-block"><?=$lang['edit']['sogo_visible_info'];?></p>
311 <?php } ?>
312 </div>
313 </div>
314 <div class="form-group">
315 <div class="col-sm-offset-2 col-sm-10">
316 <div class="checkbox">
317 <label><input type="checkbox" value="1" name="active" checked> <?=$lang['add']['active'];?></label>
318 </div>
319 </div>
320 </div>
321 <div class="form-group">
322 <div class="col-sm-offset-2 col-sm-10">
323 <button class="btn btn-default" data-action="add_item" data-id="add_alias" data-api-url='add/alias' data-api-attr='{}' href="#"><?=$lang['admin']['add'];?></button>
324 </div>
325 </div>
326 </form>
327 </div>
328 </div>
329 </div>
330</div><!-- add alias modal -->
331<!-- add domain alias modal -->
332<div class="modal fade" id="addAliasDomainModal" tabindex="-1" role="dialog" aria-hidden="true">
333 <div class="modal-dialog modal-lg">
334 <div class="modal-content">
335 <div class="modal-header">
336 <button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">×</span></button>
337 <h3 class="modal-title"><?=$lang['mailbox']['add_domain_alias'];?></h3>
338 </div>
339 <div class="modal-body">
340 <form class="form-horizontal" data-cached-form="true" role="form" data-id="add_alias_domain">
341 <input type="hidden" value="0" name="active">
342 <div class="form-group">
343 <label class="control-label col-sm-2" for="alias_domain"><?=$lang['add']['alias_domain'];?></label>
344 <div class="col-sm-10">
345 <textarea autocorrect="off" autocapitalize="none" class="form-control" rows="5" name="alias_domain" id="alias_domain" required></textarea>
346 <p><?=$lang['add']['alias_domain_info'];?></p>
347 </div>
348 </div>
349 <div class="form-group">
350 <label class="control-label col-sm-2" for="target_domain"><?=$lang['add']['target_domain'];?></label>
351 <div class="col-sm-10">
352 <select data-live-search="true" name="target_domain" title="<?=$lang['add']['select'];?>" required>
353 <?php
354 foreach (mailbox('get', 'domains') as $domain) {
355 echo "<option>".htmlspecialchars($domain)."</option>";
356 }
357 ?>
358 </select>
359 </div>
360 </div>
361 <div class="form-group">
362 <div class="col-sm-offset-2 col-sm-10">
363 <div class="checkbox">
364 <label><input type="checkbox" value="1" name="active" checked> <?=$lang['add']['active'];?></label>
365 </div>
366 </div>
367 </div>
368 <hr>
369 <div class="form-group">
370 <label class="control-label col-sm-2" for="rl_frame"><?=$lang['acl']['ratelimit'];?></label>
371 <div class="col-sm-7">
372 <input name="rl_value" type="number" value="<?=(!empty($rl['value'])) ? $rl['value'] : null;?>" class="form-control" placeholder="disabled">
373 </div>
374 <div class="col-sm-3">
375 <select name="rl_frame" class="form-control">
376 <option value="s" <?=(isset($rl['frame']) && $rl['frame'] == 's') ? 'selected' : null;?>>msgs / second</option>
377 <option value="m" <?=(isset($rl['frame']) && $rl['frame'] == 'm') ? 'selected' : null;?>>msgs / minute</option>
378 <option value="h" <?=(isset($rl['frame']) && $rl['frame'] == 'h') ? 'selected' : null;?>>msgs / hour</option>
379 <option value="d" <?=(isset($rl['frame']) && $rl['frame'] == 'd') ? 'selected' : null;?>>msgs / day</option>
380 </select>
381 </div>
382 </div>
383 <div class="form-group">
384 <div class="col-sm-offset-2 col-sm-10">
385 <button class="btn btn-default" data-action="add_item" data-id="add_alias_domain" data-api-url='add/alias-domain' data-api-attr='{}' href="#"><?=$lang['admin']['add'];?></button>
386 </div>
387 </div>
388 </form>
389 </div>
390 </div>
391 </div>
392</div><!-- add domain alias modal -->
393<!-- add sync job modal -->
394<div class="modal fade" id="addSyncJobModalAdmin" tabindex="-1" role="dialog" aria-hidden="true">
395 <div class="modal-dialog modal-lg">
396 <div class="modal-content">
397 <div class="modal-header">
398 <button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">×</span></button>
399 <h3 class="modal-title"><?=$lang['add']['syncjob'];?></h3>
400 </div>
401 <div class="modal-body">
402 <p class="help-block"><?=$lang['add']['syncjob_hint'];?></p>
403 <form class="form-horizontal" data-cached-form="true" role="form" data-id="add_syncjob">
404 <div class="form-group">
405 <label class="control-label col-sm-2" for="username"><?=$lang['add']['username'];?></label>
406 <div class="col-sm-10">
407 <select data-live-search="true" name="username" required>
408 <?php
409 $domains = mailbox('get', 'domains');
410 if (!empty($domains)) {
411 foreach ($domains as $domain) {
412 $mailboxes = mailbox('get', 'mailboxes', $domain);
413 foreach ($mailboxes as $mailbox) {
414 echo "<option>".htmlspecialchars($mailbox)."</option>";
415 }
416 }
417 }
418 ?>
419 </select>
420 </div>
421 </div>
422 <div class="form-group">
423 <label class="control-label col-sm-2" for="host1"><?=$lang['add']['hostname'];?></label>
424 <div class="col-sm-10">
425 <input type="text" class="form-control" name="host1" required>
426 </div>
427 </div>
428 <div class="form-group">
429 <label class="control-label col-sm-2" for="port1"><?=$lang['add']['port'];?></label>
430 <div class="col-sm-10">
431 <input type="number" class="form-control" name="port1" min="1" max="65535" value="143" required>
432 <small class="help-block">1-65535</small>
433 </div>
434 </div>
435 <div class="form-group">
436 <label class="control-label col-sm-2" for="user1"><?=$lang['add']['username'];?></label>
437 <div class="col-sm-10">
438 <input type="text" class="form-control" name="user1" required>
439 </div>
440 </div>
441 <div class="form-group">
442 <label class="control-label col-sm-2" for="password1"><?=$lang['add']['password'];?></label>
443 <div class="col-sm-10">
444 <input type="password" class="form-control" name="password1" required>
445 </div>
446 </div>
447 <div class="form-group">
448 <label class="control-label col-sm-2" for="enc1"><?=$lang['add']['enc_method'];?></label>
449 <div class="col-sm-10">
450 <select name="enc1" title="<?=$lang['add']['select'];?>" required>
451 <option value="SSL" selected>SSL</option>
452 <option value="TLS">STARTTLS</option>
453 <option value="PLAIN">PLAIN</option>
454 </select>
455 </div>
456 </div>
457 <div class="form-group">
458 <label class="control-label col-sm-2" for="mins_interval"><?=$lang['add']['mins_interval'];?></label>
459 <div class="col-sm-10">
460 <input type="number" class="form-control" name="mins_interval" min="1" max="43800" value="20" required>
461 <small class="help-block">1-43800</small>
462 </div>
463 </div>
464 <div class="form-group">
465 <label class="control-label col-sm-2" for="subfolder2"><?=$lang['edit']['subfolder2'];?></label>
466 <div class="col-sm-10">
467 <input type="text" class="form-control" name="subfolder2" value="">
468 </div>
469 </div>
470 <div class="form-group">
471 <label class="control-label col-sm-2" for="maxage"><?=$lang['edit']['maxage'];?></label>
472 <div class="col-sm-10">
473 <input type="number" class="form-control" name="maxage" min="0" max="32000" value="0">
474 <small class="help-block">0-32000</small>
475 </div>
476 </div>
477 <div class="form-group">
478 <label class="control-label col-sm-2" for="maxbytespersecond"><?=$lang['edit']['maxbytespersecond'];?></label>
479 <div class="col-sm-10">
480 <input type="number" class="form-control" name="maxbytespersecond" min="0" max="125000000" value="0">
481 <small class="help-block">0-125000000</small>
482 </div>
483 </div>
484 <div class="form-group">
485 <label class="control-label col-sm-2" for="timeout1"><?=$lang['edit']['timeout1'];?></label>
486 <div class="col-sm-10">
487 <input type="number" class="form-control" name="timeout1" min="1" max="32000" value="600">
488 <small class="help-block">1-32000</small>
489 </div>
490 </div>
491 <div class="form-group">
492 <label class="control-label col-sm-2" for="timeout2"><?=$lang['edit']['timeout2'];?></label>
493 <div class="col-sm-10">
494 <input type="number" class="form-control" name="timeout2" min="1" max="32000" value="600">
495 <small class="help-block">1-32000</small>
496 </div>
497 </div>
498 <div class="form-group">
499 <label class="control-label col-sm-2" for="exclude"><?=$lang['add']['exclude'];?></label>
500 <div class="col-sm-10">
501 <input type="text" class="form-control" name="exclude" value="(?i)spam|(?i)junk">
502 </div>
503 </div>
504 <div class="form-group">
505 <label class="control-label col-sm-2" for="custom_params"><?=$lang['add']['custom_params'];?></label>
506 <div class="col-sm-10">
507 <input type="text" class="form-control" name="custom_params" placeholder="--dry --some-param=xy --other-param=yx">
508 <small class="help-block"><?=$lang['add']['custom_params_hint'];?></small>
509 </div>
510 </div>
511 <div class="form-group">
512 <div class="col-sm-offset-2 col-sm-10">
513 <div class="checkbox">
514 <label><input type="checkbox" value="1" name="delete2duplicates" checked> <?=$lang['add']['delete2duplicates'];?> (--delete2duplicates)</label>
515 </div>
516 </div>
517 </div>
518 <div class="form-group">
519 <div class="col-sm-offset-2 col-sm-10">
520 <div class="checkbox">
521 <label><input type="checkbox" value="1" name="delete1"> <?=$lang['add']['delete1'];?> (--delete1)</label>
522 </div>
523 </div>
524 </div>
525 <div class="form-group">
526 <div class="col-sm-offset-2 col-sm-10">
527 <div class="checkbox">
528 <label><input type="checkbox" value="1" name="delete2"> <?=$lang['add']['delete2'];?> (--delete2)</label>
529 </div>
530 </div>
531 </div>
532 <div class="form-group">
533 <div class="col-sm-offset-2 col-sm-10">
534 <div class="checkbox">
535 <label><input type="checkbox" value="1" name="automap" checked> <?=$lang['add']['automap'];?> (--automap)</label>
536 </div>
537 </div>
538 </div>
539 <div class="form-group">
540 <div class="col-sm-offset-2 col-sm-10">
541 <div class="checkbox">
542 <label><input type="checkbox" value="1" name="skipcrossduplicates"> <?=$lang['add']['skipcrossduplicates'];?> (--skipcrossduplicates)</label>
543 </div>
544 </div>
545 </div>
546 <div class="form-group">
547 <div class="col-sm-offset-2 col-sm-10">
548 <div class="checkbox">
549 <label><input type="checkbox" value="1" name="subscribeall" checked> <?=$lang['add']['subscribeall'];?> (--subscribeall)</label>
550 </div>
551 </div>
552 </div>
553 <div class="form-group">
554 <div class="col-sm-offset-2 col-sm-10">
555 <div class="checkbox">
556 <label><input type="checkbox" value="1" name="active" checked> <?=$lang['add']['active'];?></label>
557 </div>
558 </div>
559 </div>
560 <div class="form-group">
561 <div class="col-sm-offset-2 col-sm-10">
562 <button class="btn btn-default" data-action="add_item" data-id="add_syncjob" data-api-url='add/syncjob' data-api-attr='{}' href="#"><?=$lang['admin']['add'];?></button>
563 </div>
564 </div>
565 </form>
566 </div>
567 </div>
568 </div>
569</div><!-- add sync job modal -->
570<!-- add add_filter modal -->
571<div class="modal fade" id="addFilterModalAdmin" tabindex="-1" role="dialog" aria-hidden="true">
572 <div class="modal-dialog modal-lg">
573 <div class="modal-content">
574 <div class="modal-header">
575 <button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">×</span></button>
576 <h3 class="modal-title">Filter</h3>
577 </div>
578 <div class="modal-body">
579 <form class="form-horizontal" data-cached-form="true" role="form" data-id="add_filter">
580 <div class="form-group">
581 <label class="control-label col-sm-2" for="username"><?=$lang['add']['username'];?></label>
582 <div class="col-sm-10">
583 <select data-live-search="true" name="username" required>
584 <?php
585 $domains = mailbox('get', 'domains');
586 if (!empty($domains)) {
587 foreach ($domains as $domain) {
588 $mailboxes = mailbox('get', 'mailboxes', $domain);
589 foreach ($mailboxes as $mailbox) {
590 echo "<option>".htmlspecialchars($mailbox)."</option>";
591 }
592 }
593 }
594 ?>
595 </select>
596 </div>
597 </div>
598 <div class="form-group">
599 <label class="control-label col-sm-2" for="filter_type"><?=$lang['add']['sieve_type'];?></label>
600 <div class="col-sm-10">
601 <select id="addFilterType" name="filter_type" required>
602 <option value="prefilter">Prefilter</option>
603 <option value="postfilter">Postfilter</option>
604 </select>
605 </div>
606 </div>
607 <div class="form-group">
608 <label class="control-label col-sm-2" for="script_desc"><?=$lang['add']['sieve_desc'];?></label>
609 <div class="col-sm-10">
610 <input type="text" class="form-control" id="script_desc" name="script_desc" required maxlength="255">
611 </div>
612 </div>
613 <div class="form-group">
614 <label class="control-label col-sm-2" for="script_data">Script:</label>
615 <div class="col-sm-10">
616 <textarea autocorrect="off" spellcheck="false" autocapitalize="none" class="form-control textarea-code script_data" rows="20" name="script_data" required></textarea>
617 </div>
618 </div>
619 <div class="form-group">
620 <div class="col-sm-offset-2 col-sm-10">
621 <p class="help-block"><?=$lang['add']['activate_filter_warn'];?></p>
622 <div class="checkbox">
623 <label><input type="checkbox" value="1" name="active" checked> <?=$lang['add']['active'];?></label>
624 </div>
625 </div>
626 </div>
627 <div class="form-group">
628 <div class="col-sm-offset-2 col-sm-10 add_filter_btns">
629 <button class="btn btn-default validate_sieve" href="#"><?=$lang['add']['validate'];?></button>
630 <button class="btn btn-success add_sieve_script" data-action="add_item" data-id="add_filter" data-api-url='add/filter' data-api-attr='{}' href="#" disabled><?=$lang['admin']['add'];?></button>
631 </div>
632 </div>
633 </form>
634 <?=$lang['mailbox']['sieve_preset_header']?>
635 <ul id="sieve_presets"></ul>
636 </div>
637 </div>
638 </div>
639</div><!-- add add_filter modal -->
640<!-- add add_bcc modal -->
641<div class="modal fade" id="addBCCModalAdmin" tabindex="-1" role="dialog" aria-hidden="true">
642 <div class="modal-dialog modal-lg">
643 <div class="modal-content">
644 <div class="modal-header">
645 <button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">×</span></button>
646 <h3 class="modal-title"><?=$lang['mailbox']['bcc_maps'];?></h3>
647 </div>
648 <div class="modal-body">
649 <form class="form-horizontal" data-cached-form="true" role="form" data-id="add_bcc">
650 <div class="form-group">
651 <label class="control-label col-sm-2" for="local_dest"><?=$lang['mailbox']['bcc_local_dest'];?></label>
652 <div class="col-sm-10">
653 <select data-live-search="true" name="local_dest" required>
654 <?php
655 $domains = mailbox('get', 'domains');
656 $alias_domains = mailbox('get', 'alias_domains');
657 if (!empty($domains)) {
658 foreach ($domains as $domain) {
659 echo "<option>".htmlspecialchars($domain)."</option>";
660 }
661 }
662 if (!empty($alias_domains)) {
663 foreach ($alias_domains as $alias_domain) {
664 echo "<option>".htmlspecialchars($alias_domain)."</option>";
665 }
666 }
667 if (!empty($domains)) {
668 foreach ($domains as $domain) {
669 $mailboxes = mailbox('get', 'mailboxes', $domain);
670 foreach ($mailboxes as $mailbox) {
671 echo "<option>".htmlspecialchars($mailbox)."</option>";
672 }
673 }
674 }
675 ?>
676 </select>
677 </div>
678 </div>
679 <div class="form-group">
680 <label class="control-label col-sm-2" for="type"><?=$lang['mailbox']['bcc_map_type'];?></label>
681 <div class="col-sm-10">
682 <select name="type" required>
683 <option value="sender"><?=$lang['mailbox']['bcc_sender_map'];?></option>
684 <option value="rcpt"><?=$lang['mailbox']['bcc_rcpt_map'];?></option>
685 </select>
686 </div>
687 </div>
688 <div class="form-group">
689 <label class="control-label col-sm-2" for="bcc_dest"><?=$lang['mailbox']['bcc_destination'];?></label>
690 <div class="col-sm-10">
691 <input type="text" class="form-control" name="bcc_dest">
692 </div>
693 </div>
694 <div class="form-group">
695 <div class="col-sm-offset-2 col-sm-10">
696 <div class="checkbox">
697 <label><input type="checkbox" value="1" name="active" checked> <?=$lang['add']['active'];?></label>
698 </div>
699 </div>
700 </div>
701 <div class="form-group">
702 <div class="col-sm-offset-2 col-sm-10">
703 <button class="btn btn-success" data-action="add_item" data-id="add_bcc" data-api-url='add/bcc' data-api-attr='{}' href="#"><?=$lang['admin']['add'];?></button>
704 </div>
705 </div>
706 </form>
707 </div>
708 </div>
709 </div>
710</div><!-- add add_bcc modal -->
711<!-- add add_recipient_map modal -->
712<div class="modal fade" id="addRecipientMapModalAdmin" tabindex="-1" role="dialog" aria-hidden="true">
713 <div class="modal-dialog modal-lg">
714 <div class="modal-content">
715 <div class="modal-header">
716 <button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">×</span></button>
717 <h3 class="modal-title"><?=$lang['mailbox']['recipient_maps'];?></h3>
718 </div>
719 <div class="modal-body">
720 <form class="form-horizontal" data-cached-form="true" role="form" data-id="add_recipient_map">
721 <div class="form-group">
722 <label class="control-label col-sm-2" for="recipient_map_old"><?=$lang['mailbox']['recipient_map_old'];?></label>
723 <div class="col-sm-10">
724 <input type="text" class="form-control" name="recipient_map_old">
725 <small><?=$lang['mailbox']['recipient_map_old_info'];?></small>
726 </div>
727 </div>
728 <div class="form-group">
729 <label class="control-label col-sm-2" for="recipient_map_new"><?=$lang['mailbox']['recipient_map_new'];?></label>
730 <div class="col-sm-10">
731 <input type="text" class="form-control" name="recipient_map_new">
732 <small><?=$lang['mailbox']['recipient_map_new_info'];?></small>
733 </div>
734 </div>
735 <div class="form-group">
736 <div class="col-sm-offset-2 col-sm-10">
737 <div class="checkbox">
738 <label><input type="checkbox" value="1" name="active" checked> <?=$lang['add']['active'];?></label>
739 </div>
740 </div>
741 </div>
742 <div class="form-group">
743 <div class="col-sm-offset-2 col-sm-10">
744 <button class="btn btn-success" data-action="add_item" data-id="add_recipient_map" data-api-url='add/recipient_map' data-api-attr='{}' href="#"><?=$lang['admin']['add'];?></button>
745 </div>
746 </div>
747 </form>
748 </div>
749 </div>
750 </div>
751</div><!-- add add_recipient_map modal -->
752<!-- add add_tls_policy_map modal -->
753<div class="modal fade" id="addTLSPolicyMapAdmin" tabindex="-1" role="dialog" aria-hidden="true">
754 <div class="modal-dialog modal-lg">
755 <div class="modal-content">
756 <div class="modal-header">
757 <button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">×</span></button>
758 <h3 class="modal-title"><?=$lang['mailbox']['tls_policy_maps'];?></h3>
759 </div>
760 <div class="modal-body">
761 <form class="form-horizontal" data-cached-form="true" role="form" data-id="add_tls_policy_map">
762 <div class="form-group">
763 <label class="control-label col-sm-2" for="dest"><?=$lang['mailbox']['tls_map_dest'];?></label>
764 <div class="col-sm-10">
765 <input type="text" class="form-control" name="dest">
766 <small><?=$lang['mailbox']['tls_map_dest_info'];?></small>
767 </div>
768 </div>
769 <div class="form-group">
770 <label class="control-label col-sm-2" for="policy"><?=$lang['mailbox']['tls_map_policy'];?></label>
771 <div class="col-sm-10">
772 <select class="full-width-select" name="policy" required>
773 <option value="none">none</option>
774 <option value="may">may</option>
775 <option value="encrypt">encrypt</option>
776 <option value="dane">dane</option>
777 <option value="dane-only">dane-only</option>
778 <option value="fingerprint">fingerprint</option>
779 <option value="verify">verify</option>
780 <option value="secure">secure</option>
781 </select>
782 </div>
783 </div>
784 <div class="form-group">
785 <label class="control-label col-sm-2" for="parameters"><?=$lang['mailbox']['tls_map_parameters'];?></label>
786 <div class="col-sm-10">
787 <input type="text" class="form-control" name="parameters">
788 <small><?=$lang['mailbox']['tls_map_parameters_info'];?></small>
789 </div>
790 </div>
791 <div class="form-group">
792 <div class="col-sm-offset-2 col-sm-10">
793 <div class="checkbox">
794 <label><input type="checkbox" value="1" name="active" checked> <?=$lang['add']['active'];?></label>
795 </div>
796 </div>
797 </div>
798 <div class="form-group">
799 <div class="col-sm-offset-2 col-sm-10">
800 <button class="btn btn-success" data-action="add_item" data-id="add_tls_policy_map" data-api-url='add/tls-policy-map' data-api-attr='{}' href="#"><?=$lang['admin']['add'];?></button>
801 </div>
802 </div>
803 </form>
804 </div>
805 </div>
806 </div>
807</div><!-- add add_tls_policy_map modal -->
808<!-- log modal -->
809<div class="modal fade" id="syncjobLogModal" tabindex="-1" role="dialog" aria-labelledby="syncjobLogModalLabel">
810 <div class="modal-dialog modal-lg" role="document">
811 <div class="modal-content">
812 <div class="modal-header"><h4 class="modal-title">Log</h4></div>
813 <div class="modal-body">
814 <textarea class="form-control" rows="20" id="logText" spellcheck="false"></textarea>
815 </div>
816 </div>
817 </div>
818</div><!-- log modal -->
819<!-- DNS info modal -->
820<div class="modal fade" id="dnsInfoModal" tabindex="-1" role="dialog" aria-labelledby="dnsInfoModalLabel">
821 <div class="modal-dialog modal-lg" role="document">
822 <div class="modal-content">
823 <div class="modal-header"><h4 class="modal-title"><?=$lang['diagnostics']['dns_records'];?></h4></div>
824 <div class="modal-body">
825 <p><?=$lang['diagnostics']['dns_records_24hours'];?></p>
826 <div class="dns-modal-body"></div>
827 </div>
828 </div>
829 </div>
830</div><!-- DNS info modal -->