This commit has been accessed 1,031 times via Git panel.
commit f947ab8870c1ea4fdc1e9e8dbdea46289c4d9768
tree a7684d984dee1196a2eb46ebb4f4afb0bc8e6d07
parent 93233e52d8b3dabb731c7ec2e6fba005f859c7ae
author Engels Antonio <engels@kartero.org> 1442508014 +0800
committer Engels Antonio <engels@kartero.org> 1442508014 +0800
Version 2.0 release (Phoenix)
diff --git a/core.js b/core.js
index 8e53ff4..02c5cfa 100644
--- a/core.js
+++ b/core.js
@@ -1007,20 +1007,20 @@ function eval(a) {
}
if (b.score < 3) {
document.getElementById("mtr").style.color = "#ff6666";
- document.getElementById("mtr").style.border = "#ff6666 solid 1px";
+ document.getElementById("mtr").style.border = "#ff6666 solid 0.063em";
document.getElementById("mtr").style.background = "#ffbbbb";
- document.getElementById("mtr").style.boxShadow = "inset 0 0 3px #ff6666, 0 0 1px #777";
- document.getElementById("mtr").style.MozBoxShadow = "inset 0 0 3px #ff6666, 0 0 1px #777";
- document.getElementById("mtr").style.KhtmlBoxShadow = "inset 0 0 3px #ff6666, 0 0 1px #777";
- document.getElementById("mtr").style.WebkitBoxShadow = "inset 0 0 3px #ff6666, 0 0 1px #777"
+ document.getElementById("mtr").style.boxShadow = "inset 0 0 0.188em #ff6666, 0 0 0.063em #777";
+ document.getElementById("mtr").style.MozBoxShadow = "inset 0 0 0.188em #ff6666, 0 0 0.063em #777";
+ document.getElementById("mtr").style.KhtmlBoxShadow = "inset 0 0 0.188em #ff6666, 0 0 0.063em #777";
+ document.getElementById("mtr").style.WebkitBoxShadow = "inset 0 0 0.188em #ff6666, 0 0 0.063em #777"
} else {
document.getElementById("mtr").style.color = "#74ae0b";
- document.getElementById("mtr").style.border = "#74ae0b solid 1px";
+ document.getElementById("mtr").style.border = "#74ae0b solid 0.063em";
document.getElementById("mtr").style.background = "#cde2a7";
- document.getElementById("mtr").style.boxShadow = "inset 0 0 2px #74ae0b, 0 0 1px #777";
- document.getElementById("mtr").style.MozBoxShadow = "inset 0 0 2px #74ae0b, 0 0 1px #777";
- document.getElementById("mtr").style.KhtmlBoxShadow = "inset 0 0 2px #74ae0b, 0 0 1px #777";
- document.getElementById("mtr").style.WebkitBoxShadow = "inset 0 0 2px #74ae0b, 0 0 1px #777"
+ document.getElementById("mtr").style.boxShadow = "inset 0 0 0.125em #74ae0b, 0 0 0.063em #777";
+ document.getElementById("mtr").style.MozBoxShadow = "inset 0 0 0.125em #74ae0b, 0 0 0.063em #777";
+ document.getElementById("mtr").style.KhtmlBoxShadow = "inset 0 0 0.125em #74ae0b, 0 0 0.063em #777";
+ document.getElementById("mtr").style.WebkitBoxShadow = "inset 0 0 0.125em #74ae0b, 0 0 0.063em #777"
}
}
diff --git a/core.php b/core.php
index e87e511..977f22a 100644
--- a/core.php
+++ b/core.php
@@ -636,4 +636,86 @@ function pass2_process($mbox, $msgno, $path) {
}
}
+function kartero_smime_verify($e) {
+ $t = tempnam(sys_get_temp_dir(), 'KSV');
+ file_put_contents($t, $e);
+ $r = openssl_pkcs7_verify($t, PKCS7_NOVERIFY);
+ if ($r === true) {
+ echo '<font color="green">TRUE</font>';
+ } elseif ($r == -1) {
+ echo '<font color="orange">ERROR</font>';
+ } else {
+ echo '<font color="red">FALSE</font>';
+ }
+ unlink($t);
+}
+
+function kartero_smime_sign($user, $name, $from, $body, $home, $days = 365) {
+
+ preg_match('/^--.*\n?/m', $body, $matches);
+
+ if (count($matches) > 0) {
+ $body = 'Content-Type: multipart/mixed; boundary="' . trim(substr($matches[0], 2)) . "\"\n" . $body;
+ }
+ else {
+ $body = "Content-Type: text/plain\n\n$body";
+ }
+
+ $body = str_replace("\r", '', $body);
+
+ $name = trim($name);
+ $user = trim(strtolower($user));
+ $from = trim(strtolower($from));
+ $home = trim(strtolower($home));
+
+ $u = explode('@', $user);
+ $n = $u[0];
+ $d = $u[1];
+ $h = "$home/$d/{$n[0]}/$n/smime";
+
+ $key_file = "$h/$from.sign.key";
+ $crt_file = "$h/$from.sign.crt";
+
+ $msg_file = tempnam(sys_get_temp_dir(), 'MSG');
+ file_put_contents($msg_file, $body);
+
+ if (file_exists($key_file) and (filemtime($key_file) < (time() - ($days * 86400)))) {
+ unlink($key_file);
+ }
+
+ if (file_exists($crt_file) and (filemtime($crt_file) < (time() - ($days * 86400)))) {
+ unlink($crt_file);
+ }
+
+ if (file_exists($key_file) and file_exists($crt_file)) {
+ $key = file_get_contents($key_file);
+ $crt = file_get_contents($crt_file);
+ } else {
+ $req_key = openssl_pkey_new(array('digest_alg' => 'sha512', 'private_key_bits' => 4096, 'private_key_type' => OPENSSL_KEYTYPE_RSA));
+ $req_csr = openssl_csr_new(array('countryName' => 'PH', 'stateOrProvinceName' => 'NCR', 'localityName' => 'QC', 'organizationName' => 'kartero.org', 'organizationalUnitName' => explode('@', $from)[1], 'commonName' => $name, 'emailAddress' => $from), $req_key);
+ $req_crt = openssl_csr_sign($req_csr, NULL, $req_key, $days);
+
+ openssl_pkey_export($req_key, $key);
+ openssl_x509_export($req_crt, $crt);
+
+ if (!file_exists($h)) {
+ mkdir($h, 0700, 1);
+ }
+
+ file_put_contents($key_file, $key);
+ file_put_contents($crt_file, $crt);
+ }
+
+ $sig_file = tempnam(sys_get_temp_dir(), 'SIG');
+
+ if (openssl_pkcs7_sign($msg_file, $sig_file, $crt, $key, array(), PKCS7_DETACHED)) {
+ if (openssl_pkcs7_verify($sig_file, PKCS7_NOVERIFY)) {
+ return explode("\n\n", file_get_contents($sig_file), 2);
+ }
+ }
+
+ unlink($msg_file);
+ unlink($sig_file);
+}
+
?>
diff --git a/css.php b/css.php
index d4d3826..ce1d410 100644
--- a/css.php
+++ b/css.php
@@ -5,11 +5,18 @@
body {
color: #666666;
- background: #ffffff;
- font-size: 0.75em;
+ background: #ffffff !important;
+ font-size: 12px;
+ font-size: 0.75rem;
font-family: arial,helvetica,sans-serif;
- margin-right: 20px;
- margin-left: 20px;
+ margin-right: 20px !important;
+ margin-right: 1.25rem !important;
+ margin-left: 20px !important;
+ margin-left: 1.25rem !important;
+ margin-top: 10px !important;
+ margin-top: 0.625rem !important;
+ margin-bottom: 10px !important;
+ margin-bottom: 0.625rem !important;
}
a,a:link,a:visited,a:hover,a:active {
@@ -23,6 +30,7 @@ a,a:link,a:visited,a:hover,a:active {
color: #666666;
background: #ffffff;
border: #999999 solid 1px;
+ border: #999999 solid 0.063rem;
width: 100%;
box-sizing: border-box;
-moz-box-sizing: border-box;
@@ -31,9 +39,13 @@ a,a:link,a:visited,a:hover,a:active {
.input {
box-shadow: inset 0 0 2px #dedede;
+ box-shadow: inset 0 0 0.125rem #dedede;
-moz-box-shadow: inset 0 0 2px #dedede;
+ -moz-box-shadow: inset 0 0 0.125rem #dedede;
-webkit-box-shadow: inset 0 0 2px #dedede;
+ -webkit-box-shadow: inset 0 0 0.125rem #dedede;
-khtml-box-shadow: inset 0 0 2px #dedede;
+ -khtml-box-shadow: inset 0 0 0.125rem #dedede;
}
.input:focus {
@@ -44,11 +56,14 @@ a,a:link,a:visited,a:hover,a:active {
color: #74ae0b;
background: #cde2a7;
border: #74ae0b solid 1px;
+ border: #74ae0b solid 0.063rem;
font-weight: bold;
font-family: arial,helvetica,sans-serif;
text-align: center;
- padding: 0px 10px 0px 10px;
- margin: 0px 0px 5px 0px;
+ padding: 0 10px 0 10px;
+ padding: 0 0.625rem 0 0.625rem;
+ margin: 0 0 5px 0;
+ margin: 0 0 0.313rem 0;
moz-opacity: 0.9;
filter: alpha(opacity=90);
opacity: 0.9;
@@ -58,11 +73,14 @@ a,a:link,a:visited,a:hover,a:active {
color: #ff6666;
background: #ffbbbb;
border: #ff6666 solid 1px;
+ border: #ff6666 solid 0.063rem;
font-weight: bold;
font-family: arial,helvetica,sans-serif;
text-align: center;
- padding: 0px 10px 0px 10px;
- margin: 0px 0px 5px 0px;
+ padding: 0 10px 0 10px;
+ padding: 0 0.625rem 0 0.625rem;
+ margin: 0 0 5px 0;
+ margin: 0 0 0.313rem 0;
moz-opacity: 0.9;
filter: alpha(opacity=90);
opacity: 0.9;
@@ -72,11 +90,13 @@ a,a:link,a:visited,a:hover,a:active {
color: #f3e533;
background: #fcffcd;
border: #f3e533 solid 1px;
+ border: #f3e533 solid 0.063rem;
font-weight: bold;
font-family: arial,helvetica,sans-serif;
text-align: center;
- padding: 0px 0px 0px 0px;
- margin: 0px 0px 5px 0px;
+ padding: 0;
+ margin: 0 0 5px 0;
+ margin: 0 0 0.313rem 0;
moz-opacity: 0.9;
filter: alpha(opacity=90);
opacity: 0.9;
@@ -84,33 +104,49 @@ a,a:link,a:visited,a:hover,a:active {
.folders {
border: solid 1px #ccc;
+ border: solid 0.063rem #ccc;
padding: 5px;
+ padding: 0.313rem;
box-shadow: 0 0 2px #dedede;
+ box-shadow: 0 0 0.125rem #dedede;
-moz-box-shadow: 0 0 2px #dedede;
+ -moz-box-shadow: 0 0 0.125rem #dedede;
-webkit-box-shadow: 0 0 2px #dedede;
+ -webkit-box-shadow: 0 0 0.125rem #dedede;
-khtml-box-shadow: 0 0 2px #dedede;
+ -khtml-box-shadow: 0 0 0.125rem #dedede;
}
.main {
border: solid 1px #ccc;
+ border: solid 0.063rem #ccc;
padding: 2px;
+ padding: 0.125rem;
box-shadow: 0 0 2px #dedede;
+ box-shadow: 0 0 0.125rem #dedede;
-moz-box-shadow: 0 0 2px #dedede;
+ -moz-box-shadow: 0 0 0.125rem #dedede;
-webkit-box-shadow: 0 0 2px #dedede;
+ -webkit-box-shadow: 0 0 0.125rem #dedede;
-khtml-box-shadow: 0 0 2px #dedede;
+ -khtml-box-shadow: 0 0 0.125rem #dedede;
}
.message {
border: 1px solid #ccc;
+ border: 0.063rem solid #ccc;
padding: 5px;
+ padding: 0.313rem;
}
.spacer {
height: 2px;
+ height: 0.125rem;
}
.login {
width: 300px;
+ width: 18.75rem;
border: none;
margin-top: 10%;
margin-left: auto;
@@ -119,8 +155,10 @@ a,a:link,a:visited,a:hover,a:active {
.label {
width: 40px;
+ width: 2.5rem;
text-align: center;
- font-size: 0.75em;
+ font-size: 9px;
+ font-size: 0.5625rem;
}
.loader {
@@ -135,6 +173,7 @@ a,a:link,a:visited,a:hover,a:active {
0% {
width: 0;
height: 11px;
+ height: 0.688rem;
}
}
@@ -142,12 +181,14 @@ a,a:link,a:visited,a:hover,a:active {
0% {
width: 0;
height: 11px;
+ height: 0.688rem;
}
}
#mtr {
width: 0;
height: 11px;
+ height: 0.688rem;
padding: 0;
margin: 0;
-webkit-animation-name: strength;
@@ -168,3 +209,27 @@ a,a:link,a:visited,a:hover,a:active {
background-image: -o-linear-gradient(bottom, #ffffdd 50%, #ffffcc 100%);
background-image: linear-gradient(bottom, #ffffdd 50%, #ffffcc 100%);
}
+
+.animated {
+ -webkit-animation-duration: 1s;
+ animation-duration: 1s;
+ -webkit-animation-fill-mode: both;
+ animation-fill-mode: both;
+}
+
+@-webkit-keyframes shake {
+ 0%, 100% { -webkit-transform: translateX(0); }
+ 10%, 30%, 50%, 70%, 90% { -webkit-transform: translateX(-10px); }
+ 20%, 40%, 60%, 80% { -webkit-transform: translateX(10px); }
+}
+
+@keyframes shake {
+ 0%, 100% { transform: translateX(0); }
+ 10%, 30%, 50%, 70%, 90% { transform: translateX(-10px); }
+ 20%, 40%, 60%, 80% { transform: translateX(10px); }
+}
+
+.shake {
+ -webkit-animation-name: shake;
+ animation-name: shake;
+}
diff --git a/filedrop.php b/filedrop.php
index e0493d5..881170b 100644
--- a/filedrop.php
+++ b/filedrop.php
@@ -58,8 +58,8 @@ if (file_exists("attach/i/$fileUsr/$filedrop_box")) {
echo "<style>\r\n$css</style>\r\n\r\n";
- // compensate for body { margin-right: 20px; margin-left: 20px; } in css.php
- echo "<style>body { margin-right: 5px; margin-left: 5px; }</style>";
+ // compensate for body { margin-right: 1.25rem; margin-left: 1.25rem; } in css.php
+ echo "<style>body { margin-right: 5px !important; margin-right: 0.313rem !important; margin-left: 5px !important; margin-left: 0.313rem !important; }</style>\r\n\r\n";
}
echo "<table border=\"0\" cellspacing=\"1\" cellpadding=\"2\">";
diff --git a/folders.php b/folders.php
index d0c2507..de1849d 100644
--- a/folders.php
+++ b/folders.php
@@ -19,12 +19,12 @@ if (is_array($quota) and ($quota[limit] > 0)) {
if ($quota_pct > 75) {
$quota_bar_bgcolor = "#ffbbbb";
$quota_bar_border = "#ff6666";
- $quota_bar_shadow = "3px";
+ $quota_bar_shadow = "0.188rem";
}
else {
$quota_bar_bgcolor = "#cde2a7";
$quota_bar_border = "#74ae0b";
- $quota_bar_shadow = "2px";
+ $quota_bar_shadow = "0.125rem";
}
$quota_bar_max = "100";
@@ -33,9 +33,9 @@ if (is_array($quota) and ($quota[limit] > 0)) {
$quota_bar_width = number_format($quota_bar_width, 0);
echo "<style>";
- echo "\r\n@-webkit-keyframes quota { 0% { width: 0; height: 11px; } }";
- echo "\r\n@-moz-keyframes quota { 0% { width: 0; height: 11px; } }";
- echo "\r\n.bar { height: 11px; padding: 0; margin: 0; background: $quota_bar_bgcolor; border: $quota_bar_border solid 1px; -webkit-animation-name: quota; -moz-animation-name: quota; -webkit-animation-duration: 1s; -moz-animation-duration: 1s; -webkit-animation-iteration-count: 1; -moz-animation-iteration-count: 1; -webkit-animation-timing-function: ease; -moz-animation-timing-function: ease; -moz-box-shadow: inset 0 0 $quota_bar_shadow $quota_bar_border, 0 0 1px #777; -webkit-box-shadow: inset 0 0 $quota_bar_shadow $quota_bar_border, 0 0 1px #777; box-shadow: inset 0 0 $quota_bar_shadow $quota_bar_border, 0 0 1px #777; -khtml-box-shadow: inset 0 0 $quota_bar_shadow $quota_bar_border, 0 0 1px #777; }";
+ echo "\r\n@-webkit-keyframes quota { 0% { width: 0; height: 0.688rem; } }";
+ echo "\r\n@-moz-keyframes quota { 0% { width: 0; height: 0.688rem; } }";
+ echo "\r\n.bar { height: 0.688rem; padding: 0; margin: 0; background: $quota_bar_bgcolor; border: $quota_bar_border solid 0.063rem; -webkit-animation-name: quota; -moz-animation-name: quota; -webkit-animation-duration: 1s; -moz-animation-duration: 1s; -webkit-animation-iteration-count: 1; -moz-animation-iteration-count: 1; -webkit-animation-timing-function: ease; -moz-animation-timing-function: ease; -moz-box-shadow: inset 0 0 $quota_bar_shadow $quota_bar_border, 0 0 0.063rem #777; -webkit-box-shadow: inset 0 0 $quota_bar_shadow $quota_bar_border, 0 0 0.063rem #777; box-shadow: inset 0 0 $quota_bar_shadow $quota_bar_border, 0 0 0.063rem #777; -khtml-box-shadow: inset 0 0 $quota_bar_shadow $quota_bar_border, 0 0 0.063rem #777; }";
echo "\r\n</style>";
}
@@ -101,7 +101,7 @@ if (($folder == "Trash") or ($folder == "Spam")) {
echo "</table></div>";
-echo "<div style=\"height: 4px;\"></div>";
+echo "<div style=\"height: 0.250rem;\"></div>";
echo "<div class=\"folders\"><table border=\"0\" cellspacing=\"0\" callpadding=\"0\">";
@@ -113,14 +113,14 @@ echo "</form>";
echo "</table></div>";
-echo "<div style=\"height: 4px;\"></div>";
+echo "<div style=\"height: 0.250rem;\"></div>";
if (is_array($quota) and ($quota[limit] > 0)) {
echo "<div class=\"folders\">";
- echo "<table style=\"-moz-box-shadow: inset 0 0 3px #dedede; -khtml-box-shadow: inset 0 0 3px #dedede; -webkit-box-shadow: inset 0 0 3px #dedede; box-shadow: inset 0 0 3px #dedede;\" border=\"0\" cellspacing=\"1\" cellpadding=\"2\" bgcolor=\"#cccccc\" width=\"100%\"><tr bgcolor=\"#ffffff\"><td><div class=\"bar\" style=\"width: {$quota_bar_width}%;\"></td></tr></table>";
- echo "<font style=\"font-size: 0.75em;\"><nobr>$quota_usage of $quota_limit ($quota_pct%)</nobr></font>";
+ echo "<table style=\"-moz-box-shadow: inset 0 0 0.188rem #dedede; -khtml-box-shadow: inset 0 0 0.188rem #dedede; -webkit-box-shadow: inset 0 0 0.188rem #dedede; box-shadow: inset 0 0 0.188rem #dedede;\" border=\"0\" cellspacing=\"1\" cellpadding=\"2\" bgcolor=\"#cccccc\" width=\"100%\"><tr bgcolor=\"#ffffff\"><td><div class=\"bar\" style=\"width: {$quota_bar_width}%;\"></td></tr></table>";
+ echo "<font style=\"font-size: 0.5625rem;\"><nobr>$quota_usage of $quota_limit ($quota_pct%)</nobr></font>";
echo "</div>";
- echo "<div style=\"height: 4px;\"></div>";
+ echo "<div style=\"height: 0.250rem;\"></div>";
}
$get_folders = kartero_sort_folders($imap_host,imap_list($mbox,$imap_host,"*"));
@@ -155,7 +155,7 @@ else {
echo "imap_getmailboxes failed: " . imap_last_error() . "\n";
}
-echo "<div style=\"height: 4px;\"></div>";
+echo "<div style=\"height: 0.250rem;\"></div>";
echo "<div class=\"folders\"><table border=\"0\" cellspacing=\"0\" callpadding=\"0\">";
diff --git a/inbox.php b/inbox.php
index 88bb9b3..248d4a4 100644
--- a/inbox.php
+++ b/inbox.php
@@ -69,13 +69,15 @@ echo "<title>Kartero - $folder ($msgCount) - " . $_SESSION['logged_uid'] . "</ti
echo "\n\n<table border=\"0\" cellspacing=\"1\" cellpadding=\"2\" bgcolor=\"#cccccc\" width=\"100%\">";
-echo "<tr bgcolor=\"#eeeeee\"><td align=\"center\" width=\"32\"><nobr>";
+//echo "<tr bgcolor=\"#eeeeee\"><td align=\"center\" width=\"32\"><nobr>";
+echo "<tr bgcolor=\"#eeeeee\"><td style=\"text-align: center; width: 32px; width: 2rem;\"><nobr>";
if ($folder == "Trash") {
echo "un";
}
-echo "del</nobr></td><td align=\"center\" style=\"min-width: 200px; width: auto;\">";
+//echo "del</nobr></td><td align=\"center\" style=\"min-width: 12.5rem; width: auto;\">";
+echo "del</nobr></td><td style=\"text-align: center; width: 256px; width: 16rem;\">";
if ($folder == "Sent") {
echo "recipient";
@@ -84,7 +86,8 @@ else {
echo "sender";
}
-echo "</td><td align=\"center\" style=\"min-width: 300px; width: auto;\">subject</td><td align=\"center\" width=\"100\">";
+//echo "</td><td align=\"center\" style=\"min-width: 18.75rem; width: auto;\">subject</td><td align=\"center\" width=\"100\">";
+echo "</td><td align=\"center\">subject</td><td style=\"text-align: center; width: 100px; width: 6.25rem;\">";
if ($folder == "Sent") {
echo "sent";
@@ -93,7 +96,8 @@ else {
echo "received";
}
-echo "</td><td align=\"center\" width=\"64\">size</td><td align=\"center\" width=\"32\">read</td></tr>\n";
+//echo "</td><td align=\"center\" width=\"64\">size</td><td align=\"center\" width=\"32\">read</td></tr>\n";
+echo "</td><td style=\"text-align: center; width: 64px; width: 4rem;\">size</td><td style=\"text-align: center; width: 32px; width: 2rem;\">read</td></tr>\n";
foreach ($mbox_sort as $mbox_num => $mbox_row) {
@@ -128,8 +132,12 @@ foreach ($mbox_sort as $mbox_num => $mbox_row) {
$subj = imap_utf8($val[0]->subject);
- if (strlen($subj) > 75) {
- $subj = substr($subj,0,74) . "...";
+ //if (strlen($subj) > 75) {
+ // $subj = substr($subj,0,74) . "...";
+ //}
+
+ if (strlen($subj) > 80) {
+ $subj = trim(substr($subj,0,79)) . " ...";
}
$date = $val[0]->date;
@@ -203,7 +211,7 @@ foreach ($mbox_sort as $mbox_num => $mbox_row) {
}
if ($header_priority != "") {
- $subj = "<b style=\"color: red; text-shadow: 0.1em 0.1em #dedede;\">!</b> $subj";
+ $subj = "<b style=\"color: red; text-shadow: 1px 1px #dedede; text-shadow: 0.1rem 0.1rem #dedede;\">!</b> $subj";
}
echo "<tr class=\"inboxE\" bgcolor=\"$bgColor\">";
@@ -237,7 +245,7 @@ foreach ($mbox_sort as $mbox_num => $mbox_row) {
$subj = "(No Subject)";
}
- echo "<td>$subj</td>";
+ echo "<td><nobr>$subj</nobr></td>";
if ($dalt == "") {
echo "<td align=\"center\"><nobr>(No Date)</nobr></td>";
diff --git a/index.php b/index.php
index 2373721..d8d8038 100644
--- a/index.php
+++ b/index.php
@@ -193,7 +193,13 @@ if (!isset($_SESSION['logged_uid']) and (($pw_put != $pw_get) or !isset($_POST['
echo "<br>kartero v1.0 at {$_SERVER['SERVER_NAME']}<br><br>";
- echo "<table border=\"0\" cellspacing=\"1\" cellpadding=\"2\" bgcolor=\"#cccccc\">";
+ if (isset($_POST['pw']) and ($pw_put != $pw_get)) {
+ echo "<table border=\"0\" cellspacing=\"1\" cellpadding=\"2\" bgcolor=\"#cccccc\" class=\"animated shake\">";
+ }
+ else {
+ echo "<table border=\"0\" cellspacing=\"1\" cellpadding=\"2\" bgcolor=\"#cccccc\">";
+ }
+
echo "<form method=\"post\">";
echo "<tr bgcolor=\"#ffffff\"><td><select class=\"input\" name=\"lvl\"><option value=\"subscriber\">subscriber</option><option value=\"postmaster\">postmaster</option><option value=\"administrator\">administrator</option></select></td></tr>";
echo "<tr bgcolor=\"#ffffff\"><td><input required autofocus class=\"input\" type=\"text\" name=\"id\" autocomplete=\"off\" maxlength=\"128\"></td></tr>";
@@ -1085,7 +1091,7 @@ if (isset($_SESSION['logged_uid'])) {
$reply_to = trim($_POST['reply_to']);
$reply_subj = trim($_POST['reply_subj']);
$reply_body = trim($_POST['reply_body']);
- $reply_headers = "From: $reply_from\nX-Mailer: Kartero/1.0 (PHP/" . phpversion() . ")\n";
+ $reply_headers = "From: $reply_from\nX-Mailer: Kartero/2.0 (PHP/" . phpversion() . ")\n";
if (isset($_POST['reply_cc']) and !empty($_POST['reply_cc'])) {
@@ -1187,11 +1193,21 @@ if (isset($_SESSION['logged_uid'])) {
if ($_POST['reply_dm'] == "on") {
imap_createmailbox($mbox,"{$imap_host}Drafts");
- imap_append($mbox,"{$imap_host}Drafts","To: $reply_to\nSubject: $reply_subj\nDate: $reply_date\n$reply_headers\n\n$reply_body\n");
+ imap_append($mbox,"{$imap_host}Drafts","To: $reply_to\r\nSubject: $reply_subj\r\nDate: $reply_date\r\n$reply_headers\r\n\r\n$reply_body\r\n");
}
else {
+ if ($_POST['reply_sm'] == "on") {
+ $reply_signed = kartero_smime_sign($_SESSION['logged_uid'], strip_tags($reply_from), extract_emails_from($reply_from)[0], $reply_body, $mail_home);
+
+ $reply_headers = preg_replace('/^.*?Content-Type.*\n?/m', '', $reply_headers);
+ $reply_headers = $reply_headers . trim($reply_signed[0]);
+ $reply_headers = implode("\n", array_unique(explode("\n", $reply_headers)));
+
+ $reply_body = trim($reply_signed[1]);
+ }
+
imap_createmailbox($mbox,"{$imap_host}Sent");
- imap_append($mbox,"{$imap_host}Sent","To: $reply_to\nSubject: $reply_subj\nDate: $reply_date\n$reply_headers\n\n$reply_body\n");
+ imap_append($mbox,"{$imap_host}Sent","To: $reply_to\r\nSubject: $reply_subj\r\nDate: $reply_date\r\n$reply_headers\r\n\r\n$reply_body\r\n");
mail($reply_to, $reply_subj, $reply_body, $reply_headers, "-f {$reply_fenv[0]}");
if ($folder == "Drafts") {
@@ -1598,7 +1614,8 @@ echo "</tr>";
foreach ($sivR as $sivK => $sivS) {
if ($bgColor == "#ffffff") {
- $bgColor = "#fdfdfd";
+ //$bgColor = "#fdfdfd";
+ $bgColor = "#f5f5f5";
}
else {
$bgColor = "#ffffff";
@@ -1633,44 +1650,51 @@ echo "</tr>";
$sivW = $sivW . "\r\ninclude \"" . str_replace(".sieve","",$sivF) . '";';
+ echo "<tr width=\"100%\" class=\"inboxE\" style=\"width: 100%; display: inline-table;\" bgcolor=\"$bgColor\">";
+
+ echo "<td align=\"center\" valign=\"bottom\" width=\"24\">";
echo "<form method=\"post\">";
echo "<input type=\"hidden\" name=\"set\" value=\"sivD\">";
echo "<input type=\"hidden\" name=\"sieve\" value=\"$sivF\">";
- echo "<tr bgcolor=\"$bgColor\">";
- echo "<td valign=\"bottom\" width=\"24\"><input type=\"image\" src=\"images/sieve-del.png\"></td>";
+ echo "<input type=\"image\" src=\"images/sieve-del.png\">";
echo "</form>";
+ echo "</td>";
if ($sivKp) {
+ echo "<td align=\"center\" valign=\"bottom\" width=\"24\">";
echo "<form method=\"post\">";
echo "<input type=\"hidden\" name=\"set\" value=\"sivM\">";
echo "<input type=\"hidden\" name=\"sieve\" value=\"$sivF\">";
echo "<input type=\"hidden\" name=\"sivM\" value=\"$sivKp\">";
- echo "<td valign=\"bottom\" width=\"24\"><input type=\"image\" src=\"images/sieve-up.png\"></td>";
+ echo "<input type=\"image\" src=\"images/sieve-up.png\">";
echo "</form>";
+ echo "</td>";
}
else {
if (count($sivR) > 1) {
- echo "<td></td>";
+ echo "<td width=\"24\"></td>";
}
}
if ($sivKn) {
+ echo "<td align=\"center\" valign=\"bottom\" width=\"24\">";
echo "<form method=\"post\">";
echo "<input type=\"hidden\" name=\"set\" value=\"sivM\">";
echo "<input type=\"hidden\" name=\"sieve\" value=\"$sivF\">";
echo "<input type=\"hidden\" name=\"sivM\" value=\"$sivKn\">";
- echo "<td valign=\"bottom\" width=\"24\"><input type=\"image\" src=\"images/sieve-down.png\"></td>";
+ echo "<input type=\"image\" src=\"images/sieve-down.png\">";
echo "</form>";
+ echo "</td>";
}
else {
if (count($sivR) > 1) {
- echo "<td></td>";
+ echo "<td width=\"24\"></td>";
}
}
- echo "<td>If message {$sivC[3]} contains {$sivC[5]} then move to {$sivC[7]}</td>";
+
+ echo "<td><nobr>If message {$sivC[3]} contains {$sivC[5]} then move to {$sivC[7]}</nobr></td>";
echo "</tr>";
}
-
echo "</table>";
}
@@ -1697,7 +1721,7 @@ echo "</tr>";
// imap_ping() should be doing this, but it's not working:
$mbox = @imap_open("{$imap_host}$folder", $_SESSION['logged_uid'], $_SESSION['logged_key'], CL_EXPUNGE) or die(imap_last_error());
- if ((count($_POST) == 0) or ((count($_POST) == 3) and array_key_exists('x',$_POST) and array_key_exists('y',$_POST) and ($_POST['box'] == "INBOX"))) {
+ if (($_POST['lvl'] == "subscriber") or (count($_POST) == 0) or ((count($_POST) == 3) and array_key_exists('x',$_POST) and array_key_exists('y',$_POST) and ($_POST['box'] == "INBOX"))) {
echo '<script src="//ajax.googleapis.com/ajax/libs/jquery/2.0.3/jquery.min.js"></script>';
echo '<script>window.jQuery||document.write(\'<script src="jquery-2.0.3.min.js"><\/script>\')</script>';
diff --git a/post.php b/post.php
index 3056597..06b5413 100644
--- a/post.php
+++ b/post.php
@@ -64,10 +64,12 @@ if (isset($_POST['new']) and !empty($_POST['new']) and is_numeric($_POST['new'])
echo "<td width=\"10\"></td>";
echo "<td valign=\"middle\"><input type=\"checkbox\" name=\"reply_dr\"></td><td valign=\"middle\">delivery receipt</td>";
echo "<td width=\"10\"></td>";
+ echo "<td valign=\"middle\"><input type=\"checkbox\" name=\"reply_sm\"></td><td valign=\"middle\">sign</td>";
+ echo "<td width=\"10\"></td>";
echo "<td valign=\"middle\"><input type=\"checkbox\" name=\"reply_dm\" id=\"reply_dm\" onclick=\"if (this.checked) { document.getElementById('reply_go').innerHTML='save'; } else { document.getElementById('reply_go').innerHTML='send'; }\"></td><td valign=\"middle\">draft</td>";
echo "</tr></table>";
- echo "</td><td align=\"right\"><div class=\"label\"><input type=\"image\" src=\"images/mail-reply.png\" onclick=\"if (document.getElementById('reply_dm').checked) { if (confirm('Save message?')) {return true;} else {return false;}} else { if (confirm('Send message?')) {return true;} else {return false;}}\"></div><div class=\"label\" id=\"reply_go\">send</div></td></tr>";
+ echo "</td><td align=\"right\"><table border=\"0\" cellspacing=\"0\" cellpadding=\"0\"><tr><td><input type=\"image\" src=\"images/mail-reply.png\" onclick=\"if (document.getElementById('reply_dm').checked) { if (confirm('Save message?')) {return true;} else {return false;}} else { if (confirm('Send message?')) {return true;} else {return false;}}\"></td><td width=\"40\" align=\"center\" valign=\"middle\" id=\"reply_go\">send</span></td></tr></table></td></tr>";
echo "</table>";
diff --git a/preload.php b/preload.php
index 8df500c..fa2f694 100644
--- a/preload.php
+++ b/preload.php
@@ -4,6 +4,8 @@ $preload_images = glob("images/{*.gif,*.jpg,*.png}",GLOB_BRACE);
foreach ($preload_images as $preload_image) {
echo "<img src=\"$preload_image\">";
+ //echo "<link rel=\"prefetch\" href=\"$preload_image\">\n";
+ //echo "<link rel=\"prerender\" href=\"$preload_image\">\n\n";
}
?>
diff --git a/rcpt.php b/rcpt.php
index f0dfae7..13f3dbe 100644
--- a/rcpt.php
+++ b/rcpt.php
@@ -23,8 +23,8 @@ $rcpt_date = trim(strip_tags($_POST['rcpt_date']));
$rcpt_part = md5(microtime(true));
$rcpt_omid = trim($_POST['rcpt_omid']);
$rcpt_omno = trim($_POST['rcpt_omno']);
-$rcpt_head = "From: $rcpt_user\nX-Mailer: Kartero/1.0 (PHP/" . phpversion() . ")\nMIME-Version: 1.0\nContent-Type: multipart/report;report-type=disposition-notification;boundary=\"$rcpt_part\"";
-$rcpt_body = "--$rcpt_part\nContent-Type: text/plain; charset=\"iso-8859-1\"\nContent-Transfer-Encoding: quoted-printable\n\nYour message\n\nTo: $rcpt_user\nSubject: $rcpt_subj\nDate: $rcpt_date\n\nWas displayed on " . date("D, j M Y H:i:s O (T)") . "\n\n--$rcpt_part\nContent-Type: message/disposition-notification\nContent-Transfer-Encoding: quoted-printable\n\nReporting-UA : " . $_SERVER['SERVER_NAME'] . " ; Kartero/1.0 (PHP/" . phpversion() . ")\nOriginal-Recipient : $rcpt_mail\nFinal-Recipient : rfc822;\nOriginal-Message-ID : $rcpt_omid\nDisposition: manual-action/MDN-sent-manually; displayed\n--$rcpt_part--";
+$rcpt_head = "From: $rcpt_user\nX-Mailer: Kartero/2.0 (PHP/" . phpversion() . ")\nMIME-Version: 1.0\nContent-Type: multipart/report;report-type=disposition-notification;boundary=\"$rcpt_part\"";
+$rcpt_body = "--$rcpt_part\nContent-Type: text/plain; charset=\"iso-8859-1\"\nContent-Transfer-Encoding: quoted-printable\n\nYour message\n\nTo: $rcpt_user\nSubject: $rcpt_subj\nDate: $rcpt_date\n\nWas displayed on " . date("D, j M Y H:i:s O (T)") . "\n\n--$rcpt_part\nContent-Type: message/disposition-notification\nContent-Transfer-Encoding: quoted-printable\n\nReporting-UA : " . $_SERVER['SERVER_NAME'] . " ; Kartero/2.0 (PHP/" . phpversion() . ")\nOriginal-Recipient : $rcpt_mail\nFinal-Recipient : rfc822;\nOriginal-Message-ID : $rcpt_omid\nDisposition: manual-action/MDN-sent-manually; displayed\n--$rcpt_part--";
$rcpt_subj = "Read: $rcpt_subj";
mail($rcpt_mail, $rcpt_subj, $rcpt_body, $rcpt_head, "-f $rcpt_user");
diff --git a/read.php b/read.php
index e96c99a..97f410a 100644
--- a/read.php
+++ b/read.php
@@ -64,6 +64,15 @@ if (isset($_POST['msg']) and !empty($_POST['msg']) and is_numeric($_POST['msg'])
if (strstr($header_raw_line,"Return-Receipt-To:")) {
$header_dr = $header_raw_line;
}
+
+ if (strstr($header_raw_line,"Content-Type:")) {
+ if (strstr($header_raw_line, 'multipart/signed') or strstr($header_raw_line, 'pkcs7')) {
+ $header_smime = 1;
+ }
+ else {
+ $header_smime = 0;
+ }
+ }
}
if (isset($_POST['imap_search_query']) and !empty($_POST['imap_search_query']) and isset($_POST['imap_search_where']) and !empty($_POST['imap_search_where'])) {
@@ -129,13 +138,13 @@ if (isset($_POST['msg']) and !empty($_POST['msg']) and is_numeric($_POST['msg'])
if (($filePicSize[0] > 0) and ($filePicSize[1] > 0)) {
- //echo "<style> .apic { padding: 3px; background: #fff; -moz-box-shadow: 1px 1px 3px #222; -khtml-box-shadow: 1px 1px 3px #222; -webkit-box-shadow: 1px 1px 3px #222; box-shadow: 1px 1px 3px #222; } </style>";
+ //echo "<style> .apic { padding: 0.188rem; background: #fff; -moz-box-shadow: 0.063rem 0.063rem 0.188rem #222; -khtml-box-shadow: 0.063rem 0.063rem 0.188rem #222; -webkit-box-shadow: 0.063rem 0.063rem 0.188rem #222; box-shadow: 0.063rem 0.063rem 0.188rem #222; } </style>";
echo "<img class=\"apic\" src=\"$filePic\" border=\"0\" width=\"{$filePicSize[0]}\" height=\"{$filePicSize[1]}\" align=\"right\">";
}
}
if ($header_priority != "") {
- echo "<b style=\"color: red; text-shadow: 0.1em 0.1em #dedede;\">!</b> ";
+ echo "<b style=\"color: red; text-shadow: 1px 1px #dedede; text-shadow: 0.1rem 0.1rem #dedede;\">!</b> ";
}
echo "<b>Subject: $header_subject</b>";
@@ -154,7 +163,8 @@ if (isset($_POST['msg']) and !empty($_POST['msg']) and is_numeric($_POST['msg'])
echo "<br>Date: $header_date ($header_date_age ago)";
}
else {
- echo "<br>Date: <font color=\"red\">Missing! Sender is non-standards compliant or message is probably spam.</font>";
+ //echo "<br>Date: <font color=\"red\">Missing! Sender is non-standards compliant or message is probably spam.</font>";
+ echo "<br>Date: <font color=\"red\">MISSING</font>";
}
if ($header_mailer != "") {
@@ -165,6 +175,15 @@ if (isset($_POST['msg']) and !empty($_POST['msg']) and is_numeric($_POST['msg'])
echo "<br>$header_user_agent";
}
+ echo '<br>Signature: ';
+
+ if ($header_smime === 1) {
+ kartero_smime_verify(imap_fetchbody($mbox, $msgno, '', FT_UID));
+ }
+ else {
+ echo 'NONE';
+ }
+
echo "<a style=\"float: right;\" id=\"headerM\" onclick=\"document.getElementById('header1').className ='message';document.getElementById('header2').className='spacer';document.getElementById('headerL').style.display='inline';document.getElementById('headerM').style.display='none'\">...</a>";
echo "<a class=\"hide\" style=\"float: right;\" id=\"headerL\" onclick=\"document.getElementById('header1').className ='hide';document.getElementById('header2').className='hide';document.getElementById('headerL').style.display='none';document.getElementById('headerM').style.display='inline'\">...</a>";
@@ -180,7 +199,7 @@ if (isset($_POST['msg']) and !empty($_POST['msg']) and is_numeric($_POST['msg'])
$fileDir = sha1(microtime(true));
- echo "<div class=\"message\" style=\"padding: 2px;\">";
+ echo "<div class=\"message\" style=\"padding: 2px; padding: 0.125rem;\">";
echo "<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\" width=\"100%\"><tr>";
@@ -449,10 +468,13 @@ if (isset($_POST['msg']) and !empty($_POST['msg']) and is_numeric($_POST['msg'])
}
else {
$msgBody = trim($bodyTEXT);
+
+ $msgBody = htmlentities($msgBody,ENT_QUOTES,"UTF-8");
+
$msgBody = nl2br($msgBody);
$msgBody = preg_replace("/([^\w\/])(www\.[a-z0-9\-]+\.[a-z0-9\-]+)/i","$1http://$2",$msgBody);
$msgBody = preg_replace("/([\w]+:\/\/[\w-?&;#~=\.\/\@]+[\w\/])/i","<a target=\"_blank\" href=\"$1\">$1</a>",$msgBody);
- $msgBody = preg_replace("/([\w-?&;#~=\.\/]+\@(\[?)[a-zA-Z0-9\-\.]+\.([a-zA-Z]{2,3}|[0-9]{1,3})(\]?))/i","<a href=\"mailto:$1\">$1</a>",$msgBody);
+ $msgBody = preg_replace("/([\w-?&;#~=\.\/]+\@(\[?)[a-zA-Z0-9\-\.]+\.([a-zA-Z]{2,63}|[0-9]{1,3})(\]?))/i","<a href=\"mailto:$1\">$1</a>",$msgBody);
}
$msgBody = mb_convert_encoding($msgBody,"UTF-8","auto");
@@ -488,7 +510,7 @@ if (isset($_POST['msg']) and !empty($_POST['msg']) and is_numeric($_POST['msg'])
echo "<div class=\"message\" style=\"position: relative;\">";
- echo "<div style=\"position: absolute; top: -15px; right: -15px;\"><img src=\"images/attach.png\" border=\"0\" width=\"48\" height=\"48\"></div>";
+ echo "<div style=\"position: absolute; top: -15px; top: -0.938rem; right: -15px; right: -0.938rem;\"><img src=\"images/attach.png\" border=\"0\" width=\"48\" height=\"48\"></div>";
echo "<table border=\"0\" cellspacing=\"1\" cellpadding=\"2\">";
@@ -575,5 +597,5 @@ if (isset($header_rr) and (strlen($header_rr) > 0)) {
echo "<script>if (confirm('The message sender has requested a response to indicate that you have read this message.\\nWould you like to send a receipt?')) { document.getElementById('receipt').submit(); }</script>";
}
}
-
+
?>
diff --git a/rel.txt b/rel.txt
index c653a39..a7d6c4f 100644
--- a/rel.txt
+++ b/rel.txt
@@ -1 +1 @@
-20100123
\ No newline at end of file
+2.0-20150918
diff --git a/send.php b/send.php
index 4f45b66..f1ba2d7 100644
--- a/send.php
+++ b/send.php
@@ -327,6 +327,8 @@ if (isset($_POST['msg']) and !empty($_POST['msg']) and is_numeric($_POST['msg'])
echo "<td valign=\"middle\"><input type=\"checkbox\" name=\"reply_dr\"></td><td valign=\"middle\">delivery receipt</td>";
}
+ echo "<td width=\"10\"></td>";
+ echo "<td valign=\"middle\"><input type=\"checkbox\" name=\"reply_sm\"></td><td valign=\"middle\">sign</td>";
echo "<td width=\"10\"></td>";
echo "<td valign=\"middle\"><input type=\"checkbox\" name=\"reply_dm\" id=\"reply_dm\" onclick=\"if (this.checked) { document.getElementById('reply_go').innerHTML='save'; } else { document.getElementById('reply_go').innerHTML='send'; }\"></td><td valign=\"middle\">draft</td>";
echo "</tr></table>";
@@ -339,16 +341,18 @@ if (isset($_POST['msg']) and !empty($_POST['msg']) and is_numeric($_POST['msg'])
echo "<td width=\"10\"></td>";
echo "<td valign=\"middle\"><input type=\"checkbox\" name=\"reply_dr\"></td><td valign=\"middle\">delivery receipt</td>";
echo "<td width=\"10\"></td>";
+ echo "<td valign=\"middle\"><input type=\"checkbox\" name=\"reply_sm\"></td><td valign=\"middle\">sign</td>";
+ echo "<td width=\"10\"></td>";
echo "<td valign=\"middle\"><input type=\"checkbox\" name=\"reply_dm\" id=\"reply_dm\" onclick=\"if (this.checked) { document.getElementById('reply_go').innerHTML='save'; } else { document.getElementById('reply_go').innerHTML='send'; }\"></td><td valign=\"middle\">draft</td>";
echo "</tr></table>";
}
}
if ($_POST['rep'] != 4) {
- echo "</td><td align=\"right\"><div class=\"label\"><input type=\"image\" src=\"images/mail-reply.png\" onclick=\"if (document.getElementById('reply_dm').checked) { if (confirm('Save message?')) {return true;} else {return false;}} else { if (confirm('Send message?')) {return true;} else {return false;}}\"></div><div class=\"label\" id=\"reply_go\">send</div></td></tr>";
+ echo "</td><td align=\"right\"><table border=\"0\" cellspacing=\"0\" cellpadding=\"0\"><tr><td><input type=\"image\" src=\"images/mail-reply.png\" onclick=\"if (document.getElementById('reply_dm').checked) { if (confirm('Save message?')) {return true;} else {return false;}} else { if (confirm('Send message?')) {return true;} else {return false;}}\"></td><td width=\"40\" align=\"center\" valign=\"middle\" id=\"reply_go\">send</td></tr></table></td></tr>";
}
else {
- echo "</td><td align=\"right\"><div class=\"label\"><input type=\"image\" src=\"images/mail-reply.png\" onclick=\"if (confirm('Send message?')) {return true;} else {return false;}\"></div><div class=\"label\" id=\"reply_go\">send</div></td></tr>";
+ echo "</td><td align=\"right\"><table border=\"0\" cellspacing=\"0\" cellpadding=\"0\"><tr><td><input type=\"image\" src=\"images/mail-reply.png\" onclick=\"if (confirm('Send message?')) {return true;} else {return false;}\"></td><td width=\"40\" align=\"center\" valign=\"middle\" id=\"reply_go\">send</td></tr></table></td></tr>";
}
echo "</table>";
tree a7684d984dee1196a2eb46ebb4f4afb0bc8e6d07
parent 93233e52d8b3dabb731c7ec2e6fba005f859c7ae
author Engels Antonio <engels@kartero.org> 1442508014 +0800
committer Engels Antonio <engels@kartero.org> 1442508014 +0800
Version 2.0 release (Phoenix)
diff --git a/core.js b/core.js
index 8e53ff4..02c5cfa 100644
--- a/core.js
+++ b/core.js
@@ -1007,20 +1007,20 @@ function eval(a) {
}
if (b.score < 3) {
document.getElementById("mtr").style.color = "#ff6666";
- document.getElementById("mtr").style.border = "#ff6666 solid 1px";
+ document.getElementById("mtr").style.border = "#ff6666 solid 0.063em";
document.getElementById("mtr").style.background = "#ffbbbb";
- document.getElementById("mtr").style.boxShadow = "inset 0 0 3px #ff6666, 0 0 1px #777";
- document.getElementById("mtr").style.MozBoxShadow = "inset 0 0 3px #ff6666, 0 0 1px #777";
- document.getElementById("mtr").style.KhtmlBoxShadow = "inset 0 0 3px #ff6666, 0 0 1px #777";
- document.getElementById("mtr").style.WebkitBoxShadow = "inset 0 0 3px #ff6666, 0 0 1px #777"
+ document.getElementById("mtr").style.boxShadow = "inset 0 0 0.188em #ff6666, 0 0 0.063em #777";
+ document.getElementById("mtr").style.MozBoxShadow = "inset 0 0 0.188em #ff6666, 0 0 0.063em #777";
+ document.getElementById("mtr").style.KhtmlBoxShadow = "inset 0 0 0.188em #ff6666, 0 0 0.063em #777";
+ document.getElementById("mtr").style.WebkitBoxShadow = "inset 0 0 0.188em #ff6666, 0 0 0.063em #777"
} else {
document.getElementById("mtr").style.color = "#74ae0b";
- document.getElementById("mtr").style.border = "#74ae0b solid 1px";
+ document.getElementById("mtr").style.border = "#74ae0b solid 0.063em";
document.getElementById("mtr").style.background = "#cde2a7";
- document.getElementById("mtr").style.boxShadow = "inset 0 0 2px #74ae0b, 0 0 1px #777";
- document.getElementById("mtr").style.MozBoxShadow = "inset 0 0 2px #74ae0b, 0 0 1px #777";
- document.getElementById("mtr").style.KhtmlBoxShadow = "inset 0 0 2px #74ae0b, 0 0 1px #777";
- document.getElementById("mtr").style.WebkitBoxShadow = "inset 0 0 2px #74ae0b, 0 0 1px #777"
+ document.getElementById("mtr").style.boxShadow = "inset 0 0 0.125em #74ae0b, 0 0 0.063em #777";
+ document.getElementById("mtr").style.MozBoxShadow = "inset 0 0 0.125em #74ae0b, 0 0 0.063em #777";
+ document.getElementById("mtr").style.KhtmlBoxShadow = "inset 0 0 0.125em #74ae0b, 0 0 0.063em #777";
+ document.getElementById("mtr").style.WebkitBoxShadow = "inset 0 0 0.125em #74ae0b, 0 0 0.063em #777"
}
}
diff --git a/core.php b/core.php
index e87e511..977f22a 100644
--- a/core.php
+++ b/core.php
@@ -636,4 +636,86 @@ function pass2_process($mbox, $msgno, $path) {
}
}
+function kartero_smime_verify($e) {
+ $t = tempnam(sys_get_temp_dir(), 'KSV');
+ file_put_contents($t, $e);
+ $r = openssl_pkcs7_verify($t, PKCS7_NOVERIFY);
+ if ($r === true) {
+ echo '<font color="green">TRUE</font>';
+ } elseif ($r == -1) {
+ echo '<font color="orange">ERROR</font>';
+ } else {
+ echo '<font color="red">FALSE</font>';
+ }
+ unlink($t);
+}
+
+function kartero_smime_sign($user, $name, $from, $body, $home, $days = 365) {
+
+ preg_match('/^--.*\n?/m', $body, $matches);
+
+ if (count($matches) > 0) {
+ $body = 'Content-Type: multipart/mixed; boundary="' . trim(substr($matches[0], 2)) . "\"\n" . $body;
+ }
+ else {
+ $body = "Content-Type: text/plain\n\n$body";
+ }
+
+ $body = str_replace("\r", '', $body);
+
+ $name = trim($name);
+ $user = trim(strtolower($user));
+ $from = trim(strtolower($from));
+ $home = trim(strtolower($home));
+
+ $u = explode('@', $user);
+ $n = $u[0];
+ $d = $u[1];
+ $h = "$home/$d/{$n[0]}/$n/smime";
+
+ $key_file = "$h/$from.sign.key";
+ $crt_file = "$h/$from.sign.crt";
+
+ $msg_file = tempnam(sys_get_temp_dir(), 'MSG');
+ file_put_contents($msg_file, $body);
+
+ if (file_exists($key_file) and (filemtime($key_file) < (time() - ($days * 86400)))) {
+ unlink($key_file);
+ }
+
+ if (file_exists($crt_file) and (filemtime($crt_file) < (time() - ($days * 86400)))) {
+ unlink($crt_file);
+ }
+
+ if (file_exists($key_file) and file_exists($crt_file)) {
+ $key = file_get_contents($key_file);
+ $crt = file_get_contents($crt_file);
+ } else {
+ $req_key = openssl_pkey_new(array('digest_alg' => 'sha512', 'private_key_bits' => 4096, 'private_key_type' => OPENSSL_KEYTYPE_RSA));
+ $req_csr = openssl_csr_new(array('countryName' => 'PH', 'stateOrProvinceName' => 'NCR', 'localityName' => 'QC', 'organizationName' => 'kartero.org', 'organizationalUnitName' => explode('@', $from)[1], 'commonName' => $name, 'emailAddress' => $from), $req_key);
+ $req_crt = openssl_csr_sign($req_csr, NULL, $req_key, $days);
+
+ openssl_pkey_export($req_key, $key);
+ openssl_x509_export($req_crt, $crt);
+
+ if (!file_exists($h)) {
+ mkdir($h, 0700, 1);
+ }
+
+ file_put_contents($key_file, $key);
+ file_put_contents($crt_file, $crt);
+ }
+
+ $sig_file = tempnam(sys_get_temp_dir(), 'SIG');
+
+ if (openssl_pkcs7_sign($msg_file, $sig_file, $crt, $key, array(), PKCS7_DETACHED)) {
+ if (openssl_pkcs7_verify($sig_file, PKCS7_NOVERIFY)) {
+ return explode("\n\n", file_get_contents($sig_file), 2);
+ }
+ }
+
+ unlink($msg_file);
+ unlink($sig_file);
+}
+
?>
diff --git a/css.php b/css.php
index d4d3826..ce1d410 100644
--- a/css.php
+++ b/css.php
@@ -5,11 +5,18 @@
body {
color: #666666;
- background: #ffffff;
- font-size: 0.75em;
+ background: #ffffff !important;
+ font-size: 12px;
+ font-size: 0.75rem;
font-family: arial,helvetica,sans-serif;
- margin-right: 20px;
- margin-left: 20px;
+ margin-right: 20px !important;
+ margin-right: 1.25rem !important;
+ margin-left: 20px !important;
+ margin-left: 1.25rem !important;
+ margin-top: 10px !important;
+ margin-top: 0.625rem !important;
+ margin-bottom: 10px !important;
+ margin-bottom: 0.625rem !important;
}
a,a:link,a:visited,a:hover,a:active {
@@ -23,6 +30,7 @@ a,a:link,a:visited,a:hover,a:active {
color: #666666;
background: #ffffff;
border: #999999 solid 1px;
+ border: #999999 solid 0.063rem;
width: 100%;
box-sizing: border-box;
-moz-box-sizing: border-box;
@@ -31,9 +39,13 @@ a,a:link,a:visited,a:hover,a:active {
.input {
box-shadow: inset 0 0 2px #dedede;
+ box-shadow: inset 0 0 0.125rem #dedede;
-moz-box-shadow: inset 0 0 2px #dedede;
+ -moz-box-shadow: inset 0 0 0.125rem #dedede;
-webkit-box-shadow: inset 0 0 2px #dedede;
+ -webkit-box-shadow: inset 0 0 0.125rem #dedede;
-khtml-box-shadow: inset 0 0 2px #dedede;
+ -khtml-box-shadow: inset 0 0 0.125rem #dedede;
}
.input:focus {
@@ -44,11 +56,14 @@ a,a:link,a:visited,a:hover,a:active {
color: #74ae0b;
background: #cde2a7;
border: #74ae0b solid 1px;
+ border: #74ae0b solid 0.063rem;
font-weight: bold;
font-family: arial,helvetica,sans-serif;
text-align: center;
- padding: 0px 10px 0px 10px;
- margin: 0px 0px 5px 0px;
+ padding: 0 10px 0 10px;
+ padding: 0 0.625rem 0 0.625rem;
+ margin: 0 0 5px 0;
+ margin: 0 0 0.313rem 0;
moz-opacity: 0.9;
filter: alpha(opacity=90);
opacity: 0.9;
@@ -58,11 +73,14 @@ a,a:link,a:visited,a:hover,a:active {
color: #ff6666;
background: #ffbbbb;
border: #ff6666 solid 1px;
+ border: #ff6666 solid 0.063rem;
font-weight: bold;
font-family: arial,helvetica,sans-serif;
text-align: center;
- padding: 0px 10px 0px 10px;
- margin: 0px 0px 5px 0px;
+ padding: 0 10px 0 10px;
+ padding: 0 0.625rem 0 0.625rem;
+ margin: 0 0 5px 0;
+ margin: 0 0 0.313rem 0;
moz-opacity: 0.9;
filter: alpha(opacity=90);
opacity: 0.9;
@@ -72,11 +90,13 @@ a,a:link,a:visited,a:hover,a:active {
color: #f3e533;
background: #fcffcd;
border: #f3e533 solid 1px;
+ border: #f3e533 solid 0.063rem;
font-weight: bold;
font-family: arial,helvetica,sans-serif;
text-align: center;
- padding: 0px 0px 0px 0px;
- margin: 0px 0px 5px 0px;
+ padding: 0;
+ margin: 0 0 5px 0;
+ margin: 0 0 0.313rem 0;
moz-opacity: 0.9;
filter: alpha(opacity=90);
opacity: 0.9;
@@ -84,33 +104,49 @@ a,a:link,a:visited,a:hover,a:active {
.folders {
border: solid 1px #ccc;
+ border: solid 0.063rem #ccc;
padding: 5px;
+ padding: 0.313rem;
box-shadow: 0 0 2px #dedede;
+ box-shadow: 0 0 0.125rem #dedede;
-moz-box-shadow: 0 0 2px #dedede;
+ -moz-box-shadow: 0 0 0.125rem #dedede;
-webkit-box-shadow: 0 0 2px #dedede;
+ -webkit-box-shadow: 0 0 0.125rem #dedede;
-khtml-box-shadow: 0 0 2px #dedede;
+ -khtml-box-shadow: 0 0 0.125rem #dedede;
}
.main {
border: solid 1px #ccc;
+ border: solid 0.063rem #ccc;
padding: 2px;
+ padding: 0.125rem;
box-shadow: 0 0 2px #dedede;
+ box-shadow: 0 0 0.125rem #dedede;
-moz-box-shadow: 0 0 2px #dedede;
+ -moz-box-shadow: 0 0 0.125rem #dedede;
-webkit-box-shadow: 0 0 2px #dedede;
+ -webkit-box-shadow: 0 0 0.125rem #dedede;
-khtml-box-shadow: 0 0 2px #dedede;
+ -khtml-box-shadow: 0 0 0.125rem #dedede;
}
.message {
border: 1px solid #ccc;
+ border: 0.063rem solid #ccc;
padding: 5px;
+ padding: 0.313rem;
}
.spacer {
height: 2px;
+ height: 0.125rem;
}
.login {
width: 300px;
+ width: 18.75rem;
border: none;
margin-top: 10%;
margin-left: auto;
@@ -119,8 +155,10 @@ a,a:link,a:visited,a:hover,a:active {
.label {
width: 40px;
+ width: 2.5rem;
text-align: center;
- font-size: 0.75em;
+ font-size: 9px;
+ font-size: 0.5625rem;
}
.loader {
@@ -135,6 +173,7 @@ a,a:link,a:visited,a:hover,a:active {
0% {
width: 0;
height: 11px;
+ height: 0.688rem;
}
}
@@ -142,12 +181,14 @@ a,a:link,a:visited,a:hover,a:active {
0% {
width: 0;
height: 11px;
+ height: 0.688rem;
}
}
#mtr {
width: 0;
height: 11px;
+ height: 0.688rem;
padding: 0;
margin: 0;
-webkit-animation-name: strength;
@@ -168,3 +209,27 @@ a,a:link,a:visited,a:hover,a:active {
background-image: -o-linear-gradient(bottom, #ffffdd 50%, #ffffcc 100%);
background-image: linear-gradient(bottom, #ffffdd 50%, #ffffcc 100%);
}
+
+.animated {
+ -webkit-animation-duration: 1s;
+ animation-duration: 1s;
+ -webkit-animation-fill-mode: both;
+ animation-fill-mode: both;
+}
+
+@-webkit-keyframes shake {
+ 0%, 100% { -webkit-transform: translateX(0); }
+ 10%, 30%, 50%, 70%, 90% { -webkit-transform: translateX(-10px); }
+ 20%, 40%, 60%, 80% { -webkit-transform: translateX(10px); }
+}
+
+@keyframes shake {
+ 0%, 100% { transform: translateX(0); }
+ 10%, 30%, 50%, 70%, 90% { transform: translateX(-10px); }
+ 20%, 40%, 60%, 80% { transform: translateX(10px); }
+}
+
+.shake {
+ -webkit-animation-name: shake;
+ animation-name: shake;
+}
diff --git a/filedrop.php b/filedrop.php
index e0493d5..881170b 100644
--- a/filedrop.php
+++ b/filedrop.php
@@ -58,8 +58,8 @@ if (file_exists("attach/i/$fileUsr/$filedrop_box")) {
echo "<style>\r\n$css</style>\r\n\r\n";
- // compensate for body { margin-right: 20px; margin-left: 20px; } in css.php
- echo "<style>body { margin-right: 5px; margin-left: 5px; }</style>";
+ // compensate for body { margin-right: 1.25rem; margin-left: 1.25rem; } in css.php
+ echo "<style>body { margin-right: 5px !important; margin-right: 0.313rem !important; margin-left: 5px !important; margin-left: 0.313rem !important; }</style>\r\n\r\n";
}
echo "<table border=\"0\" cellspacing=\"1\" cellpadding=\"2\">";
diff --git a/folders.php b/folders.php
index d0c2507..de1849d 100644
--- a/folders.php
+++ b/folders.php
@@ -19,12 +19,12 @@ if (is_array($quota) and ($quota[limit] > 0)) {
if ($quota_pct > 75) {
$quota_bar_bgcolor = "#ffbbbb";
$quota_bar_border = "#ff6666";
- $quota_bar_shadow = "3px";
+ $quota_bar_shadow = "0.188rem";
}
else {
$quota_bar_bgcolor = "#cde2a7";
$quota_bar_border = "#74ae0b";
- $quota_bar_shadow = "2px";
+ $quota_bar_shadow = "0.125rem";
}
$quota_bar_max = "100";
@@ -33,9 +33,9 @@ if (is_array($quota) and ($quota[limit] > 0)) {
$quota_bar_width = number_format($quota_bar_width, 0);
echo "<style>";
- echo "\r\n@-webkit-keyframes quota { 0% { width: 0; height: 11px; } }";
- echo "\r\n@-moz-keyframes quota { 0% { width: 0; height: 11px; } }";
- echo "\r\n.bar { height: 11px; padding: 0; margin: 0; background: $quota_bar_bgcolor; border: $quota_bar_border solid 1px; -webkit-animation-name: quota; -moz-animation-name: quota; -webkit-animation-duration: 1s; -moz-animation-duration: 1s; -webkit-animation-iteration-count: 1; -moz-animation-iteration-count: 1; -webkit-animation-timing-function: ease; -moz-animation-timing-function: ease; -moz-box-shadow: inset 0 0 $quota_bar_shadow $quota_bar_border, 0 0 1px #777; -webkit-box-shadow: inset 0 0 $quota_bar_shadow $quota_bar_border, 0 0 1px #777; box-shadow: inset 0 0 $quota_bar_shadow $quota_bar_border, 0 0 1px #777; -khtml-box-shadow: inset 0 0 $quota_bar_shadow $quota_bar_border, 0 0 1px #777; }";
+ echo "\r\n@-webkit-keyframes quota { 0% { width: 0; height: 0.688rem; } }";
+ echo "\r\n@-moz-keyframes quota { 0% { width: 0; height: 0.688rem; } }";
+ echo "\r\n.bar { height: 0.688rem; padding: 0; margin: 0; background: $quota_bar_bgcolor; border: $quota_bar_border solid 0.063rem; -webkit-animation-name: quota; -moz-animation-name: quota; -webkit-animation-duration: 1s; -moz-animation-duration: 1s; -webkit-animation-iteration-count: 1; -moz-animation-iteration-count: 1; -webkit-animation-timing-function: ease; -moz-animation-timing-function: ease; -moz-box-shadow: inset 0 0 $quota_bar_shadow $quota_bar_border, 0 0 0.063rem #777; -webkit-box-shadow: inset 0 0 $quota_bar_shadow $quota_bar_border, 0 0 0.063rem #777; box-shadow: inset 0 0 $quota_bar_shadow $quota_bar_border, 0 0 0.063rem #777; -khtml-box-shadow: inset 0 0 $quota_bar_shadow $quota_bar_border, 0 0 0.063rem #777; }";
echo "\r\n</style>";
}
@@ -101,7 +101,7 @@ if (($folder == "Trash") or ($folder == "Spam")) {
echo "</table></div>";
-echo "<div style=\"height: 4px;\"></div>";
+echo "<div style=\"height: 0.250rem;\"></div>";
echo "<div class=\"folders\"><table border=\"0\" cellspacing=\"0\" callpadding=\"0\">";
@@ -113,14 +113,14 @@ echo "</form>";
echo "</table></div>";
-echo "<div style=\"height: 4px;\"></div>";
+echo "<div style=\"height: 0.250rem;\"></div>";
if (is_array($quota) and ($quota[limit] > 0)) {
echo "<div class=\"folders\">";
- echo "<table style=\"-moz-box-shadow: inset 0 0 3px #dedede; -khtml-box-shadow: inset 0 0 3px #dedede; -webkit-box-shadow: inset 0 0 3px #dedede; box-shadow: inset 0 0 3px #dedede;\" border=\"0\" cellspacing=\"1\" cellpadding=\"2\" bgcolor=\"#cccccc\" width=\"100%\"><tr bgcolor=\"#ffffff\"><td><div class=\"bar\" style=\"width: {$quota_bar_width}%;\"></td></tr></table>";
- echo "<font style=\"font-size: 0.75em;\"><nobr>$quota_usage of $quota_limit ($quota_pct%)</nobr></font>";
+ echo "<table style=\"-moz-box-shadow: inset 0 0 0.188rem #dedede; -khtml-box-shadow: inset 0 0 0.188rem #dedede; -webkit-box-shadow: inset 0 0 0.188rem #dedede; box-shadow: inset 0 0 0.188rem #dedede;\" border=\"0\" cellspacing=\"1\" cellpadding=\"2\" bgcolor=\"#cccccc\" width=\"100%\"><tr bgcolor=\"#ffffff\"><td><div class=\"bar\" style=\"width: {$quota_bar_width}%;\"></td></tr></table>";
+ echo "<font style=\"font-size: 0.5625rem;\"><nobr>$quota_usage of $quota_limit ($quota_pct%)</nobr></font>";
echo "</div>";
- echo "<div style=\"height: 4px;\"></div>";
+ echo "<div style=\"height: 0.250rem;\"></div>";
}
$get_folders = kartero_sort_folders($imap_host,imap_list($mbox,$imap_host,"*"));
@@ -155,7 +155,7 @@ else {
echo "imap_getmailboxes failed: " . imap_last_error() . "\n";
}
-echo "<div style=\"height: 4px;\"></div>";
+echo "<div style=\"height: 0.250rem;\"></div>";
echo "<div class=\"folders\"><table border=\"0\" cellspacing=\"0\" callpadding=\"0\">";
diff --git a/inbox.php b/inbox.php
index 88bb9b3..248d4a4 100644
--- a/inbox.php
+++ b/inbox.php
@@ -69,13 +69,15 @@ echo "<title>Kartero - $folder ($msgCount) - " . $_SESSION['logged_uid'] . "</ti
echo "\n\n<table border=\"0\" cellspacing=\"1\" cellpadding=\"2\" bgcolor=\"#cccccc\" width=\"100%\">";
-echo "<tr bgcolor=\"#eeeeee\"><td align=\"center\" width=\"32\"><nobr>";
+//echo "<tr bgcolor=\"#eeeeee\"><td align=\"center\" width=\"32\"><nobr>";
+echo "<tr bgcolor=\"#eeeeee\"><td style=\"text-align: center; width: 32px; width: 2rem;\"><nobr>";
if ($folder == "Trash") {
echo "un";
}
-echo "del</nobr></td><td align=\"center\" style=\"min-width: 200px; width: auto;\">";
+//echo "del</nobr></td><td align=\"center\" style=\"min-width: 12.5rem; width: auto;\">";
+echo "del</nobr></td><td style=\"text-align: center; width: 256px; width: 16rem;\">";
if ($folder == "Sent") {
echo "recipient";
@@ -84,7 +86,8 @@ else {
echo "sender";
}
-echo "</td><td align=\"center\" style=\"min-width: 300px; width: auto;\">subject</td><td align=\"center\" width=\"100\">";
+//echo "</td><td align=\"center\" style=\"min-width: 18.75rem; width: auto;\">subject</td><td align=\"center\" width=\"100\">";
+echo "</td><td align=\"center\">subject</td><td style=\"text-align: center; width: 100px; width: 6.25rem;\">";
if ($folder == "Sent") {
echo "sent";
@@ -93,7 +96,8 @@ else {
echo "received";
}
-echo "</td><td align=\"center\" width=\"64\">size</td><td align=\"center\" width=\"32\">read</td></tr>\n";
+//echo "</td><td align=\"center\" width=\"64\">size</td><td align=\"center\" width=\"32\">read</td></tr>\n";
+echo "</td><td style=\"text-align: center; width: 64px; width: 4rem;\">size</td><td style=\"text-align: center; width: 32px; width: 2rem;\">read</td></tr>\n";
foreach ($mbox_sort as $mbox_num => $mbox_row) {
@@ -128,8 +132,12 @@ foreach ($mbox_sort as $mbox_num => $mbox_row) {
$subj = imap_utf8($val[0]->subject);
- if (strlen($subj) > 75) {
- $subj = substr($subj,0,74) . "...";
+ //if (strlen($subj) > 75) {
+ // $subj = substr($subj,0,74) . "...";
+ //}
+
+ if (strlen($subj) > 80) {
+ $subj = trim(substr($subj,0,79)) . " ...";
}
$date = $val[0]->date;
@@ -203,7 +211,7 @@ foreach ($mbox_sort as $mbox_num => $mbox_row) {
}
if ($header_priority != "") {
- $subj = "<b style=\"color: red; text-shadow: 0.1em 0.1em #dedede;\">!</b> $subj";
+ $subj = "<b style=\"color: red; text-shadow: 1px 1px #dedede; text-shadow: 0.1rem 0.1rem #dedede;\">!</b> $subj";
}
echo "<tr class=\"inboxE\" bgcolor=\"$bgColor\">";
@@ -237,7 +245,7 @@ foreach ($mbox_sort as $mbox_num => $mbox_row) {
$subj = "(No Subject)";
}
- echo "<td>$subj</td>";
+ echo "<td><nobr>$subj</nobr></td>";
if ($dalt == "") {
echo "<td align=\"center\"><nobr>(No Date)</nobr></td>";
diff --git a/index.php b/index.php
index 2373721..d8d8038 100644
--- a/index.php
+++ b/index.php
@@ -193,7 +193,13 @@ if (!isset($_SESSION['logged_uid']) and (($pw_put != $pw_get) or !isset($_POST['
echo "<br>kartero v1.0 at {$_SERVER['SERVER_NAME']}<br><br>";
- echo "<table border=\"0\" cellspacing=\"1\" cellpadding=\"2\" bgcolor=\"#cccccc\">";
+ if (isset($_POST['pw']) and ($pw_put != $pw_get)) {
+ echo "<table border=\"0\" cellspacing=\"1\" cellpadding=\"2\" bgcolor=\"#cccccc\" class=\"animated shake\">";
+ }
+ else {
+ echo "<table border=\"0\" cellspacing=\"1\" cellpadding=\"2\" bgcolor=\"#cccccc\">";
+ }
+
echo "<form method=\"post\">";
echo "<tr bgcolor=\"#ffffff\"><td><select class=\"input\" name=\"lvl\"><option value=\"subscriber\">subscriber</option><option value=\"postmaster\">postmaster</option><option value=\"administrator\">administrator</option></select></td></tr>";
echo "<tr bgcolor=\"#ffffff\"><td><input required autofocus class=\"input\" type=\"text\" name=\"id\" autocomplete=\"off\" maxlength=\"128\"></td></tr>";
@@ -1085,7 +1091,7 @@ if (isset($_SESSION['logged_uid'])) {
$reply_to = trim($_POST['reply_to']);
$reply_subj = trim($_POST['reply_subj']);
$reply_body = trim($_POST['reply_body']);
- $reply_headers = "From: $reply_from\nX-Mailer: Kartero/1.0 (PHP/" . phpversion() . ")\n";
+ $reply_headers = "From: $reply_from\nX-Mailer: Kartero/2.0 (PHP/" . phpversion() . ")\n";
if (isset($_POST['reply_cc']) and !empty($_POST['reply_cc'])) {
@@ -1187,11 +1193,21 @@ if (isset($_SESSION['logged_uid'])) {
if ($_POST['reply_dm'] == "on") {
imap_createmailbox($mbox,"{$imap_host}Drafts");
- imap_append($mbox,"{$imap_host}Drafts","To: $reply_to\nSubject: $reply_subj\nDate: $reply_date\n$reply_headers\n\n$reply_body\n");
+ imap_append($mbox,"{$imap_host}Drafts","To: $reply_to\r\nSubject: $reply_subj\r\nDate: $reply_date\r\n$reply_headers\r\n\r\n$reply_body\r\n");
}
else {
+ if ($_POST['reply_sm'] == "on") {
+ $reply_signed = kartero_smime_sign($_SESSION['logged_uid'], strip_tags($reply_from), extract_emails_from($reply_from)[0], $reply_body, $mail_home);
+
+ $reply_headers = preg_replace('/^.*?Content-Type.*\n?/m', '', $reply_headers);
+ $reply_headers = $reply_headers . trim($reply_signed[0]);
+ $reply_headers = implode("\n", array_unique(explode("\n", $reply_headers)));
+
+ $reply_body = trim($reply_signed[1]);
+ }
+
imap_createmailbox($mbox,"{$imap_host}Sent");
- imap_append($mbox,"{$imap_host}Sent","To: $reply_to\nSubject: $reply_subj\nDate: $reply_date\n$reply_headers\n\n$reply_body\n");
+ imap_append($mbox,"{$imap_host}Sent","To: $reply_to\r\nSubject: $reply_subj\r\nDate: $reply_date\r\n$reply_headers\r\n\r\n$reply_body\r\n");
mail($reply_to, $reply_subj, $reply_body, $reply_headers, "-f {$reply_fenv[0]}");
if ($folder == "Drafts") {
@@ -1598,7 +1614,8 @@ echo "</tr>";
foreach ($sivR as $sivK => $sivS) {
if ($bgColor == "#ffffff") {
- $bgColor = "#fdfdfd";
+ //$bgColor = "#fdfdfd";
+ $bgColor = "#f5f5f5";
}
else {
$bgColor = "#ffffff";
@@ -1633,44 +1650,51 @@ echo "</tr>";
$sivW = $sivW . "\r\ninclude \"" . str_replace(".sieve","",$sivF) . '";';
+ echo "<tr width=\"100%\" class=\"inboxE\" style=\"width: 100%; display: inline-table;\" bgcolor=\"$bgColor\">";
+
+ echo "<td align=\"center\" valign=\"bottom\" width=\"24\">";
echo "<form method=\"post\">";
echo "<input type=\"hidden\" name=\"set\" value=\"sivD\">";
echo "<input type=\"hidden\" name=\"sieve\" value=\"$sivF\">";
- echo "<tr bgcolor=\"$bgColor\">";
- echo "<td valign=\"bottom\" width=\"24\"><input type=\"image\" src=\"images/sieve-del.png\"></td>";
+ echo "<input type=\"image\" src=\"images/sieve-del.png\">";
echo "</form>";
+ echo "</td>";
if ($sivKp) {
+ echo "<td align=\"center\" valign=\"bottom\" width=\"24\">";
echo "<form method=\"post\">";
echo "<input type=\"hidden\" name=\"set\" value=\"sivM\">";
echo "<input type=\"hidden\" name=\"sieve\" value=\"$sivF\">";
echo "<input type=\"hidden\" name=\"sivM\" value=\"$sivKp\">";
- echo "<td valign=\"bottom\" width=\"24\"><input type=\"image\" src=\"images/sieve-up.png\"></td>";
+ echo "<input type=\"image\" src=\"images/sieve-up.png\">";
echo "</form>";
+ echo "</td>";
}
else {
if (count($sivR) > 1) {
- echo "<td></td>";
+ echo "<td width=\"24\"></td>";
}
}
if ($sivKn) {
+ echo "<td align=\"center\" valign=\"bottom\" width=\"24\">";
echo "<form method=\"post\">";
echo "<input type=\"hidden\" name=\"set\" value=\"sivM\">";
echo "<input type=\"hidden\" name=\"sieve\" value=\"$sivF\">";
echo "<input type=\"hidden\" name=\"sivM\" value=\"$sivKn\">";
- echo "<td valign=\"bottom\" width=\"24\"><input type=\"image\" src=\"images/sieve-down.png\"></td>";
+ echo "<input type=\"image\" src=\"images/sieve-down.png\">";
echo "</form>";
+ echo "</td>";
}
else {
if (count($sivR) > 1) {
- echo "<td></td>";
+ echo "<td width=\"24\"></td>";
}
}
- echo "<td>If message {$sivC[3]} contains {$sivC[5]} then move to {$sivC[7]}</td>";
+
+ echo "<td><nobr>If message {$sivC[3]} contains {$sivC[5]} then move to {$sivC[7]}</nobr></td>";
echo "</tr>";
}
-
echo "</table>";
}
@@ -1697,7 +1721,7 @@ echo "</tr>";
// imap_ping() should be doing this, but it's not working:
$mbox = @imap_open("{$imap_host}$folder", $_SESSION['logged_uid'], $_SESSION['logged_key'], CL_EXPUNGE) or die(imap_last_error());
- if ((count($_POST) == 0) or ((count($_POST) == 3) and array_key_exists('x',$_POST) and array_key_exists('y',$_POST) and ($_POST['box'] == "INBOX"))) {
+ if (($_POST['lvl'] == "subscriber") or (count($_POST) == 0) or ((count($_POST) == 3) and array_key_exists('x',$_POST) and array_key_exists('y',$_POST) and ($_POST['box'] == "INBOX"))) {
echo '<script src="//ajax.googleapis.com/ajax/libs/jquery/2.0.3/jquery.min.js"></script>';
echo '<script>window.jQuery||document.write(\'<script src="jquery-2.0.3.min.js"><\/script>\')</script>';
diff --git a/post.php b/post.php
index 3056597..06b5413 100644
--- a/post.php
+++ b/post.php
@@ -64,10 +64,12 @@ if (isset($_POST['new']) and !empty($_POST['new']) and is_numeric($_POST['new'])
echo "<td width=\"10\"></td>";
echo "<td valign=\"middle\"><input type=\"checkbox\" name=\"reply_dr\"></td><td valign=\"middle\">delivery receipt</td>";
echo "<td width=\"10\"></td>";
+ echo "<td valign=\"middle\"><input type=\"checkbox\" name=\"reply_sm\"></td><td valign=\"middle\">sign</td>";
+ echo "<td width=\"10\"></td>";
echo "<td valign=\"middle\"><input type=\"checkbox\" name=\"reply_dm\" id=\"reply_dm\" onclick=\"if (this.checked) { document.getElementById('reply_go').innerHTML='save'; } else { document.getElementById('reply_go').innerHTML='send'; }\"></td><td valign=\"middle\">draft</td>";
echo "</tr></table>";
- echo "</td><td align=\"right\"><div class=\"label\"><input type=\"image\" src=\"images/mail-reply.png\" onclick=\"if (document.getElementById('reply_dm').checked) { if (confirm('Save message?')) {return true;} else {return false;}} else { if (confirm('Send message?')) {return true;} else {return false;}}\"></div><div class=\"label\" id=\"reply_go\">send</div></td></tr>";
+ echo "</td><td align=\"right\"><table border=\"0\" cellspacing=\"0\" cellpadding=\"0\"><tr><td><input type=\"image\" src=\"images/mail-reply.png\" onclick=\"if (document.getElementById('reply_dm').checked) { if (confirm('Save message?')) {return true;} else {return false;}} else { if (confirm('Send message?')) {return true;} else {return false;}}\"></td><td width=\"40\" align=\"center\" valign=\"middle\" id=\"reply_go\">send</span></td></tr></table></td></tr>";
echo "</table>";
diff --git a/preload.php b/preload.php
index 8df500c..fa2f694 100644
--- a/preload.php
+++ b/preload.php
@@ -4,6 +4,8 @@ $preload_images = glob("images/{*.gif,*.jpg,*.png}",GLOB_BRACE);
foreach ($preload_images as $preload_image) {
echo "<img src=\"$preload_image\">";
+ //echo "<link rel=\"prefetch\" href=\"$preload_image\">\n";
+ //echo "<link rel=\"prerender\" href=\"$preload_image\">\n\n";
}
?>
diff --git a/rcpt.php b/rcpt.php
index f0dfae7..13f3dbe 100644
--- a/rcpt.php
+++ b/rcpt.php
@@ -23,8 +23,8 @@ $rcpt_date = trim(strip_tags($_POST['rcpt_date']));
$rcpt_part = md5(microtime(true));
$rcpt_omid = trim($_POST['rcpt_omid']);
$rcpt_omno = trim($_POST['rcpt_omno']);
-$rcpt_head = "From: $rcpt_user\nX-Mailer: Kartero/1.0 (PHP/" . phpversion() . ")\nMIME-Version: 1.0\nContent-Type: multipart/report;report-type=disposition-notification;boundary=\"$rcpt_part\"";
-$rcpt_body = "--$rcpt_part\nContent-Type: text/plain; charset=\"iso-8859-1\"\nContent-Transfer-Encoding: quoted-printable\n\nYour message\n\nTo: $rcpt_user\nSubject: $rcpt_subj\nDate: $rcpt_date\n\nWas displayed on " . date("D, j M Y H:i:s O (T)") . "\n\n--$rcpt_part\nContent-Type: message/disposition-notification\nContent-Transfer-Encoding: quoted-printable\n\nReporting-UA : " . $_SERVER['SERVER_NAME'] . " ; Kartero/1.0 (PHP/" . phpversion() . ")\nOriginal-Recipient : $rcpt_mail\nFinal-Recipient : rfc822;\nOriginal-Message-ID : $rcpt_omid\nDisposition: manual-action/MDN-sent-manually; displayed\n--$rcpt_part--";
+$rcpt_head = "From: $rcpt_user\nX-Mailer: Kartero/2.0 (PHP/" . phpversion() . ")\nMIME-Version: 1.0\nContent-Type: multipart/report;report-type=disposition-notification;boundary=\"$rcpt_part\"";
+$rcpt_body = "--$rcpt_part\nContent-Type: text/plain; charset=\"iso-8859-1\"\nContent-Transfer-Encoding: quoted-printable\n\nYour message\n\nTo: $rcpt_user\nSubject: $rcpt_subj\nDate: $rcpt_date\n\nWas displayed on " . date("D, j M Y H:i:s O (T)") . "\n\n--$rcpt_part\nContent-Type: message/disposition-notification\nContent-Transfer-Encoding: quoted-printable\n\nReporting-UA : " . $_SERVER['SERVER_NAME'] . " ; Kartero/2.0 (PHP/" . phpversion() . ")\nOriginal-Recipient : $rcpt_mail\nFinal-Recipient : rfc822;\nOriginal-Message-ID : $rcpt_omid\nDisposition: manual-action/MDN-sent-manually; displayed\n--$rcpt_part--";
$rcpt_subj = "Read: $rcpt_subj";
mail($rcpt_mail, $rcpt_subj, $rcpt_body, $rcpt_head, "-f $rcpt_user");
diff --git a/read.php b/read.php
index e96c99a..97f410a 100644
--- a/read.php
+++ b/read.php
@@ -64,6 +64,15 @@ if (isset($_POST['msg']) and !empty($_POST['msg']) and is_numeric($_POST['msg'])
if (strstr($header_raw_line,"Return-Receipt-To:")) {
$header_dr = $header_raw_line;
}
+
+ if (strstr($header_raw_line,"Content-Type:")) {
+ if (strstr($header_raw_line, 'multipart/signed') or strstr($header_raw_line, 'pkcs7')) {
+ $header_smime = 1;
+ }
+ else {
+ $header_smime = 0;
+ }
+ }
}
if (isset($_POST['imap_search_query']) and !empty($_POST['imap_search_query']) and isset($_POST['imap_search_where']) and !empty($_POST['imap_search_where'])) {
@@ -129,13 +138,13 @@ if (isset($_POST['msg']) and !empty($_POST['msg']) and is_numeric($_POST['msg'])
if (($filePicSize[0] > 0) and ($filePicSize[1] > 0)) {
- //echo "<style> .apic { padding: 3px; background: #fff; -moz-box-shadow: 1px 1px 3px #222; -khtml-box-shadow: 1px 1px 3px #222; -webkit-box-shadow: 1px 1px 3px #222; box-shadow: 1px 1px 3px #222; } </style>";
+ //echo "<style> .apic { padding: 0.188rem; background: #fff; -moz-box-shadow: 0.063rem 0.063rem 0.188rem #222; -khtml-box-shadow: 0.063rem 0.063rem 0.188rem #222; -webkit-box-shadow: 0.063rem 0.063rem 0.188rem #222; box-shadow: 0.063rem 0.063rem 0.188rem #222; } </style>";
echo "<img class=\"apic\" src=\"$filePic\" border=\"0\" width=\"{$filePicSize[0]}\" height=\"{$filePicSize[1]}\" align=\"right\">";
}
}
if ($header_priority != "") {
- echo "<b style=\"color: red; text-shadow: 0.1em 0.1em #dedede;\">!</b> ";
+ echo "<b style=\"color: red; text-shadow: 1px 1px #dedede; text-shadow: 0.1rem 0.1rem #dedede;\">!</b> ";
}
echo "<b>Subject: $header_subject</b>";
@@ -154,7 +163,8 @@ if (isset($_POST['msg']) and !empty($_POST['msg']) and is_numeric($_POST['msg'])
echo "<br>Date: $header_date ($header_date_age ago)";
}
else {
- echo "<br>Date: <font color=\"red\">Missing! Sender is non-standards compliant or message is probably spam.</font>";
+ //echo "<br>Date: <font color=\"red\">Missing! Sender is non-standards compliant or message is probably spam.</font>";
+ echo "<br>Date: <font color=\"red\">MISSING</font>";
}
if ($header_mailer != "") {
@@ -165,6 +175,15 @@ if (isset($_POST['msg']) and !empty($_POST['msg']) and is_numeric($_POST['msg'])
echo "<br>$header_user_agent";
}
+ echo '<br>Signature: ';
+
+ if ($header_smime === 1) {
+ kartero_smime_verify(imap_fetchbody($mbox, $msgno, '', FT_UID));
+ }
+ else {
+ echo 'NONE';
+ }
+
echo "<a style=\"float: right;\" id=\"headerM\" onclick=\"document.getElementById('header1').className ='message';document.getElementById('header2').className='spacer';document.getElementById('headerL').style.display='inline';document.getElementById('headerM').style.display='none'\">...</a>";
echo "<a class=\"hide\" style=\"float: right;\" id=\"headerL\" onclick=\"document.getElementById('header1').className ='hide';document.getElementById('header2').className='hide';document.getElementById('headerL').style.display='none';document.getElementById('headerM').style.display='inline'\">...</a>";
@@ -180,7 +199,7 @@ if (isset($_POST['msg']) and !empty($_POST['msg']) and is_numeric($_POST['msg'])
$fileDir = sha1(microtime(true));
- echo "<div class=\"message\" style=\"padding: 2px;\">";
+ echo "<div class=\"message\" style=\"padding: 2px; padding: 0.125rem;\">";
echo "<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\" width=\"100%\"><tr>";
@@ -449,10 +468,13 @@ if (isset($_POST['msg']) and !empty($_POST['msg']) and is_numeric($_POST['msg'])
}
else {
$msgBody = trim($bodyTEXT);
+
+ $msgBody = htmlentities($msgBody,ENT_QUOTES,"UTF-8");
+
$msgBody = nl2br($msgBody);
$msgBody = preg_replace("/([^\w\/])(www\.[a-z0-9\-]+\.[a-z0-9\-]+)/i","$1http://$2",$msgBody);
$msgBody = preg_replace("/([\w]+:\/\/[\w-?&;#~=\.\/\@]+[\w\/])/i","<a target=\"_blank\" href=\"$1\">$1</a>",$msgBody);
- $msgBody = preg_replace("/([\w-?&;#~=\.\/]+\@(\[?)[a-zA-Z0-9\-\.]+\.([a-zA-Z]{2,3}|[0-9]{1,3})(\]?))/i","<a href=\"mailto:$1\">$1</a>",$msgBody);
+ $msgBody = preg_replace("/([\w-?&;#~=\.\/]+\@(\[?)[a-zA-Z0-9\-\.]+\.([a-zA-Z]{2,63}|[0-9]{1,3})(\]?))/i","<a href=\"mailto:$1\">$1</a>",$msgBody);
}
$msgBody = mb_convert_encoding($msgBody,"UTF-8","auto");
@@ -488,7 +510,7 @@ if (isset($_POST['msg']) and !empty($_POST['msg']) and is_numeric($_POST['msg'])
echo "<div class=\"message\" style=\"position: relative;\">";
- echo "<div style=\"position: absolute; top: -15px; right: -15px;\"><img src=\"images/attach.png\" border=\"0\" width=\"48\" height=\"48\"></div>";
+ echo "<div style=\"position: absolute; top: -15px; top: -0.938rem; right: -15px; right: -0.938rem;\"><img src=\"images/attach.png\" border=\"0\" width=\"48\" height=\"48\"></div>";
echo "<table border=\"0\" cellspacing=\"1\" cellpadding=\"2\">";
@@ -575,5 +597,5 @@ if (isset($header_rr) and (strlen($header_rr) > 0)) {
echo "<script>if (confirm('The message sender has requested a response to indicate that you have read this message.\\nWould you like to send a receipt?')) { document.getElementById('receipt').submit(); }</script>";
}
}
-
+
?>
diff --git a/rel.txt b/rel.txt
index c653a39..a7d6c4f 100644
--- a/rel.txt
+++ b/rel.txt
@@ -1 +1 @@
-20100123
\ No newline at end of file
+2.0-20150918
diff --git a/send.php b/send.php
index 4f45b66..f1ba2d7 100644
--- a/send.php
+++ b/send.php
@@ -327,6 +327,8 @@ if (isset($_POST['msg']) and !empty($_POST['msg']) and is_numeric($_POST['msg'])
echo "<td valign=\"middle\"><input type=\"checkbox\" name=\"reply_dr\"></td><td valign=\"middle\">delivery receipt</td>";
}
+ echo "<td width=\"10\"></td>";
+ echo "<td valign=\"middle\"><input type=\"checkbox\" name=\"reply_sm\"></td><td valign=\"middle\">sign</td>";
echo "<td width=\"10\"></td>";
echo "<td valign=\"middle\"><input type=\"checkbox\" name=\"reply_dm\" id=\"reply_dm\" onclick=\"if (this.checked) { document.getElementById('reply_go').innerHTML='save'; } else { document.getElementById('reply_go').innerHTML='send'; }\"></td><td valign=\"middle\">draft</td>";
echo "</tr></table>";
@@ -339,16 +341,18 @@ if (isset($_POST['msg']) and !empty($_POST['msg']) and is_numeric($_POST['msg'])
echo "<td width=\"10\"></td>";
echo "<td valign=\"middle\"><input type=\"checkbox\" name=\"reply_dr\"></td><td valign=\"middle\">delivery receipt</td>";
echo "<td width=\"10\"></td>";
+ echo "<td valign=\"middle\"><input type=\"checkbox\" name=\"reply_sm\"></td><td valign=\"middle\">sign</td>";
+ echo "<td width=\"10\"></td>";
echo "<td valign=\"middle\"><input type=\"checkbox\" name=\"reply_dm\" id=\"reply_dm\" onclick=\"if (this.checked) { document.getElementById('reply_go').innerHTML='save'; } else { document.getElementById('reply_go').innerHTML='send'; }\"></td><td valign=\"middle\">draft</td>";
echo "</tr></table>";
}
}
if ($_POST['rep'] != 4) {
- echo "</td><td align=\"right\"><div class=\"label\"><input type=\"image\" src=\"images/mail-reply.png\" onclick=\"if (document.getElementById('reply_dm').checked) { if (confirm('Save message?')) {return true;} else {return false;}} else { if (confirm('Send message?')) {return true;} else {return false;}}\"></div><div class=\"label\" id=\"reply_go\">send</div></td></tr>";
+ echo "</td><td align=\"right\"><table border=\"0\" cellspacing=\"0\" cellpadding=\"0\"><tr><td><input type=\"image\" src=\"images/mail-reply.png\" onclick=\"if (document.getElementById('reply_dm').checked) { if (confirm('Save message?')) {return true;} else {return false;}} else { if (confirm('Send message?')) {return true;} else {return false;}}\"></td><td width=\"40\" align=\"center\" valign=\"middle\" id=\"reply_go\">send</td></tr></table></td></tr>";
}
else {
- echo "</td><td align=\"right\"><div class=\"label\"><input type=\"image\" src=\"images/mail-reply.png\" onclick=\"if (confirm('Send message?')) {return true;} else {return false;}\"></div><div class=\"label\" id=\"reply_go\">send</div></td></tr>";
+ echo "</td><td align=\"right\"><table border=\"0\" cellspacing=\"0\" cellpadding=\"0\"><tr><td><input type=\"image\" src=\"images/mail-reply.png\" onclick=\"if (confirm('Send message?')) {return true;} else {return false;}\"></td><td width=\"40\" align=\"center\" valign=\"middle\" id=\"reply_go\">send</td></tr></table></td></tr>";
}
echo "</table>";