<?php

if (!defined('IN_WEBADMIN')) {
    exit;
}
if (hmailGetAdminLevel() != ADMIN_SERVER) {
    hmailHackingAttemp();
}
// The user is not server administrator
$messageid = hmailGetVar("messageid", 0);
$obServerMessage = $obBaseApp->Settings->ServerMessages->ItemByDBID($messageid);
$messagename = $obServerMessage->Name;
$messagetext = $obServerMessage->Text;
?>

<h1><?php 
EchoTranslation("Server message");
?>
</h1>

<form action="index.php" method="post" onSubmit="return formCheck(this);">

   <?php 
PrintHidden("page", "background_servermessage_save");
PrintHidden("messageid", "{$messageid}");
?>
	
   <div class="tabber">
      <div class="tabbertab">
         <h2><?php 
EchoTranslation("General");
        $actionObj->Body = hmailGetVar("Body", "");
        $actionObj->HeaderName = hmailGetVar("HeaderName", "");
        switch ($type) {
            case eRASetHeaderValue:
                $actionObj->Value = hmailGetVar("Value", "");
                break;
            case eRABindToAddress:
                $actionObj->Value = hmailGetVar("BindToAddress", "");
                break;
        }
        $actionObj->Type = $type;
        $actionObj->Save();
        $rule->Save();
        header("Location: {$rule_link}");
        die;
    } else {
        if ($savetype == "rule") {
            $rule->Name = hmailGetVar("Name", "");
            $rule->Active = hmailGetVar("Active", "") == "1";
            $rule->UseAND = hmailGetVar("UseAND", "") == "1";
            $rule->Save();
            $ruleid = $rule->ID;
            // can't re-use rule_link since the rule id might be new (if add)
            header("Location: index.php?page=rule&action=edit&domainid={$domainid}&accountid={$accountid}&ruleid={$ruleid}");
            die;
        }
    }
}
?>

<?php

if (!defined('IN_WEBADMIN')) {
    exit;
}
$username = hmailGetVar("username", "");
$password = hmailGetVar("password", "");
if (Login($username, $password)) {
    header("refresh: 0; url=" . $hmail_config['rooturl']);
    exit;
} else {
    // Login failed.
    LoginError();
}
function Login($username, $password)
{
    global $obBaseApp;
    if ($username == "" || $password == "") {
        LoginError();
    }
    $obAccount = $obBaseApp->Authenticate($username, $password);
    if (!isset($obAccount)) {
        LoginError();
    }
    $_SESSION['session_loggedin'] = 1;
    $_SESSION['session_adminlevel'] = $obAccount->AdminLevel();
    $_SESSION['session_username'] = $obAccount->Address;
    $_SESSION['session_password'] = $password;
    $_SESSION['session_domainid'] = $obAccount->DomainID();
    $_SESSION['session_accountid'] = $obAccount->ID();
    return true;
Example #4
0
    if (hmailGetVar("SMTPRelayerUseSSL", "") != "") {
        $obSettings->SetSMTPRelayerPassword(hmailGetVar("SMTPRelayerUseSSL", ""));
    }
    $obSettings->RuleLoopLimit = hmailGetVar("smtprulelooplimit", 0);
    $obSettings->MaxMessageSize = hmailGetVar("maxmessagesize", 0);
    $obSettings->SMTPDeliveryBindToIP = hmailGetVar("smtpdeliverybindtoip", "");
    $obSettings->MaxSMTPRecipientsInBatch = hmailGetVar("maxsmtprecipientsinbatch", "0");
    // RFC compliance
    $obSettings->AllowSMTPAuthPlain = hmailGetVar("AllowSMTPAuthPlain", 0);
    $obSettings->DenyMailFromNull = hmailGetVar("AllowMailFromNull", 0) == "0";
    $obSettings->AllowIncorrectLineEndings = hmailGetVar("AllowIncorrectLineEndings", 0);
    $obSettings->DisconnectInvalidClients = hmailGetVar("DisconnectInvalidClients", 0);
    $obSettings->MaxNumberOfInvalidCommands = hmailGetVar("MaxNumberOfInvalidCommands", 0);
    $obSettings->SendStatistics = hmailGetVar("SendStatistics", 0);
    $obSettings->AddDeliveredToHeader = hmailGetVar("AddDeliveredToHeader", 0);
    $obSettings->MaxNumberOfMXHosts = hmailGetVar("MaxNumberOfMXHosts", 15);
}
// General
$maxsmtpconnections = $obSettings->MaxSMTPConnections;
$welcomesmtp = $obSettings->WelcomeSMTP;
// Delivery of email
$smtpnooftries = $obSettings->SMTPNoOfTries;
$smtpminutesbetweentry = $obSettings->SMTPMinutesBetweenTry;
$HostName = $obSettings->HostName;
$smtprelayer = $obSettings->SMTPRelayer;
$smtprelayerport = $obSettings->SMTPRelayerPort;
$SMTPRelayerRequiresAuthentication = $obSettings->SMTPRelayerRequiresAuthentication;
$SMTPRelayerUseSSL = $obSettings->SMTPRelayerUseSSL;
$SMTPRelayerUsername = $obSettings->SMTPRelayerUsername;
$smtprulelooplimit = $obSettings->RuleLoopLimit;
$maxmessagesize = $obSettings->MaxMessageSize;
Example #5
0
if (hmailGetAdminLevel() != 2) {
    hmailHackingAttemp();
}
$obSettings = $obBaseApp->Settings();
$action = hmailGetVar("action", "");
if ($action == "save") {
    $obSettings->WelcomeIMAP = hmailGetVar("welcomeimap", 0);
    $obSettings->MaxIMAPConnections = hmailGetVar("MaxIMAPConnections", 0);
    $obSettings->IMAPSortEnabled = hmailGetVar("IMAPSortEnabled", 0);
    $obSettings->IMAPQuotaEnabled = hmailGetVar("IMAPQuotaEnabled", 0);
    $obSettings->IMAPIdleEnabled = hmailGetVar("IMAPIdleEnabled", 0);
    $obSettings->IMAPACLEnabled = hmailGetVar("IMAPACLEnabled", 0);
    $obSettings->IMAPSASLPlainEnabled = hmailGetVar("IMAPSASLPlainEnabled", 0);
    $obSettings->IMAPSASLInitialResponseEnabled = hmailGetVar("IMAPSASLInitialResponseEnabled", 0);
    $obSettings->IMAPMasterUser = hmailGetVar("IMAPMasterUser", "");
    $obSettings->IMAPHierarchyDelimiter = hmailGetVar("IMAPHierarchyDelimiter", "");
}
$welcomeimap = $obSettings->WelcomeIMAP;
$MaxIMAPConnections = $obSettings->MaxIMAPConnections;
$IMAPSortEnabled = $obSettings->IMAPSortEnabled;
$IMAPQuotaEnabled = $obSettings->IMAPQuotaEnabled;
$IMAPIdleEnabled = $obSettings->IMAPIdleEnabled;
$IMAPACLEnabled = $obSettings->IMAPACLEnabled;
$IMAPSASLPlainEnabled = $obSettings->IMAPSASLPlainEnabled;
$IMAPSASLInitialResponseEnabled = $obSettings->IMAPSASLInitialResponseEnabled;
$IMAPMasterUser = $obSettings->IMAPMasterUser;
$IMAPHierarchyDelimiter = $obSettings->IMAPHierarchyDelimiter;
?>

