JavaMail message getReceivedDate() and getSentDate() - email

I'm using JavaMail 1.4.7, and a specific message in my mail account contains the header:
Received: from ... (localhost.localdomain [127.0.0.1])
by ... (lmtpd) with LMTP id 25811.002;
Tue, 12 Nov 2013 16:52:11 +0100 (CET)
Subject: CONSEGNA: numerodacontare
Date: Tue, 12 Nov 2013 16:52:11 +0100
And for this message
getReceivedDate() =Tue Nov 12 16:52:10 CET 2013
getSentDate() =Tue Nov 12 16:52:11 CET 2013
So it seems that the message has been received before sending it.
How should this be interpreted?
What is exactly the difference?
Is this behavior common for all mail server?

Related

Why is EmailHeaders analyzer showing blank "from" information while there is one in the X-Received of email header

I am trying to understand the email header and I found out using email header checker (i.g. mxtoolbox) can easily get the information. But I wonder how does this work?
For example, I have a email header showing like this:
Received: from DM5PR04MB0251.namprd04.prod.outlook.com (::1) by
DM6PR04MB6592.namprd04.prod.outlook.com with HTTPS; Tue, 13 Sep 2022 00:17:52
+0000
Received: from DB6PR1001CA0016.EURPRD10.PROD.OUTLOOK.COM (2603:10a6:4:b7::26)
by DM5PR04MB0251.namprd04.prod.outlook.com (2603:10b6:3:74::12) with
Microsoft SMTP Server (version=TLS1_2,
cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5612.22; Tue, 13 Sep
2022 00:17:51 +0000
Received: from DB8EUR06FT019.eop-eur06.prod.protection.outlook.com
(2603:10a6:4:b7:cafe::4b) by DB6PR1001CA0016.outlook.office365.com
(2603:10a6:4:b7::26) with Microsoft SMTP Server (version=TLS1_2,
cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5612.14 via Frontend
Transport; Tue, 13 Sep 2022 00:17:51 +0000
...
...
And it shows blank in the from information.
Do you know why is this?

Google Transaction in German leads to "Sorry, I didn't get any response."

I created a pure German example of https://github.com/actions-on-google/dialogflow-transactions-nodejs .
When I trigger the action via phone (or web Simulator) and go into the first step "transaction_check_nopayment" I see in the logs that the method is called but in the client I get as response: "Sorry, I didn't get any response."
What could be the problem? how to get closer to the problem?
Here is the log:
2018-01-08T08:03:20.685Z I transactions: Mon, 08 Jan 2018 08:03:20 GMT actions-on-google:debug checkForTransactionRequirements: transactionConfig=undefined, dialogState=undefined
2018-01-08T08:03:20.685Z I transactions: Mon, 08 Jan 2018 08:03:20 GMT actions-on-google:debug fulfillSystemIntent_: intent=actions.intent.TRANSACTION_REQUIREMENTS_CHECK, specType=type.googleapis.com/google.actions.v2.TransactionRequirementsCheckSpec, intentSpec={}, promptPlaceholder=PLACEHOLDER_FOR_TXN_REQUIREMENTS dialogState=undefined
2018-01-08T08:03:20.685Z I transactions: Mon, 08 Jan 2018 08:03:20 GMT actions-on-google:debug buildResponse_: textToSpeech=PLACEHOLDER_FOR_TXN_REQUIREMENTS, expectUserResponse=true, noInputs=undefined
2018-01-08T08:03:20.686Z I transactions: Mon, 08 Jan 2018 08:03:20 GMT actions-on-google:debug isSsml_: text=PLACEHOLDER_FOR_TXN_REQUIREMENTS
2018-01-08T08:03:20.690Z I transactions: Mon, 08 Jan 2018 08:03:20 GMT actions-on-google:debug getUser
2018-01-08T08:03:20.691Z I transactions: Mon, 08 Jan 2018 08:03:20 GMT actions-on-google:debug doResponse_: response={"speech":"PLACEHOLDER_FOR_TXN_REQUIREMENTS","contextOut":[{"name":"_actions_on_google_","lifespan":100,"parameters":{}}],"data":{"google":{"expectUserResponse":true,"noInputPrompts":[],"isSsml":false,"systemIntent":{"intent":"actions.intent.TRANSACTION_REQUIREMENTS_CHECK","data":{"#type":"type.googleapis.com/google.actions.v2.TransactionRequirementsCheckSpec"}}}}}, responseCode=200
2018-01-08T08:03:20.691Z I transactions: Mon, 08 Jan 2018 08:03:20 GMT actions-on-google:debug isNotApiVersionOne_
2018-01-08T08:03:20.691Z I transactions: Mon, 08 Jan 2018 08:03:20 GMT actions-on-google:debug Response {"speech":"PLACEHOLDER_FOR_TXN_REQUIREMENTS","contextOut":[{"name":"_actions_on_google_","lifespan":100,"parameters":{}}],"data":{"google":{"expectUserResponse":true,"noInputPrompts":[],"isSsml":false,"systemIntent":{"intent":"actions.intent.TRANSACTION_REQUIREMENTS_CHECK","data":{"#type":"type.googleapis.com/google.actions.v2.TransactionRequirementsCheckSpec"}}}}}
2018-01-08T08:03:20.693712230Z D transactions: Function execution took 627 ms, finished with status code: 200
2018-01-08T08:03:20.698Z I transactions: Mon, 08 Jan 2018 08:03:20 GMT actions-on-google:debug undefined
When I compare the logs for the working English version and the not working German version for this step I see a difference:
In the English log every lines ends with "transactions hyd4scvzft31". This part I miss in the German logs.
However in the configuration of my German app I also answered "Does your app perform Transactions?" with YES.
In the example on transaction_check_nopayment app.askForTransactionRequirements() is called. May be askForTransactionRequirements() is not supported in German? Is there an overview of the transaction-API documenting the supported languages? Should the transaction API work for a German use case? As payment method I have invoice. When I understand the documentation this is like having no payment in the google-API.
Hidden under Policies and Terms > Other > Special Requirements for Certain Use Cases, Google states 'Currently, the Transactions API is only available in the United States; apps in other countries cannot implement the API or complete transactions until the API is available there.'
Source

Why are jobs queued twice by beanstalkd after 2 minutes

I have the following environment and I notice that the jobs are queued twice randomly after 2 minutes:
Web App based on PHP F3 framework
Pheanstalk 3.0.2 using composer in the app
Beanstalkd server
Beanstalkd console app
Supervisord
Worker scenario: entering multiple jobs to bulk delete clients
Issue: same job (already processed) is queued twice after 2 minutes with different ID
I use the following code:
$queue = new Pheanstalk\Pheanstalk("127.0.0.1:14803");
$queue->watch("tubeDelete");
while ($job = $queue->reserve()) {
$log->write("Entering Job {$job->getId()} \n");
$log->write("Job {$job->getId()} data : {$job->getData()} \n");
$data = json_decode($job->getData(), true);
try {
$deleteResponse = $client->deleteClient($clientId)
if($deleteResponse){
$log->write("client $clientId deleted successfully");
$queue->delete($job);
}else{
$log->write("Failed to delete client $clientId, check the log file");
$queue->bury($job);
}
} catch (Exception $e) {
$log->write("Failed to delete client $clientId with PHP exception, check the log file");
$queue->bury($job);
}
}
Log file:
Fri, 08 Dec 2017 13:00:23 +0200 Entering Job 92428501
Fri, 08 Dec 2017 13:00:23 +0200 Job 92428501 data : {"clientId":"1397"}
Fri, 08 Dec 2017 13:00:24 +0200 Client 1397 deleted successfully
Fri, 08 Dec 2017 13:00:24 +0200 Entering Job 92428502
Fri, 08 Dec 2017 13:00:24 +0200 Job 92428502 data : {"clientId":"1398"}
Fri, 08 Dec 2017 13:00:26 +0200 Client 1398 deleted successfully
Fri, 08 Dec 2017 13:00:26 +0200 Entering Job 92428503
Fri, 08 Dec 2017 13:00:26 +0200 Job 92428503 data : {"clientId":"1399"}
Fri, 08 Dec 2017 13:00:28 +0200 Client 1399 deleted successfully
Fri, 08 Dec 2017 13:00:28 +0200 Entering Job 92428504
Fri, 08 Dec 2017 13:00:28 +0200 Job 92428504 data : {"clientId":"1401"}
Fri, 08 Dec 2017 13:00:30 +0200 Client 1401 deleted successfully
Fri, 08 Dec 2017 13:00:30 +0200 Entering Job 92428505
Fri, 08 Dec 2017 13:00:30 +0200 Job 92428505 data : {"clientId":"1402"}
Fri, 08 Dec 2017 13:00:31 +0200 Client 1402 deleted successfully
Fri, 08 Dec 2017 13:00:31 +0200 Entering Job 92428506
Fri, 08 Dec 2017 13:00:31 +0200 Job 92428506 data : {"clientId":"1403"}
Fri, 08 Dec 2017 13:00:33 +0200 Client 1403 deleted successfully
Fri, 08 Dec 2017 13:00:33 +0200 Entering Job 92428507
Fri, 08 Dec 2017 13:00:33 +0200 Job 92428507 data : {"clientId":"1404"}
Fri, 08 Dec 2017 13:00:34 +0200 Client 1404 deleted successfully
Fri, 08 Dec 2017 13:00:34 +0200 Entering Job 92428508
Fri, 08 Dec 2017 13:00:34 +0200 Job 92428508 data : {"clientId":"1405"}
Fri, 08 Dec 2017 13:00:36 +0200 Client 1405 deleted successfully
Fri, 08 Dec 2017 13:00:36 +0200 Entering Job 92428509
Fri, 08 Dec 2017 13:00:36 +0200 Job 92428509 data : {"clientId":"1409"}
Fri, 08 Dec 2017 13:00:37 +0200 Client 1409 deleted successfully
Fri, 08 Dec 2017 13:00:37 +0200 Entering Job 92428510
Fri, 08 Dec 2017 13:00:37 +0200 Job 92428510 data : {"clientId":"1421"}
Fri, 08 Dec 2017 13:00:38 +0200 Client 1421 deleted successfully
Fri, 08 Dec 2017 13:02:23 +0200 Entering Job 92428511
Fri, 08 Dec 2017 13:02:23 +0200 Job 92428511 data : {"clientId":"1397"}
Fri, 08 Dec 2017 13:02:23 +0200 Client 1397 deleted successfully
Fri, 08 Dec 2017 13:02:23 +0200 Entering Job 92428512
Fri, 08 Dec 2017 13:02:23 +0200 Job 92428512 data : {"clientId":"1398"}
Fri, 08 Dec 2017 13:02:23 +0200 Client 1398 deleted successfully
Fri, 08 Dec 2017 13:02:23 +0200 Entering Job 92428513
Fri, 08 Dec 2017 13:02:23 +0200 Job 92428513 data : {"clientId":"1399"}
Fri, 08 Dec 2017 13:02:24 +0200 Client 1399 deleted successfully
Fri, 08 Dec 2017 13:02:24 +0200 Entering Job 92428514
Fri, 08 Dec 2017 13:02:24 +0200 Job 92428514 data : {"clientId":"1401"}
Fri, 08 Dec 2017 13:02:24 +0200 Client 1401 deleted successfully
Fri, 08 Dec 2017 13:02:24 +0200 Entering Job 92428515
Fri, 08 Dec 2017 13:02:24 +0200 Job 92428515 data : {"clientId":"1402"}
Fri, 08 Dec 2017 13:02:24 +0200 Client 1402 deleted successfully
Fri, 08 Dec 2017 13:02:24 +0200 Entering Job 92428516
Fri, 08 Dec 2017 13:02:24 +0200 Job 92428516 data : {"clientId":"1403"}
Fri, 08 Dec 2017 13:02:24 +0200 Client 1403 deleted successfully
Fri, 08 Dec 2017 13:02:24 +0200 Entering Job 92428517
Fri, 08 Dec 2017 13:02:24 +0200 Job 92428517 data : {"clientId":"1404"}
Fri, 08 Dec 2017 13:02:24 +0200 Client 1404 deleted successfully
Fri, 08 Dec 2017 13:02:24 +0200 Entering Job 92428518
Fri, 08 Dec 2017 13:02:24 +0200 Job 92428518 data : {"clientId":"1405"}
Fri, 08 Dec 2017 13:02:24 +0200 Client 1405 deleted successfully
Fri, 08 Dec 2017 13:02:24 +0200 Entering Job 92428519
Fri, 08 Dec 2017 13:02:24 +0200 Job 92428519 data : {"clientId":"1409"}
Fri, 08 Dec 2017 13:02:24 +0200 Client 1409 deleted successfully
Fri, 08 Dec 2017 13:02:24 +0200 Entering Job 92428520
Fri, 08 Dec 2017 13:02:24 +0200 Job 92428520 data : {"clientId":"1421"}
Fri, 08 Dec 2017 13:02:24 +0200 Client 1421 deleted successfully
So, you can find the repeated clients due to executing the same job after 2 minutes, for example:
Fri, 08 Dec 2017 13:00:23 +0200 Entering Job 92428501
Fri, 08 Dec 2017 13:00:23 +0200 Job 92428501 data : {"clientId":"1397"}
Fri, 08 Dec 2017 13:00:24 +0200 Client 1397 deleted successfully
Fri, 08 Dec 2017 13:02:23 +0200 Entering Job 92428511
Fri, 08 Dec 2017 13:02:23 +0200 Job 92428511 data : {"clientId":"1397"}
Fri, 08 Dec 2017 13:02:23 +0200 Client 1397 deleted successfully
Is it the issue related to TTR / DEADLINE_SOON / configuration issue or related to supervisord?

Delay in receiving emails sent from SendGrid (app is on Windows Azure, mvc.net)

I send an email through send grid using SendGridMessage.DeliverAsync. It takes about 20 minutes for the email to arrive. I am pasting below the header information of the email as received by the recipient. All company information has been replaced by fictional data:
Return-path: <bounces+1776648-b90d-rec=example.com#sendgrid.me>
Envelope-to: rec#example.com
Delivery-date: Wed, 27 May 2015 15:48:53 -0400
Received: from o1.f.az.sendgrid.net ([208.117.55.132]:22426)
by server37.web-hosting.com with esmtps (UNKNOWN:DHE-RSA-AES128-GCM-SHA256:128)
(Exim 4.82)
(envelope-from <bounces+1776648-b90d-rec=example.com#sendgrid.me>)
id 1YxhJt-003sMA-8G
for rec#example.com; Wed, 27 May 2015 15:48:53 -0400
DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sendgrid.me;
h=content-type:mime-version:from:to:subject; s=smtpapi;
bh=e8YGVEGwW8wzxqhpuiTstqZPRIs=; b=MLyTlQTi5Y4eOlmcNk65t0Fqv+8cp
WoAtekeb+ld1HBI1kk4CQ1ycmJ7LP6r/ZJKI0+0+fwy0hsO5F7ywT7twv6t9Z/M2
BYxCuE5heMWP5tjyIkfJYjIDf8fT3OM43bq30+NC69GQWJFr+CHn2ms/OgmSahvD
PhQ71p1yBFagxY=
Received: by filter-403.sjc1.sendgrid.net with SMTP id filter-403.17268.55661A831A
2015-05-27 19:27:00.592426035 +0000 UTC
Received: from MTc3NjY0OA (unknown [23.97.229.110])
by ismtpd-004 (SG) with HTTP id 14d96d793b7.30c5.15e6fe
Wed, 27 May 2015 19:27:00 +0000 (UTC)
Content-Type: multipart/alternative;
boundary="===============1502686111627047378=="
MIME-Version: 1.0
From: Example Support <admin#example.com>
To: Rec Martel <rec#example.com>
Subject: Thank you for Signing up with Example!
Message-ID: <14d96d793b7.30c5.15e6fe#ismtpd-004>
Date: Wed, 27 May 2015 19:27:12 +0000 (UTC)
X-SG-EID: IASZyfUggCe5SBfFgEPkfXBDb6ZCY09R57ALGWkRenTMTMZdvb6XDq63Z6REVqqqqh1THbQI2y+Su7
fi7CkNm41AX9xYJayZj7L4Nq9kdKIQjkQVy89oVT4OWeRVj/QSAmE5TEgSMY+XRBmQ/JygwCuz1U6r
eB7+RE6w3Aht84U=
X-From-Rewrite: unmodified, no actual sender determined from check mail permissions
Can anyone tell me why the delay is happening and how can I fix it?
Regards,
Zawar
If you experienced this within the last hour (as per your question timestamp) it is likely because Sendgrid is currently experiencing a serious outage which is causing ~60 min. email delays in some cases.

getting lots of spam from "unknown" and helo localhost

On our server, we keep receiving spam with the following headers. We are using whm 11.44 and exim.
Return path is always:
Return-path: <>
and it says Received: from unknown (HELO localhost)
Both which raise flags. We're just not sure exactly how to stop/reject them.
From - Mon Feb 16 14:27:02 2015
X-Account-Key: account3
X-UIDL: UID10475-1296887657
X-Mozilla-Status: 0001
X-Mozilla-Status2: 00000000
X-Mozilla-Keys:
Return-path: <>
Envelope-to: me#myserver.com
Delivery-date: Mon, 16 Feb 2015 09:13:38 -0600
Received: from [122.160.73.62] (port=10732 helo=122.160.73.62)
by myserver.myserver.com with smtp (Exim 4.82)
id 1YNN0Z-00056c-7P
for me#myserver.com; Mon, 16 Feb 2015 08:50:47 -0600
Received: from unknown (HELO localhost) (intlimd#highgrove.net#214.92.72.48)
by 122.160.73.62 with ESMTPA; Mon, 16 Feb 2015 20:23:11 +0530
From: intlimd#highgrove.net
To: myemail#myserver.com
Subject: Do not disapoint your girl this night
http://mandatory.natur.com/ Real magic in your life
Can you please check the full logs of your this mail with the following command and let me know so that we can assist you.
cat /var/log/exim_mainlog | grep 1YNN0Z-00056c-7P