Skip to content

Commit

Permalink
v1.5
Browse files Browse the repository at this point in the history
  • Loading branch information
coax committed Aug 22, 2018
1 parent ed39c5e commit 72b1171
Show file tree
Hide file tree
Showing 37 changed files with 1,130 additions and 356 deletions.
11 changes: 10 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,15 @@ Common issues: https://www.hmailserver.com/documentation/latest/?page=ts_setup_p

Changelog
-----
Version 1.5 (2018-08-22)
- [tweak] changes to config.php
- [tweak] Server graph on dashboard displays delivery queue count
- [new] DMARC reports in side navigation (thanks to @tunis)
- [new] IMAP folders under Account
- [tweak] replaced "tablesort" with "stupidtable" plugin
- [tweak] added APIPA addresses to regex in geoIp() function
- [fix] CSS fix

Version 1.4 (2018-08-11)
- [new] Blacklist check (under Utilities)
- [new] Dashboard: Live logging (thanks to @tunis)
Expand Down Expand Up @@ -172,7 +181,7 @@ Version 0.9 beta (2016-12-28)
- [jQuery](https://jquery.com/)
- [Modernizr](https://modernizr.com/)
- [Defunkt Facebox](http://defunkt.io/facebox/)
- [tablesort](https://github.com/kylefox/jquery-tablesorttablesort)
- [stupidtable](https://github.com/joequery/Stupid-Table-Plugin)
- [datepicker](https://github.com/fengyuanchen/datepicker)
- [autosize](https://github.com/jackmoore/autosize)
- [timeago](http://timeago.yarp.com/timeago)
Expand Down
51 changes: 51 additions & 0 deletions hMailAdmin/background_account_imapfolder_save.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
<?php
if (!defined('IN_WEBADMIN'))
exit();

// Request variables
$DomainId = hmailGetVar("domainid", 0, true);
$AccountId = hmailGetVar("accountid", 0, true);
$FolderId = hmailGetVar("folderid", 0, true);
//$SubFolderId = hmailGetVar("subfolderid", 0, true);
$Action = hmailGetVar("action", "");

$obDomain = $obBaseApp->Domains->ItemByDBID($DomainId);

// Not domain admin
if (hmailGetAdminLevel() == 0)
hmailHackingAttemp();

// Domain admin but not for this domain
if (hmailGetAdminLevel() == 1 && $DomainId != hmailGetDomainID())
hmailHackingAttemp();

// Request variables
$FolderName = hmailGetVar("foldername", "Unnamed");
//$FolderParent = hmailGetVar("folderparentid", -1);
$FolderSubscribed = hmailGetVar("folderissubscribed", 0);

$obAccount = $obDomain->Accounts->ItemByDBID($AccountId);
$Folders = $obAccount->IMAPFolders();

// Actions
if ($Action == "edit")
$Folder = $Folders->ItemByDBID($FolderId);
elseif ($Action == "add") {
$Folders->Add($FolderName);
header("Location: index.php?page=account&action=edit&domainid=$DomainId&accountid=$AccountId");
exit();
} elseif ($Action == "delete") {
$Folders->DeleteByDBID($FolderId);
header("Location: index.php?page=account&action=edit&domainid=$DomainId&accountid=$AccountId");
exit();
}

// Save the changes
$Folder->Name = $FolderName;
//$Folder->ParentID = $FolderParent;
$Folder->Subscribed = $FolderSubscribed;

$Folder->Save();

header("Location: index.php?page=account&action=edit&domainid=$DomainId&accountid=$AccountId");
?>
12 changes: 12 additions & 0 deletions hMailAdmin/background_dmarcreports.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<?php
if (!defined('IN_WEBADMIN'))
exit();

if (hmailGetAdminLevel() != 2)
hmailHackingAttemp();

$dmarcfilename = hmailGetVar("dfn", "");

if(file_exists($dmarcfilename)) unlink($dmarcfilename);

header("Location: index.php?page=dmarcreports");
62 changes: 30 additions & 32 deletions hMailAdmin/background_surblserver_save.php
Original file line number Diff line number Diff line change
@@ -1,37 +1,35 @@
<?php
if (!defined('IN_WEBADMIN'))
exit();
if (!defined('IN_WEBADMIN'))
exit();

if (hmailGetAdminLevel() != ADMIN_SERVER)
hmailHackingAttemp(); // The user is not server administrator.

$action = hmailGetVar("action","");
$id = hmailGetVar("id",0);
$Active = hmailGetVar("Active",0);
$DNSHost = hmailGetVar("DNSHost","");
$RejectMessage = hmailGetVar("RejectMessage","");
$Score = hmailGetVar("Score",0);

$surblServers = $obBaseApp->Settings->AntiSpam->SURBLServers;

if ($action == "edit")
$surblServer = $surblServers->ItemByDBID($id);
elseif ($action == "add")
$surblServer = $surblServers->Add();
elseif ($action == "delete")
{
$surblServers->DeleteByDBID($id);
header("Location: index.php?page=surblservers");
}
if (hmailGetAdminLevel() != ADMIN_SERVER)
hmailHackingAttemp(); // The user is not server administrator.

// Save the changes
$surblServer->Active = $Active;
$surblServer->DNSHost = $DNSHost;
$surblServer->RejectMessage = $RejectMessage;
$surblServer->Score = $Score;
$action = hmailGetVar("action","");
$id = hmailGetVar("id",0);
$Active = hmailGetVar("Active",0);
$DNSHost = hmailGetVar("DNSHost","");
$RejectMessage = hmailGetVar("RejectMessage","");
$Score = hmailGetVar("Score",0);

$surblServer->Save();

header("Location: index.php?page=surblservers");
?>
$surblServers = $obBaseApp->Settings->AntiSpam->SURBLServers;

if ($action == "edit")
$surblServer = $surblServers->ItemByDBID($id);
elseif ($action == "add")
$surblServer = $surblServers->Add();
elseif ($action == "delete") {
$surblServers->DeleteByDBID($id);
header("Location: index.php?page=surblservers");
}

// Save the changes
$surblServer->Active = $Active;
$surblServer->DNSHost = $DNSHost;
$surblServer->RejectMessage = $RejectMessage;
$surblServer->Score = $Score;

$surblServer->Save();

header("Location: index.php?page=surblservers");
?>
48 changes: 47 additions & 1 deletion hMailAdmin/config-dist.php
Original file line number Diff line number Diff line change
Expand Up @@ -120,5 +120,51 @@

$hmail_config['datepicker_weekStart'] = 1;

$hmail_config['version'] = 1.4;
/*
DMARC report analyser.
Download new reports from IMAP.
Unpack and / or save in dmarcreport directory.
REQUIRED: IMAP extension
The directory "dmarcreports" must exist and have write permission to it.
*/

$hmail_config['dmarc_enable'] = false;

/*
IMAP account user name
*/

$hmail_config['dmarc_username'] = '[email protected]';

/*
IMAP account password
*/

$hmail_config['dmarc_password'] = 'password';

/*
IMAP server IP
*/

$hmail_config['dmarc_hostip'] = '127.0.0.1';

/*
IMAP server port
*/

$hmail_config['dmarc_port'] = 993;

/*
IMAP server encryption
Possible values:
ssl - ssl encryption
tsl - tsl encryption
notls - no encryption
*/

$hmail_config['dmarc_encryption'] = 'ssl';
?>
5 changes: 1 addition & 4 deletions hMailAdmin/css/close.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
30 changes: 16 additions & 14 deletions hMailAdmin/css/core.css
Original file line number Diff line number Diff line change
Expand Up @@ -107,19 +107,19 @@ label {display:inline-block; margin-bottom:18px;}
.form input.small, .form textarea.small, .form select.small {width:15%;}
.form input.medium, .form textarea.medium, .form select.medium {width:48%;}
.form input[type="text"]:focus, .form input[type="password"]:focus, .form input[type="email"]:focus, .form textarea:focus, .form select:focus {border-color:#1784c7; box-shadow:0 0 5px rgba(44, 151, 222, 0.2);}
.form input[type=radio], .form input[type=checkbox] {left:0; top:50%; -webkit-transform:translateY(-50%); -moz-transform:translateY(-50%); -ms-transform:translateY(-50%); -o-transform:translateY(-50%); transform:translateY(-50%); margin:0; padding:0; opacity:0; z-index:2;}
input[type=radio], input[type=checkbox] {left:0; top:50%; -webkit-transform:translateY(-50%); -moz-transform:translateY(-50%); -ms-transform:translateY(-50%); -o-transform:translateY(-50%); transform:translateY(-50%); margin:0; padding:0; opacity:0; z-index:2;}
/* checkbox + radio */
.form input[type="radio"] + label, .form input[type="checkbox"] + label {cursor:pointer; font-size:13px; padding:0 8px; user-select:none;}
.form input[type="radio"] + label::before, .form input[type="radio"] + label::after, .form input[type="checkbox"] + label::before, .form input[type="checkbox"] + label::after {display:block; content:' '; position:absolute; left:0; top:0; width:16px; height:16px;}
.form input[type="radio"] + label::before, .form input[type="checkbox"] + label::before {border:1px solid #cfd9db; background:#fff; box-shadow:inset 0 1px 1px rgba(0, 0, 0, 0.08);}
.form input[type="radio"] + label::before, .form input[type="radio"] + label::after {border-radius: 50%;}
.form input[type="checkbox"] + label::before, .form input[type="checkbox"] + label::after {border-radius:3px;}
.form input[type="radio"] + label::after, .form input[type="checkbox"] + label::after {background-color:#2c97de; background-position:center center; background-repeat:no-repeat; box-shadow:0 1px 3px rgba(0, 0, 0, 0.3); /*box-shadow:0 0 5px rgba(44, 151, 222, 0.4);*/ display:none;}
.form input[type="radio"] + label::after {background-image:url('cd-icon-radio.svg');}
.form input[type="checkbox"] + label::after {background-image:url('cd-icon-check.svg');}
.form input[type="radio"]:focus + label::before, .form input[type="checkbox"]:focus + label::before {box-shadow:0 0 5px rgba(44, 151, 222, 0.2); /*box-shadow:0 0 5px rgba(44, 151, 222, 0.6);*/}
.form input[type="radio"]:checked + label::after, .form input[type="checkbox"]:checked + label::after {display:block;}
.form input[type="radio"]:checked + label::before, .form input[type="radio"]:checked + label::after, .form input[type="checkbox"]:checked + label::before, .form input[type="checkbox"]:checked + label::after {-webkit-animation:cd-bounce 0.3s; -moz-animation:cd-bounce 0.3s; animation:cd-bounce 0.3s;}
input[type="radio"] + label, input[type="checkbox"] + label {cursor:pointer; font-size:13px; padding:0 8px; user-select:none;}
input[type="radio"] + label::before, input[type="radio"] + label::after, input[type="checkbox"] + label::before, input[type="checkbox"] + label::after {display:block; content:' '; position:absolute; left:0; top:0; width:16px; height:16px;}
input[type="radio"] + label::before, input[type="checkbox"] + label::before {border:1px solid #cfd9db; background:#fff; box-shadow:inset 0 1px 1px rgba(0, 0, 0, 0.08);}
input[type="radio"] + label::before, input[type="radio"] + label::after {border-radius: 50%;}
input[type="checkbox"] + label::before, input[type="checkbox"] + label::after {border-radius:3px;}
input[type="radio"] + label::after, input[type="checkbox"] + label::after {background-color:#2c97de; background-position:center center; background-repeat:no-repeat; box-shadow:0 1px 3px rgba(0, 0, 0, 0.3); /*box-shadow:0 0 5px rgba(44, 151, 222, 0.4);*/ display:none;}
input[type="radio"] + label::after {background-image:url('cd-icon-radio.svg');}
input[type="checkbox"] + label::after {background-image:url('cd-icon-check.svg');}
input[type="radio"]:focus + label::before, input[type="checkbox"]:focus + label::before {box-shadow:0 0 5px rgba(44, 151, 222, 0.2); /*box-shadow:0 0 5px rgba(44, 151, 222, 0.6);*/}
input[type="radio"]:checked + label::after, input[type="checkbox"]:checked + label::after {display:block;}
input[type="radio"]:checked + label::before, input[type="radio"]:checked + label::after, input[type="checkbox"]:checked + label::before, input[type="checkbox"]:checked + label::after {-webkit-animation:cd-bounce 0.3s; -moz-animation:cd-bounce 0.3s; animation:cd-bounce 0.3s;}

/* form animations */
@-webkit-keyframes cd-bounce {
Expand Down Expand Up @@ -171,13 +171,14 @@ nav {display:none;}
#top > li a {padding:15px 5%;} /* mobile menu */

/* side menu */
#sidebar {position:absolute; left:0; top:0; width:100%; z-index:1; background:#2c3136; visibility:hidden; opacity:0; overflow:hidden; transition:opacity 0.2s 0s, visibility 0s 0.2s; max-height:100vh;}
#sidebar {position:absolute; left:0; top:0; width:100%; max-height:100vh; z-index:1; background:#2c3136; visibility:hidden; opacity:0; overflow:hidden; transition:opacity 0.2s 0s, visibility 0s 0.2s;}
#sidebar.is-visible {visibility:visible; opacity:1; overflow:visible; transition:opacity 0.2s 0s, visibility 0s 0s; box-shadow:0 2px 10px rgba(0, 0, 0, 0.2); max-height:none;}
#sidebar a {display:block; padding:15px 10% 15px calc(5% + 24px); position:relative; color:#fff; font-size:15px;}
#sidebar > ul > li > a {border-bottom:1px solid #373d44;}
#sidebar > ul > li > a::before {position:absolute; content:''; top:12px; left:5%; height:16px; width:16px; background:url('icons.svg') no-repeat 0 0;}
#sidebar .count {position:absolute; top:13px; right:10%; padding:2px 5px; border-radius:2px; background:#ff7e66; font-size:10px; font-weight:700; text-align:center; box-shadow:1px 1px 1px rgba(0,0,0,.3);}
#sidebar ul li.status > a::before {background-position:0 0;}
#sidebar ul li.domains a {overflow:hidden; text-overflow:ellipsis;}
#sidebar ul li.domains > a::before {background-position:-16px 0;}
#sidebar ul li.rules > a::before {background-position:-32px 0;}
#sidebar ul li.settings > a::before {background-position:-48px 0;}
Expand All @@ -188,6 +189,7 @@ nav {display:none;}
#sidebar ul li.help > a::before {background-position:-176px 0;}
#sidebar ul li.user > a::before {background-position:-192px 0;}
#sidebar ul li.webmail > a::before {background-position:-208px 0;}
#sidebar ul li.dmarc > a::before {background-position:-224px 0;}
#sidebar .label {display:block; padding:8px 5%; text-transform:uppercase; font-size:10px; font-weight:700; color:#646a6f; letter-spacing:.1em; margin:24px 0 0 0;}
#sidebar .label:first-child {margin-top:12px;}
#sidebar .action-btn {margin:8px 5%;}
Expand Down Expand Up @@ -249,7 +251,7 @@ nav {display:none;}
.tablesort th:after {position:absolute; content:' '; width:13px; height:13px; top:33%; margin-left:5px; background:red; background:url('arrow.svg'); background-size:100%; opacity:.5;}
.tablesort th:hover {color:#3e454c; cursor:pointer;}
.tablesort th:hover:after {opacity:1;}
.tablesort th.ascending:after {-webkit-transform:rotate(180deg); -moz-transform:rotate(180deg); -ms-transform:rotate(180deg); -o-transform:rotate(180deg); transform:rotate(180deg);}
.tablesort th.sorting-asc:after {-webkit-transform:rotate(180deg); -moz-transform:rotate(180deg); -ms-transform:rotate(180deg); -o-transform:rotate(180deg); transform:rotate(180deg);}
.tablesort th.no-sort {cursor:default;}
.tablesort th.no-sort:after {display:none;}

Expand Down
Loading

0 comments on commit 72b1171

Please sign in to comment.