<h1><?php 
EchoTranslation("IMAP");
<?php

if (!defined('IN_WEBADMIN')) {
    exit;
}
$distributionlistid = hmailGetVar("distributionlistid", 0);
$recipientid = hmailGetVar("recipientid", 0);
$domainid = hmailGetVar("domainid", 0);
$action = hmailGetVar("action", "");
$recipientaddress = hmailGetVar("recipientaddress", "");
if (hmailGetAdminLevel() == 0) {
    hmailHackingAttemp();
}
if (hmailGetAdminLevel() == 1 && $domainid != hmailGetDomainID()) {
    hmailHackingAttemp();
}
// Domain admin but not for this domain.
$obDomain = $obBaseApp->Domains->ItemByDBID($domainid);
$obList = $obDomain->DistributionLists->ItemByDBID($distributionlistid);
if ($action == "edit") {
    $obRecipient = $obList->Recipients->ItemByDBID($recipientid);
} elseif ($action == "add") {
    $obRecipient = $obList->Recipients->Add();
} elseif ($action == "delete") {
    $obRecipient = $obList->Recipients->ItemByDBID($recipientid);
    $obRecipient->Delete();
    header("Location: index.php?page=distributionlist_recipients&domainid={$domainid}&distributionlistid={$distributionlistid}");
    exit;
}
$obRecipient->RecipientAddress = $recipientaddress;
$obRecipient->Save();
if (!defined('IN_WEBADMIN')) {
    exit;
}
if (hmailGetAdminLevel() != ADMIN_SERVER) {
    hmailHackingAttemp();
}
// The user is not server administrator.
$TestType = hmailGetVar("TestType", "");
$AntiVirusSettings = $obBaseApp->Settings->AntiVirus;
$result = "";
$message = "";
switch ($TestType) {
    case "ClamWin":
        $Executable = hmailGetVar("Executable", "");
        $DatabaseFolder = hmailGetVar("DatabaseFolder", "");
        $result = $AntiVirusSettings->TestClamWinScanner($Executable, $DatabaseFolder, $message);
        break;
    case "ClamAV":
        $Hostname = hmailGetVar("Hostname", "localhost");
        $Port = hmailGetVar("Port", 783);
        $result = $AntiVirusSettings->TestClamAVScanner($Hostname, $Port, $message);
        break;
    case "External":
        $Executable = hmailGetVar("Executable", "");
        $ReturnValue = hmailGetVar("ReturnValue", 0);
        $result = $AntiVirusSettings->TestCustomerScanner($Executable, $ReturnValue, $message);
        break;
    default:
        die;
}
echo $result;
Example #8
0
<?php

