Permalink
Browse files

Convert to math

  • Loading branch information...
eriklax committed Jan 25, 2019
1 parent 5e976d6 commit e0d4e73bc887bb7225b037b692a601b857654b7a
@@ -7,9 +7,6 @@ function sendlog($logdata = []) {
global $saslusername, $saslmechanism, $saslstate, $saslresponse; // auth

$time = time();
$receivedtime = str_replace(".", "", $time);
if (strlen($receivedtime) > 13) $receivedtime = substr($receivedtime, 0, 13);

$logdata += [
"serial" => serial(),
"hostname" => gethostname(),
@@ -25,7 +22,7 @@ function sendlog($logdata = []) {
"saslmechanism" => $saslmechanism,
"saslstate" => $saslstate,
"saslresponse" => $saslresponse,
"receivedtime" => $receivedtime
"receivedtime" => round($time * 1000)
];

$path = "/".$indexname."-".strftime($indexrotate, $time)."/".$indextype;
@@ -5,9 +5,6 @@ function sendlog($logdata = []) {
global $transaction, $senderip, $senderport, $serverip, $serverport, $serverid; // connect

$time = time();
$receivedtime = str_replace(".", "", $time);
if (strlen($receivedtime) > 13) $receivedtime = substr($receivedtime, 0, 13);

$logdata += [
"serial" => serial(),
"hostname" => gethostname(),
@@ -17,7 +14,7 @@ function sendlog($logdata = []) {
"serverip" => $serverip,
"serverport" => $serverport,
"serverid" => $serverid,
"receivedtime" => $receivedtime
"receivedtime" => round($time * 1000)
];

$path = "/".$indexname."-".strftime($indexrotate, $time)."/".$indextype;
@@ -8,9 +8,6 @@ function sendlog($logdata = []) {
global $recipient, $recipientlocalpart, $recipientdomain, $transportid, $actionid; // eodrcpt

$time = time();
$receivedtime = str_replace(".", "", $time);
if (strlen($receivedtime) > 13) $receivedtime = substr($receivedtime, 0, 13);

$logdata += [
"serial" => serial(),
"hostname" => gethostname(),
@@ -35,7 +32,7 @@ function sendlog($logdata = []) {
"actionid" => $actionid,
"subject" => MIME("0")->getHeader("subject"),
"size" => MIME("0")->getSize(),
"receivedtime" => $receivedtime
"receivedtime" => round($time * 1000)
];

$path = "/".$indexname."-".strftime($indexrotate, $time)."/".$indextype."/".$messageid.":".$actionid;
@@ -6,9 +6,6 @@ function sendlog($logdata = []) {
global $tlsstarted, $saslauthed, $saslusername, $senderhelo, $senderhelotype; // helo

$time = time();
$receivedtime = str_replace(".", "", $time);
if (strlen($receivedtime) > 13) $receivedtime = substr($receivedtime, 0, 13);

$logdata += [
"serial" => serial(),
"hostname" => gethostname(),
@@ -23,7 +20,7 @@ function sendlog($logdata = []) {
"saslusername" => $saslusername,
"senderhelo" => $senderhelo,
"senderhelotype" => $senderhelotype,
"receivedtime" => $receivedtime
"receivedtime" => round($time * 1000)
];

$path = "/".$indexname."-".strftime($indexrotate, $time)."/".$indextype;
@@ -8,9 +8,6 @@ function sendlog($logdata = []) {
global $sender, $senderlocalpart, $senderdomain, $senderparams; // mailfrom

$time = time();
$receivedtime = str_replace(".", "", $time);
if (strlen($receivedtime) > 13) $receivedtime = substr($receivedtime, 0, 13);

$logdata += [
"serial" => serial(),
"hostname" => gethostname(),
@@ -28,7 +25,7 @@ function sendlog($logdata = []) {
"senderlocalpart" => $senderlocalpart,
"senderdomain" => $senderdomain,
"senderparams" => $senderparams,
"receivedtime" => $receivedtime
"receivedtime" => round($time * 1000)
];

$path = "/".$indexname."-".strftime($indexrotate, $time)."/".$indextype;
@@ -6,8 +6,6 @@ function sendlog() {
global $receivedtime, $retry, $retries, $errormsg, $errorcode, $errorndr, $transfertime, $action; // post-delivery

$time = time();
$finishedtime = str_replace(".", "", $time);
if (strlen($finishedtime) > 13) $finishedtime = substr($finishedtime, 0, 13);

$logdata["doc"] = [
"retry" => $retry,
@@ -24,7 +22,7 @@ function sendlog() {
"recipientlocalpart" => $recipientlocalpart,
"recipientdomain" => $recipientdomain,
"transportid" => $transportid,
"finishedtime" => $finishedtime
"finishedtime" => round($finishedtime * 1000)
];

$path = "/".$indexname."-".strftime($indexrotate, $receivedtime)."/".$indextype."/".$messageid.":".$actionid."/_update";
@@ -8,9 +8,6 @@ function sendlog($logdata = []) {
global $recipient, $recipientlocalpart, $recipientdomain, $recipientparams, $transportid; // rcptto

$time = time();
$receivedtime = str_replace(".", "", $time);
if (strlen($receivedtime) > 13) $receivedtime = substr($receivedtime, 0, 13);

$logdata += [
"serial" => serial(),
"hostname" => gethostname(),
@@ -33,7 +30,7 @@ function sendlog($logdata = []) {
"recipientdomain" => $recipientdomain,
"recipientparams" => $recipientparams
"transportid" => $transportid
"receivedtime" => $receivedtime
"receivedtime" => round($time * 1000)
];

$path = "/".$indexname."-".strftime($indexrotate, $time)."/".$indextype;

0 comments on commit e0d4e73

Please sign in to comment.