Skip to content

Commit 1f78039

Browse files
author
Kristan Kenney
committed
Add IMAP_SYSTEM variable checks
If dovecot is installed on the system, then add IMAP_SYSTEM variable during upgrade if necessary. When rebuilding mail domains, ensure that dovecot is installed prior to setting permissions on the IMAP/POP Authentication Password file to prevent an error message in the console.
1 parent 7abf64a commit 1f78039

File tree

4 files changed

+26
-12
lines changed

4 files changed

+26
-12
lines changed

func/rebuild.sh

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -525,7 +525,9 @@ rebuild_mail_domain_conf() {
525525
chmod 771 /etc/$MAIL_SYSTEM/domains/$domain_idn
526526
chmod 770 $HOMEDIR/$user/mail/$domain_idn
527527
chown -R $MAIL_USER:mail $HOMEDIR/$user/conf/mail/$domain
528-
chown -R dovecot:mail $HOMEDIR/$user/conf/mail/$domain/passwd
528+
if [ "$IMAP_SYSTEM" = "dovecot" ]; then
529+
chown -R dovecot:mail $HOMEDIR/$user/conf/mail/$domain/passwd
530+
fi
529531
chown $user:mail $HOMEDIR/$user/mail/$domain_idn
530532
fi
531533

install/upgrade/0.9.8-28.sh

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -192,6 +192,14 @@ if [ -f /etc/dovecot/dovecot.conf ]; then
192192
sleep 0.5
193193
fi
194194

195+
# Add IMAP system variable to configuration if dovecot is installed
196+
if [ -z "$IMAP_SYSTEM" ]; then
197+
if [ -f /usr/bin/dovecot ]; then
198+
echo "(*) Adding IMAP_SYSTEM variable to hestia.conf..."
199+
echo "IMAP_SYSTEM = 'dovecot'" >> $HESTIA/conf/hestia.conf
200+
fi
201+
fi
202+
195203
# Rebuild mailboxes
196204
for user in `ls /usr/local/hestia/data/users/`; do
197205
echo "(*) Rebuilding mail domain for $user..."

web/templates/admin/add_web.html

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -71,16 +71,20 @@
7171
</select>
7272
</td>
7373
</tr>
74-
<?php if($panel[$user]['DNS_DOMAINS'] != "0") { ?><tr>
75-
<td class="vst-text input-label">
76-
<label><input type="checkbox" size="20" class="vst-checkbox" name="v_dns" <?php if (empty($v_dns)&&$panel[$user]['DNS_DOMAINS'] != "0") echo "checked=yes"; ?>> <?php print __('DNS Support');?></label>
77-
</td>
78-
</tr><?php } ?>
79-
<?php if($panel[$user]['MAIL_DOMAINS'] != "0") { ?><tr>
80-
<td class="vst-text input-label">
81-
<label><input type="checkbox" size="20" class="vst-checkbox" name="v_mail" <?php if (empty($v_mail)&&$panel[$user]['MAIL_DOMAINS'] != "0") echo "checked=yes"; ?>> <?php print __('Mail Support');?></label>
82-
</td>
83-
</tr><?php } ?>
74+
<?php if ((isset($_SESSION['DNS_SYSTEM'])) && (!empty($_SESSION['DNS_SYSTEM']))) {?>
75+
<?php if($panel[$user]['DNS_DOMAINS'] != "0") { ?><tr>
76+
<td class="vst-text input-label">
77+
<label><input type="checkbox" size="20" class="vst-checkbox" name="v_dns" <?php if (empty($v_dns)&&$panel[$user]['DNS_DOMAINS'] != "0") echo "checked=yes"; ?>> <?php print __('DNS Support');?></label>
78+
</td>
79+
</tr><?php } ?>
80+
<?php } ?>
81+
<?php if ((isset($_SESSION['IMAP_SYSTEM'])) && (!empty($_SESSION['IMAP_SYSTEM']))) {?>
82+
<?php if($panel[$user]['MAIL_DOMAINS'] != "0") { ?><tr>
83+
<td class="vst-text input-label">
84+
<label><input type="checkbox" size="20" class="vst-checkbox" name="v_mail" <?php if (empty($v_mail)&&$panel[$user]['MAIL_DOMAINS'] != "0") echo "checked=yes"; ?>> <?php print __('Mail Support');?></label>
85+
</td>
86+
</tr><?php } ?>
87+
<?php } ?>
8488
<tr>
8589
<td class="step-top vst-text" style="/*padding: 32px 0 20px 0;*/">
8690
<a href="javascript:elementHideShow('advtable');" class="vst-advanced"><?php print __('Advanced options');?>&nbsp;<i class="fas fa-arrow-circle-right"></i></a>

web/templates/admin/panel.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@
7676
<?php } ?>
7777
<?php } ?>
7878

79-
<?php if ((isset($_SESSION['MAIL_SYSTEM'])) && (!empty($_SESSION['MAIL_SYSTEM']))) {?>
79+
<?php if ((isset($_SESSION['IMAP_SYSTEM'])) && (!empty($_SESSION['IMAP_SYSTEM']))) {?>
8080
<?php if($panel[$user]['MAIL_DOMAINS'] != "0") { ?>
8181
<div class="l-stat__col <?php if($TAB == 'MAIL' ) echo 'l-stat__col--active' ?>">
8282
<a href="/list/mail/">

0 commit comments

Comments
 (0)