error_reporting(E_ALL);
if (!file_exists("config.php")) {
    echo "Please rename config-dist.php to config.php. The file is found in the PHPWebAdmin root folder.";
    die;
}
define('IN_WEBADMIN', true);
require_once "config.php";
require_once "include/initialization_test.php";
require_once "initialize.php";
set_exception_handler("ExceptionHandler");
set_error_handler("ErrorHandler");
$page = hmailGetVar("page");
if ($page == "") {
    $page = "frontpage";
}
$isbackground = substr($page, 0, 10) == "background";
if ($isbackground) {
    $page = "{$page}.php";
} else {
    $page = "hm_{$page}.php";
}
// Check that the page really exists.
$page = stripslashes($page);
$page = basename($page, ".php");
if (!file_exists('./' . $page . '.php')) {
    hmailHackingAttemp();
}
// If it's a background page, run here.
if ($isbackground) {
Example #9
0
<?php

if (!defined('IN_WEBADMIN')) {
    exit;
}
if (hmailGetAdminLevel() != 2) {
    hmailHackingAttemp();
}
$obSettings = $obBaseApp->Settings();
$action = hmailGetVar("action", "");
if ($action == "save") {
    $obSettings->MaxPOP3Connections = hmailGetVar("maxpop3connections", 0);
    $obSettings->WelcomePOP3 = hmailGetVar("welcomepop3", 0);
}
$maxpop3connections = $obSettings->MaxPOP3Connections;
$welcomepop3 = $obSettings->WelcomePOP3;
?>

<h1><?php 
EchoTranslation("POP3");
?>
</h1>

<form action="index.php" method="post" onSubmit="return formCheck(this);">
   <?php 
PrintHidden("page", "pop3");
PrintHidden("action", "save");
?>
   
   
   <div class="tabber">
Example #10
0
    $antiSpamSettings->SpamAssassinPort = hmailGetVar("SpamAssassinPort", 0);
    $antiSpamSettings->SpamAssassinMergeScore = hmailGetVar("SpamAssassinMergeScore", 0);
    $antiSpamSettings->SpamAssassinScore = hmailGetVar("SpamAssassinScore", 0);
    $antiSpamSettings->UseSPF = hmailGetVar("usespf", 0);
    $antiSpamSettings->UseSPFScore = hmailGetVar("usespfscore", 0);
    $antiSpamSettings->UseMXChecks = hmailGetVar("usemxchecks", 0);
    $antiSpamSettings->UseMXChecksScore = hmailGetVar("usemxchecksscore", 0);
    $antiSpamSettings->CheckHostInHelo = hmailGetVar("checkhostinhelo", 0);
    $antiSpamSettings->CheckHostInHeloScore = hmailGetVar("checkhostinheloscore", 0);
    $antiSpamSettings->AddHeaderSpam = hmailGetVar("AddHeaderSpam", 0);
    $antiSpamSettings->AddHeaderReason = hmailGetVar("AddHeaderReason", 0);
    $antiSpamSettings->PrependSubject = hmailGetVar("PrependSubject", 0);
    $antiSpamSettings->PrependSubjectText = hmailGetVar("PrependSubjectText", "");
    $antiSpamSettings->MaximumMessageSize = hmailGetVar("MaximumMessageSize", 0);
    $antiSpamSettings->DKIMVerificationEnabled = hmailGetVar("DKIMVerificationEnabled", 0);
    $antiSpamSettings->DKIMVerificationFailureScore = hmailGetVar("DKIMVerificationFailureScore", 0);
}
$SpamMarkThreshold = $antiSpamSettings->SpamMarkThreshold;
$SpamDeleteThreshold = $antiSpamSettings->SpamDeleteThreshold;
$MaximumMessageSize = $antiSpamSettings->MaximumMessageSize;
$SpamAssassinEnabled = $antiSpamSettings->SpamAssassinEnabled;
$SpamAssassinHost = $antiSpamSettings->SpamAssassinHost;
$SpamAssassinPort = $antiSpamSettings->SpamAssassinPort;
$SpamAssassinMergeScore = $antiSpamSettings->SpamAssassinMergeScore;
$SpamAssassinScore = $antiSpamSettings->SpamAssassinScore;
$usespf = $antiSpamSettings->UseSPF;
$usespfscore = $antiSpamSettings->UseSPFScore;
$usemxchecks = $antiSpamSettings->UseMXChecks;
$usemxchecksscore = $antiSpamSettings->UseMXChecksScore;
$checkhostinhelo = $antiSpamSettings->CheckHostInHelo;
$checkhostinheloscore = $antiSpamSettings->CheckHostInHeloScore;
Example #11
0
<?php

if (!defined('IN_WEBADMIN')) {
    exit;
}
if (hmailGetAdminLevel() != 2) {
    hmailHackingAttemp();
}
$obSettings = $obBaseApp->Settings();
$action = hmailGetVar("action", "");
if ($action == "save") {
    $obSettings->SslCipherList = hmailGetVar("SslCipherList", "");
}
$SslCipherList = $obSettings->SslCipherList;
?>

<h1><?php 
EchoTranslation("Security");
?>
</h1>

<form action="index.php" method="post" onSubmit="return formCheck(this);">
   <?php 
PrintHidden("page", "security");
PrintHidden("action", "save");
?>
   
   
   <div class="tabber">
      <div class="tabbertab">
         <h2><?php 
$SignatureMethod = hmailGetVar("SignatureMethod", "1");
$AddSignaturesToLocalMail = hmailGetVar("AddSignaturesToLocalMail", "0");
$AddSignaturesToReplies = hmailGetVar("AddSignaturesToReplies", "0");
$MaxAccountSize = hmailGetVar("MaxAccountSize", "0");
$MaxNumberOfAccounts = hmailGetVar("MaxNumberOfAccounts", "0");
$MaxNumberOfAliases = hmailGetVar("MaxNumberOfAliases", "0");
$MaxNumberOfDistributionLists = hmailGetVar("MaxNumberOfDistributionLists", "0");
$MaxNumberOfAccountsEnabled = hmailGetVar("MaxNumberOfAccountsEnabled", "0");
$MaxNumberOfAliasesEnabled = hmailGetVar("MaxNumberOfAliasesEnabled", "0");
$MaxNumberOfDistributionListsEnabled = hmailGetVar("MaxNumberOfDistributionListsEnabled", "0");
$DKIMSignEnabled = hmailGetVar("DKIMSignEnabled", "0");
$DKIMPrivateKeyFile = hmailGetVar("DKIMPrivateKeyFile", "");
$DKIMSelector = hmailGetVar("DKIMSelector", "");
$DKIMHeaderCanonicalizationMethod = hmailGetVar("DKIMHeaderCanonicalizationMethod", "2");
$DKIMBodyCanonicalizationMethod = hmailGetVar("DKIMBodyCanonicalizationMethod", "2");
$DKIMSigningAlgorithm = hmailGetVar("DKIMSigningAlgorithm", "2");
if ($domainactive == "") {
    $domainactive = 0;
}
if (hmailGetAdminLevel() == 1 && ($domainid != hmailGetDomainID() || $action != "edit")) {
    hmailHackingAttemp();
}
// Domain admin but not for this domain.
if ($action == "edit") {
    $obDomain = $obBaseApp->Domains->ItemByDBID($domainid);
} elseif ($action == "add") {
    $obDomain = $obBaseApp->Domains->Add();
} elseif ($action == "delete") {
    $obDomain = $obBaseApp->Domains->ItemByDBID($domainid);
    $obDomain->Delete();
    header("Location: index.php?page=domains");
}
$DaysToKeepMessages = hmailGetVar("DaysToKeepMessages", 0);
$DaysToKeepMessagesValue = hmailGetVar("DaysToKeepMessagesValue", 0);
$obFA->Enabled = hmailGetVar("Enabled", 0);
$obFA->Name = hmailGetVar("Name", 0);
$obFA->MinutesBetweenFetch = hmailGetVar("MinutesBetweenFetch", 0);
$obFA->Port = hmailGetVar("Port", 0);
$obFA->ProcessMIMERecipients = hmailGetVar("ProcessMIMERecipients", 0);
$obFA->ProcessMIMEDate = hmailGetVar("ProcessMIMEDate", 0);
$obFA->ServerAddress = hmailGetVar("ServerAddress", 0);
$obFA->ServerType = hmailGetVar("ServerType", 0);
$obFA->Username = hmailGetVar("Username", 0);
$obFA->UseAntiVirus = hmailGetVar("UseAntiVirus", 0);
$obFA->UseAntiSpam = hmailGetVar("UseAntiSpam", 0);
$obFA->EnableRouteRecipients = hmailGetVar("EnableRouteRecipients", 0);
$obFA->ConnectionSecurity = hmailGetVar("ConnectionSecurity", 0);
if (strlen($DaysToKeepMessages) > 0 && $DaysToKeepMessages <= 0) {
    $obFA->DaysToKeepMessages = $DaysToKeepMessages;
} else {
    $obFA->DaysToKeepMessages = $DaysToKeepMessagesValue;
}
$Password = hmailGetVar("Password", 0);
if (strlen($Password) > 0) {
    $obFA->Password = $Password;
}
$obFA->Save();
$faid = $obFA->ID;
header("Location: index.php?page=account_externalaccount&action=edit&domainid={$domainid}&accountid={$accountid}&faid={$faid}");
?>

Example #14
0
<?php

if (!defined('IN_WEBADMIN')) {
    exit;
}
$domainid = hmailGetVar("domainid", 0);
$aliasid = hmailGetVar("aliasid", 0);
$action = hmailGetVar("action", "");
$error_message = hmailGetVar("error_message", "");
if (hmailGetAdminLevel() == 0) {
    hmailHackingAttemp();
}
if (hmailGetAdminLevel() == 1 && $domainid != hmailGetDomainID()) {
    hmailHackingAttemp();
}
// Domain admin but not for this domain.
$obDomain = $obBaseApp->Domains->ItemByDBID($domainid);
$aliasname = "";
$aliasvalue = "";
$aliasactive = 0;
if ($action == "edit") {
    $obAlias = $obDomain->Aliases->ItemByDBID($aliasid);
    $aliasname = $obAlias->Name;
    $aliasvalue = $obAlias->Value;
    $aliasactive = $obAlias->Active;
    $aliasname = substr($aliasname, 0, strpos($aliasname, "@"));
}
$domainname = $obDomain->Name;
$aliasactivechecked = hmailCheckedIf1($aliasactive);
?>
<?php

if (!defined('IN_WEBADMIN')) {
    exit;
}
if (hmailGetAdminLevel() != ADMIN_SERVER) {
    hmailHackingAttemp();
}
// The user is not server administrator.
$action = hmailGetVar("action", "");
$id = hmailGetVar("id", 0);
$Name = hmailGetVar("Name", 0);
$CertificateFile = hmailGetVar("CertificateFile", "");
$PrivateKeyFile = hmailGetVar("PrivateKeyFile", "");
$sslCertificates = $obBaseApp->Settings->SSLCertificates;
if ($action == "edit") {
    $sslCertificate = $sslCertificates->ItemByDBID($id);
} elseif ($action == "add") {
    $sslCertificate = $sslCertificates->Add();
} elseif ($action == "delete") {
    $sslCertificates->DeleteByDBID($id);
    header("Location: index.php?page=sslcertificates");
}
// Save the changes
$sslCertificate->Name = $Name;
$sslCertificate->CertificateFile = $CertificateFile;
$sslCertificate->PrivateKeyFile = $PrivateKeyFile;
$sslCertificate->Save();
header("Location: index.php?page=sslcertificates");
?>
Example #16
0
<?php

if (!defined('IN_WEBADMIN')) {
    exit;
}
$action = hmailGetVar("action", "");
$domainid = hmailGetVar("domainid", 0);
$accountid = hmailGetVar("accountid", 0);
$ruleid = hmailGetVar("ruleid", 0);
$actionid = hmailGetVar("actionid", 0);
if (!GetHasRuleAccess($domainid, $accountid)) {
    hmailHackingAttemp();
}
// The user is not server administrator
include "include/rule_strings.php";
if ($domainid == 0) {
    $rule = $obBaseApp->Rules->ItemByDBID($ruleid);
} else {
    $rule = $obBaseApp->Domains->ItemByDBID($domainid)->Accounts->ItemByDBID($accountid)->Rules->ItemByDBID($ruleid);
}
if ($action == "edit") {
    $ruleAction = $rule->Actions->ItemByDBID($actionid);
    $To = $ruleAction->To;
    $IMAPFolder = $ruleAction->IMAPFolder;
    $ScriptFunction = $ruleAction->ScriptFunction;
    $FromName = $ruleAction->FromName;
    $FromAddress = $ruleAction->FromAddress;
    $Subject = $ruleAction->Subject;
    $Body = $ruleAction->Body;
    $HeaderName = $ruleAction->HeaderName;
    $Value = $ruleAction->Value;
Example #17
0
<?php

if (!defined('IN_WEBADMIN')) {
    exit;
}
$action = hmailGetVar("action", "");
$domainid = hmailGetVar("domainid", 0);
$accountid = hmailGetVar("accountid", 0);
$ruleid = hmailGetVar("ruleid", 0);
// check permissions
if (!GetHasRuleAccess($domainid, $accountid)) {
    hmailHackingAttemp();
}
// The user has no rule editing permissions.
include "include/rule_strings.php";
if ($ruleid != 0) {
    if ($domainid != 0) {
        $domain = $obBaseApp->Domains->ItemByDBID($domainid);
        $account = $domain->Accounts->ItemByDBID($accountid);
        $rule = $account->Rules->ItemByDBID($ruleid);
    } else {
        $rule = $obBaseApp->Rules->ItemByDBID($ruleid);
    }
    $Name = $rule->Name;
    $Active = $rule->Active;
    $UseAND = $rule->UseAND;
} else {
    $Name = "";
    $Active = 0;
    $UseAND = 1;
}
Example #18
0
if (!defined('IN_WEBADMIN')) {
    exit;
}
if (hmailGetAdminLevel() != 2) {
    hmailHackingAttemp();
}
$obSettings = $obBaseApp->Settings();
$action = hmailGetVar("action", "");
if ($action == "save") {
    $obSettings->VerifyRemoteSslCertificate = hmailGetVar("VerifyRemoteSslCertificate", 0);
    $obSettings->SslCipherList = hmailGetVar("SslCipherList", "");
    $obSettings->SslVersion30Enabled = hmailGetVar("SslVersion30Enabled", 0);
    $obSettings->TlsVersion10Enabled = hmailGetVar("TlsVersion10Enabled", 0);
    $obSettings->TlsVersion11Enabled = hmailGetVar("TlsVersion11Enabled", 0);
    $obSettings->TlsVersion12Enabled = hmailGetVar("TlsVersion12Enabled", 0);
}
$VerifyRemoteSslCertificate = $obSettings->VerifyRemoteSslCertificate;
$SslCipherList = $obSettings->SslCipherList;
$SslVersion30Enabled = $obSettings->SslVersion30Enabled;
$TlsVersion10Enabled = $obSettings->TlsVersion10Enabled;
$TlsVersion11Enabled = $obSettings->TlsVersion11Enabled;
$TlsVersion12Enabled = $obSettings->TlsVersion12Enabled;
?>

<h1><?php 
EchoTranslation("Security");
?>
</h1>

<form action="index.php" method="post" onSubmit="return formCheck(this);">
$routedomainname = hmailGetVar("routedomainname", "");
$routetargetsmtphost = hmailGetVar("routetargetsmtphost", "0");
$routetargetsmtpport = hmailGetVar("routetargetsmtpport", "0");
$TreatSenderAsLocalDomain = hmailGetVar("TreatSenderAsLocalDomain", "0");
$TreatRecipientAsLocalDomain = hmailGetVar("TreatRecipientAsLocalDomain", "0");
$routenumberoftries = hmailGetVar("routenumberoftries", "0");
$routemminutesbetweentry = hmailGetVar("routemminutesbetweentry", "0");
$routerequiresauth = hmailGetVar("routerequiresauth", "0");
$routeauthusername = hmailGetVar("routeauthusername", "0");
$routeauthpassword = hmailGetVar("routeauthpassword", "0");
$ConnectionSecurity = hmailGetVar("ConnectionSecurity", "0");
$obRoute->DomainName = $routedomainname;
$obRoute->TargetSMTPHost = $routetargetsmtphost;
$obRoute->TargetSMTPPort = $routetargetsmtpport;
$obRoute->TreatSenderAsLocalDomain = $TreatSenderAsLocalDomain;
$obRoute->TreatRecipientAsLocalDomain = $TreatRecipientAsLocalDomain;
$obRoute->NumberOfTries = $routenumberoftries;
$obRoute->MinutesBetweenTry = $routemminutesbetweentry;
$obRoute->RelayerRequiresAuth = $routerequiresauth;
$obRoute->RelayerAuthUsername = $routeauthusername;
$obRoute->AllAddresses = hmailGetVar("AllAddresses", "0");
$obRoute->ConnectionSecurity = $ConnectionSecurity;
if ($routeauthpassword != "") {
    $obRoute->SetRelayerAuthPassword($routeauthpassword);
}
$obRoute->Save();
$routeid = $obRoute->ID;
header("Location: index.php?page=route&action=edit&routeid={$routeid}");
?>

if (!defined('IN_WEBADMIN')) {
    exit;
}
if (hmailGetAdminLevel() != ADMIN_SERVER) {
    hmailHackingAttemp();
}
// The user is not server administrator.
$action = hmailGetVar("action", "");
$relayid = hmailGetVar("relayid", 0);
if ($action == "edit") {
    $obIncomingRelay = $obBaseApp->Settings->IncomingRelays->ItemByDBID($relayid);
} elseif ($action == "add") {
    $obIncomingRelay = $obBaseApp->Settings->IncomingRelays->Add();
} elseif ($action == "delete") {
    $obBaseApp->Settings->IncomingRelays->DeleteByDBID($relayid);
    header("Location: index.php?page=incomingrelays");
}
// Fetch form
$relayname = hmailGetVar("relayname", "0");
$relaylowerip = hmailGetVar("relaylowerip", "0");
$relayupperip = hmailGetVar("relayupperip", "0");
// Save the changes
$obIncomingRelay->Name = $relayname;
$obIncomingRelay->LowerIP = $relaylowerip;
$obIncomingRelay->UpperIP = $relayupperip;
$obIncomingRelay->Save();
$relayid = $obIncomingRelay->ID;
header("Location: index.php?page=incomingrelay&action=edit&relayid={$relayid}");
?>

<?php

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");
}
// Save the changes
$surblServer->Active = $Active;
$surblServer->DNSHost = $DNSHost;
$surblServer->RejectMessage = $RejectMessage;
$surblServer->Score = $Score;
$surblServer->Save();
header("Location: index.php?page=surblservers");
        exit;
    }
}
if ($action == "edit") {
    $obAlias = $obDomain->Aliases->ItemByDBID($aliasid);
} elseif ($action == "add") {
    $obAlias = $obDomain->Aliases->Add();
} elseif ($action == "delete") {
    $obDomain->Aliases->DeleteByDBID($aliasid);
    header("Location: index.php?page=aliases&domainid={$domainid}");
    exit;
}
$domainname = $obDomain->Name;
$aliasname = hmailGetVar("aliasname", "");
$aliasvalue = hmailGetVar("aliasvalue", "");
$aliasactive = hmailGetVar("aliasactive", "0");
$obAlias->Name = $aliasname . "@" . $domainname;
$obAlias->Value = $aliasvalue;
$obAlias->Active = $aliasactive;
$obAlias->Save();
$aliasid = $obAlias->ID;
header("Location: index.php?page=alias&action=edit&domainid={$domainid}&aliasid={$aliasid}");
function IsAddAllowed($obDomain)
{
    if (!$obDomain->MaxNumberOfAliasesEnabled) {
        return 0;
    }
    if ($obDomain->Aliases->Count >= $obDomain->MaxNumberOfAliases) {
        return STR_ALIAS_COULD_NOT_BE_ADDED_MAX_REACHED;
    }
    return 0;
Example #23
0
<?php

if (!defined('IN_WEBADMIN')) {
    exit;
}
if (hmailGetAdminLevel() != 2) {
    hmailHackingAttemp();
}
$obSettings = $obBaseApp->Settings();
$action = hmailGetVar("action", "");
if ($action == "save") {
    $obSettings->MirrorEMailAddress = hmailGetVar("mirroremailaddress", 0);
}
$mirroremailaddress = $obSettings->MirrorEMailAddress;
?>

<h1><?php 
EchoTranslation("Mirror");
?>
</h1>

<form action="index.php" method="post" onSubmit="return formCheck(this);">
   <?php 
PrintHidden("page", "mirror");
PrintHidden("action", "save");
?>
   
   
   <div class="tabber">
      <div class="tabbertab">
         <h2><?php 
Example #24
0
<?php

if (!defined('IN_WEBADMIN')) {
    exit;
}
if (hmailGetAdminLevel() != ADMIN_SERVER) {
    hmailHackingAttemp();
}
$obSettings = $obBaseApp->Settings();
$action = hmailGetVar("action", "");
if ($action == "save") {
    $obSettings->AutoBanOnLogonFailure = hmailGetVar("AutoBanOnLogonFailure", 0);
    $obSettings->MaxInvalidLogonAttempts = hmailGetVar("MaxInvalidLogonAttempts", 0);
    $obSettings->MaxInvalidLogonAttemptsWithin = hmailGetVar("MaxInvalidLogonAttemptsWithin", 0);
    $obSettings->AutoBanMinutes = hmailGetVar("AutoBanMinutes", 0);
}
$AutoBanOnLogonFailure = $obSettings->AutoBanOnLogonFailure;
$MaxInvalidLogonAttempts = $obSettings->MaxInvalidLogonAttempts;
$MaxInvalidLogonAttemptsWithin = $obSettings->MaxInvalidLogonAttemptsWithin;
$AutoBanMinutes = $obSettings->AutoBanMinutes;
?>

<h1><?php 
EchoTranslation("Auto-ban");
?>
</h1>

<form action="index.php" method="post" onSubmit="return formCheck(this);">
   <?php 
PrintHidden("page", "autoban");
PrintHidden("action", "save");
function GetStringForDomain($obDomain, $parentid)
{
    global $dtree, $dtitem, $domain_root;
    $current_domainid = hmailGetVar("domainid", 0);
    $current_accountid = hmailGetVar("accountid", 0);
    $domainname = $obDomain->Name;
    $domainname = PreprocessOutput($domainname);
    $domainname = str_replace("'", "\\'", $domainname);
    $dtree .= "d.add({$domain_root},{$parentid},'" . $domainname . "','index.php?page=domain&action=edit&domainid=" . $obDomain->ID . "','','','" . "images/server.png','" . "images/server.png');\r\n";
    if ($current_domainid != $obDomain->ID && hmailGetAdminLevel() == ADMIN_SERVER) {
        // If the user is logged on as a system administrator, only show accounts
        // for the currently selected domain.
        return;
    }
    $obAccounts = $obDomain->Accounts();
    $AccountsCount = $obAccounts->Count();
    $accounts_root = $dtitem++;
    $dtree .= "d.add({$accounts_root},{$domain_root},'" . GetStringForJavaScript("Accounts") . " ({$AccountsCount})','index.php?page=accounts&domainid=" . $obDomain->ID . "','','','" . "images/folder.png','" . "images/folder.png');\r\n";
    for ($j = 0; $j < $AccountsCount; $j++) {
        $obAccount = $obAccounts->Item($j);
        $accountaddress = $obAccount->Address;
        $accountaddress = PreprocessOutput($accountaddress);
        $accountaddress = str_replace("'", "\\'", $accountaddress);
        $accountid = $obAccount->ID;
        $di = $dtitem++;
        $url = htmlentities("index.php?page=account&action=edit&accountid=" . $accountid . "&domainid=" . $obDomain->ID);
        $dtree .= "d.add({$di},{$accounts_root},'" . $accountaddress . "','{$url}','','','" . "images/user.png','" . "images/user.png');\r\n";
        // Only show sub-nodes for the currently selected account.
        if ($current_accountid == $accountid) {
            $dtree .= "d.add(" . $dtitem++ . ",{$di},'" . GetStringForJavaScript("External accounts") . "','index.php?page=account_externalaccounts&accountid=" . $accountid . "&domainid=" . $obDomain->ID . "');\r\n";
        }
    }
    $obAliases = $obDomain->Aliases();
    $AliasesCount = $obAliases->Count();
    $aliases_root = $dtitem++;
    $dtree .= "d.add({$aliases_root},{$domain_root},'" . GetStringForJavaScript("Aliases") . " ({$AliasesCount})','index.php?page=aliases&domainid=" . $obDomain->ID . "','','','" . "images/folder.png','" . "images/folder.png');\r\n";
    for ($j = 0; $j < $AliasesCount; $j++) {
        $obAlias = $obAliases->Item($j);
        $aliasname = $obAlias->Name;
        $aliasname = PreprocessOutput($aliasname);
        $aliasname = str_replace("'", "\\'", $aliasname);
        $di = $dtitem++;
        $dtree .= "d.add({$di},{$aliases_root},'" . $aliasname . "','index.php?page=alias&action=edit&aliasid=" . $obAlias->ID . "&domainid=" . $obDomain->ID . "','','','" . "images/arrow_switch.png','" . "images/arrow_switch.png');\r\n";
    }
    $obDistributionLists = $obDomain->DistributionLists();
    $DListCount = $obDistributionLists->Count();
    $dlist_root = $dtitem++;
    $dtree .= "d.add({$dlist_root},{$domain_root},'" . GetStringForJavaScript("Distribution lists") . " ({$DListCount})','index.php?page=distributionlists&domainid=" . $obDomain->ID . "','','','" . "images/folder.png','" . "images/folder.png');\r\n";
    for ($j = 0; $j < $DListCount; $j++) {
        $obDistributionList = $obDistributionLists->Item($j);
        $di = $dtitem++;
        $address = PreprocessOutput($obDistributionList->Address);
        $address = str_replace("'", "\\'", $address);
        $dtree .= "d.add({$di},{$dlist_root},'" . $address . "','index.php?page=distributionlist&action=edit&distributionlistid=" . $obDistributionList->ID . "&domainid=" . $obDomain->ID . "','','','" . "images/arrow_out.png','" . "images/arrow_out.png');\r\n";
        $dtree .= "d.add(" . $dtitem++ . ",{$di},'" . GetStringForJavaScript("Members") . " (" . $obDistributionList->Recipients->Count() . ")','index.php?page=distributionlist_recipients&distributionlistid=" . $obDistributionList->ID . "&domainid=" . $obDomain->ID . "');\r\n";
    }
}
Example #26
0
if (!defined('IN_WEBADMIN')) {
    exit;
}
if (hmailGetAdminLevel() != 2) {
    hmailHackingAttemp();
}
$obSettings = $obBaseApp->Settings();
$obBackup = $obSettings->Backup();
$action = hmailGetVar("action", "");
if ($action == "save") {
    $obBackup->Destination = hmailGetVar("backupdestination", 0);
    $obBackup->BackupSettings = hmailGetVar("backupsettings", 0);
    $obBackup->BackupDomains = hmailGetVar("backupdomains", 0);
    $obBackup->BackupMessages = hmailGetVar("backupmessages", 0);
    $obBackup->CompressDestinationFiles = hmailGetVar("backupcompress", 0);
} elseif ($action == "startbackup") {
    $obBaseApp->BackupManager->StartBackup();
}
$backupdestination = $obBackup->Destination;
$backupsettings = $obBackup->BackupSettings;
$backupdomains = $obBackup->BackupDomains;
$backupmessages = $obBackup->BackupMessages;
$backupcompress = $obBackup->CompressDestinationFiles;
$backupsettingschecked = hmailCheckedIf1($backupsettings);
$backupdomainschecked = hmailCheckedIf1($backupdomains);
$backupmessageschecked = hmailCheckedIf1($backupmessages);
$backupcompresschecked = hmailCheckedIf1($backupcompress);
?>

<h1><?php 
Example #27
0
<?php

if (!defined('IN_WEBADMIN')) {
    exit;
}
?>

<h1><?php 
EchoTranslation("Accounts");
?>
</h1>

<?php 
$domainid = hmailGetVar("domainid", null);
if (hmailGetAdminLevel() == 0) {
    hmailHackingAttemp();
}
// Users are not allowed to show this page.
if (hmailGetAdminLevel() == 1 && $domainid != hmailGetDomainID()) {
    hmailHackingAttemp();
}
// Domain admin but not for this domain.
echo '<table border="0" width="100%" cellpadding="5">';
$bgcolor = "#EEEEEE";
$obDomain = $obBaseApp->Domains->ItemByDBID($domainid);
$obAccounts = $obDomain->Accounts();
$Count = $obAccounts->Count();
$str_delete = $obLanguage->String("Remove");
$currentaccountid = hmailGetAccountID();
$str_accountaddress = $obLanguage->String("Address");
$str_maxsizemb = $obLanguage->String("Maximum size (MB)");
Example #28
0
}
define("STSMTP", 1);
define("STPOP3", 3);
define("STIMAP", 5);
$obStatus = $obBaseApp->Status();
$serverstate = $obBaseApp->ServerState();
$action = hmailGetVar("action", "");
$statusstarttime = $obStatus->StartTime();
$statusprocessedmessages = $obStatus->ProcessedMessages();
$statusmessageswithvirus = $obStatus->RemovedViruses();
$statusmessageswithspam = $obStatus->RemovedSpamMessages();
$sessions_smtp = $obStatus->SessionCount(STSMTP);
$sessions_pop3 = $obStatus->SessionCount(STPOP3);
$sessions_imap = $obStatus->SessionCount(STIMAP);
if ($action == "control") {
    $controlaction = hmailGetVar("controlaction", "");
    if ($controlaction == "1") {
        $obBaseApp->Start();
    } else {
        if ($controlaction == "0") {
            $obBaseApp->Stop();
        }
    }
}
switch ($serverstate) {
    case 1:
        $state = $obLanguage->String("Stopped");
        break;
    case 2:
        $state = $obLanguage->String("Starting");
        break;
Example #29
0
<?php

if (!defined('IN_WEBADMIN')) {
    exit;
}
if (hmailGetAdminLevel() != 2) {
    hmailHackingAttemp();
}
// Domain admin but not for this domain.
$routeid = hmailGetVar("routeid", 0);
$action = hmailGetVar("action", "");
$obRoutes = $obSettings->Routes();
$routetargetsmtpport = 25;
$routenumberoftries = 4;
$routemminutesbetweentry = 60;
$routedomainname = "";
$routetargetsmtphost = "";
$TreatRecipientAsLocalDomain = 0;
$TreatSenderAsLocalDomain = 0;
$ConnectionSecurity = 0;
$routerequiresauth = 0;
$routeauthusername = "";
$AllAddresses = true;
if ($action == "edit") {
    $obRoute = $obRoutes->ItemByDBID($routeid);
    $routedomainname = $obRoute->DomainName;
    $routetargetsmtphost = $obRoute->TargetSMTPHost;
    $routetargetsmtpport = $obRoute->TargetSMTPPort;
    $TreatRecipientAsLocalDomain = $obRoute->TreatRecipientAsLocalDomain;
    $TreatSenderAsLocalDomain = $obRoute->TreatSenderAsLocalDomain;
    $routenumberoftries = $obRoute->NumberOfTries;
Example #30
0
if (hmailGetAdminLevel() != 2) {
    hmailHackingAttemp();
}
$obSettings = $obBaseApp->Settings();
$obLogging = $obSettings->Logging();
$action = hmailGetVar("action", "");
if ($action == "save") {
    $obLogging->Enabled = hmailGetVar("logenabled", 0);
    $obLogging->LogApplication = hmailGetVar("logapplication", 0);
    $obLogging->LogSMTP = hmailGetVar("logsmtp", 0);
    $obLogging->LogPOP3 = hmailGetVar("logpop3", 0);
    $obLogging->LogIMAP = hmailGetVar("logimap", 0);
    $obLogging->LogTCPIP = hmailGetVar("logtcpip", 0);
    $obLogging->LogDebug = hmailGetVar("logdebug", 0);
    $obLogging->AwstatsEnabled = hmailGetVar("logawstats", 0);
    $obLogging->KeepFilesOpen = hmailGetVar("KeepFilesOpen", 0);
}
$logenabled = $obLogging->Enabled;
$logapplication = $obLogging->LogApplication;
$logsmtp = $obLogging->LogSMTP;
$logpop3 = $obLogging->LogPOP3;
$logimap = $obLogging->LogIMAP;
$logtcpip = $obLogging->LogTCPIP;
$logdebug = $obLogging->LogDebug;
$logawstats = $obLogging->AwstatsEnabled;
$KeepFilesOpen = $obLogging->KeepFilesOpen;
?>

<h1><?php 
EchoTranslation("Logging");
?>