Dropbox search method fails to search - ruby

I am using "dropbox-sdk" gem to upload the files in DropBox account. I used the following method to search.
require "dropbox_sdk"
client = DropboxClient.new("ACCESS_TOKEN")
client.search("/", "myfile.ipa")
=> [{"rev"=>"86009",
"thumb_exists"=>false,
"path"=>"/App/myfile.ipa",
"is_dir"=>false,
"client_mtime"=>"Mon, 08 Sep 2014 18:59:17 +0000",
"icon"=>"page_white",
"bytes"=>5050139,
"modified"=>"Tue, 09 Sep 2014 17:55:05 +0000",
"size"=>"4.8 MB",
"root"=>"dropbox",
"mime_type"=>"application/octet-stream",
"revision"=>79144}]
client.search("/", "myfile.ipa")
=> []
i was able to get the response at first time. If i again search with the same file name, it returns with the empty response.
Any idea?

Related

Can anyone understand or read Microsoft anti-spam email headers?

I am setting up a small online business and have used wix.com to create a website.
I created some email triggers using the websites automations which send the emails on behalf of my email domain using ascendbywix.com.
The customer receives the email saying it is from my business email.
For all my gmail customers and yahoo customers, the email goes to their main inbox, however for hotmail/outlook customers it goes to they spam folder.
I have set up SPF/DKIM/DMARC records in my DNS host settings which I believe to be correct.
When I check the email header in hotmail, there are antispam messages I do not understand seen below.
Can anyone understand the email header output? or see anything which they believe would be the reason it is going to spam?
Received: from AM7EUR06HT029.eop-eur06.prod.protection.outlook.com
(2603:10a6:3:64::34) by HE1PR08MB2652.eurprd08.prod.outlook.com with HTTPS
via HE1PR0701CA0090.EURPRD07.PROD.OUTLOOK.COM; Thu, 4 Feb 2021 14:48:25 +0000
Received: from AM7EUR06FT016.eop-eur06.prod.protection.outlook.com
(2a01:111:e400:fc36::4a) by
AM7EUR06HT029.eop-eur06.prod.protection.outlook.com (2a01:111:e400:fc36::477)
with Microsoft SMTP Server (version=TLS1_2,
cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3784.11; Thu, 4 Feb
2021 14:48:24 +0000
Authentication-Results: spf=pass (sender IP is 147.253.213.104)
smtp.mailfrom=flyingenvelope.com; hotmail.com; dkim=pass (signature was
verified) header.d=marinovacreative.com;hotmail.com; dmarc=pass action=none
header.from=marinovacreative.com;compauth=pass reason=100
Received-SPF: Pass (protection.outlook.com: domain of flyingenvelope.com
designates 147.253.213.104 as permitted sender)
receiver=protection.outlook.com; client-ip=147.253.213.104;
helo=mta-213-104.sparkpostmail.com;
Received: from mta-213-104.sparkpostmail.com (147.253.213.104) by
AM7EUR06FT016.mail.protection.outlook.com (10.233.255.104) with Microsoft
SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id
15.20.3784.11 via Frontend Transport; Thu, 4 Feb 2021 14:48:24 +0000
X-IncomingTopHeaderMarker:
OriginalChecksum:31E79B1180793E43B997CB6D7EF1B1B52634389544AD89D8DAD7AB82D7D74DE8;UpperCasedChecksum:3C98413FB694439F968C81E9D2B39B604AC8E41D9420E2878411460931DAAC96;SizeAsReceived:2542;Count:15
X-MSFBL: fEFEtwcsscncA3dachCEwwgWXQVhgeNbrzCZYObNFZo=|eyJtZXNzYWdlX2lkIjo
iNjAxYjM3MDkxYzYwMTE3YTYzNDUiLCJzdWJhY2NvdW50X2lkIjoiNTA5ODQ0Iiw
iY3VzdG9tZXJfaWQiOiIxNzc1MSIsInIiOiJjYnJ5YW50ODdAaG90bWFpbC5jb20
iLCJ0ZW5hbnRfaWQiOiJzcGMifQ==
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=marinovacreative.com; s=sel1; t=1612450103;
i=#marinovacreative.com;
bh=b2tPAi0D6qfPEomU+dskh6Y0JGYrVSdbEPn59mXBlbY=;
h=To:Message-ID:Date:Content-Type:Subject:From;
b=NmEOTaXU6lAOYk/IBJm3AQibTi/wDFwTOkwar6TxjRBPuapbsfI2SRX03t4fFlbHb
XrVM1KV44KuwtThHSbjOP+uQiit6SsnKaIChpPzif+ROQhk8cA+rrgoBt0wq0MPMqC
SX0TX4+yrUg7f+OJIthnb+jRWj6ZW+Dnwa8YDx/w=
DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=flyingenvelope.com;
s=s0816; t=1612450103; i=#flyingenvelope.com;
bh=/f8yRZ6rR+GBhYC/znZWBMKO7p34rHHyKFVtc5YC5Ko=;
h=To:Message-ID:Date:Content-Type:Subject:From;
b=imerWKji+M3lzLINQSRUCZwFpvPkj5mai4Uryv+oe1tEtuP9xAFfQmTpqZeVQAaPQ
TTzhKxXBivunjjExRKgJYd7zuJOq1oXb5sFt8l7qh4W3fETafyR9GewBNHE4lOecg1
FgtmtbOsLUtKI18BL9R3XR4ASoQ5Ifl9M95bYANc=
To: "Christian Bryant" <cbryant87#hotmail.com>
Message-ID: <36.54.41297.7390C106#ax.mta1vrest.cc.prd.sparkpost>
Date: Thu, 04 Feb 2021 14:48:23 +0000
Content-Type: multipart/alternative; boundary="_----3VJ5fVkHUATxveyzQ3c1/A===_E4/54-41297-7390C106"
Reply-To: victoria#marinovacreative.com
Subject: Hi cbryant87#hotmail.com, Thanks for subscribing
List-Unsubscribe: <http://www.wix.com/my-account/contacts/unsubscribe?metaSiteId=4b16144b-e169-4171-9a46-6c18e4c5fd78&unsubscribeToken=abcefd4d5885911e7f4ea863ecce180388e169a39e4c714f1a99cb3376c2b706079a9828d30cc44ea24ddfb74302228ca2f1dd4724782f04bc77e6d64bddd2fe1c3316b7f7f52cbd4efa06f3a397c2d6445fe65559299dd1ed48d4aea7087f260ca68bbe9c65b9b4270fca4e649ed5aab4c0db65534f30d051ea50fb007265c4f6d018f43cc91fef3dbb075a41aa895846244f9ff6ff61d6c0767199793d58bd3bb4f10fca03a152f467c4d54a7c69e41be6a071ffdf09c055130f27705c87e8f600f4f603a84241a92525768f22f4a9408a1720a4aa2f96af6cca1a50e1b45c34738a6bd0585bb733e38784b6bc2a1e1f6fb8ee1b485a58f49431d782dfb47374b0798a8ae5e91226d913d75a8cc1ebd827a7576d316e2fe8b0a5019930ec9b41e8c3f6ab40538468cb23542e8104e50d36be2cb7f67a37bab589ca38152cf303c72d9665beb836b971162db9e4966e32443ca4808a575209093ec5392f4dc9df1aee9a6ace2926379566c81e2650d7>
From: "Marinova Creative" <victoria#marinovacreative.com>
x-abuse-id: 4b16144b-e169-4171-9a46-6c18e4c5fd78
Precedence: Bulk
Feedback-ID: 4b16144b-e169-4171-9a46-6c18e4c5fd78:7d6215dd-232d-4717-b832-03ecfcc678e9:wixshoutout
X-IncomingHeaderCount: 15
Return-Path: msprvs1=18669bbscyjXS=bounces-17751-509844#flyingenvelope.com
X-MS-Exchange-Organization-ExpirationStartTime: 04 Feb 2021 14:48:24.8733
(UTC)
X-MS-Exchange-Organization-ExpirationStartTimeReason: OriginalSubmit
X-MS-Exchange-Organization-ExpirationInterval: 1:00:00:00.0000000
X-MS-Exchange-Organization-ExpirationIntervalReason: OriginalSubmit
X-MS-Exchange-Organization-Network-Message-Id:
227b975f-9433-4880-30b3-08d8c91bece6
X-EOPAttributedMessage: 0
X-EOPTenantAttributedMessage: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa:0
X-MS-Exchange-Organization-MessageDirectionality: Incoming
X-MS-PublicTrafficType: Email
X-MS-Exchange-Organization-AuthSource:
AM7EUR06FT016.eop-eur06.prod.protection.outlook.com
X-MS-Exchange-Organization-AuthAs: Anonymous
X-MS-UserLastLogonTime: 2/4/2021 2:44:48 PM
X-MS-Office365-Filtering-Correlation-Id: 227b975f-9433-4880-30b3-08d8c91bece6
X-MS-TrafficTypeDiagnostic: AM7EUR06HT029:
X-MS-Exchange-EOPDirect: true
X-Sender-IP: 147.253.213.104
X-SID-PRA: VICTORIA#MARINOVACREATIVE.COM
X-SID-Result: PASS
X-MS-Exchange-Organization-PCL: 2
X-MS-Exchange-Organization-SCL: 0
X-Microsoft-Antispam: BCL:2;
X-OriginatorOrg: outlook.com
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 Feb 2021 14:48:24.2637
(UTC)
X-MS-Exchange-CrossTenant-Network-Message-Id: 227b975f-9433-4880-30b3-08d8c91bece6
X-MS-Exchange-CrossTenant-Id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa
X-MS-Exchange-CrossTenant-AuthSource:
AM7EUR06FT016.eop-eur06.prod.protection.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Anonymous
X-MS-Exchange-CrossTenant-FromEntityHeader: Internet
X-MS-Exchange-CrossTenant-RMS-PersistedConsumerOrg:
00000000-0000-0000-0000-000000000000
X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM7EUR06HT029
X-MS-Exchange-Transport-EndToEndLatency: 00:00:01.1211273
X-MS-Exchange-Processed-By-BccFoldering: 15.20.3805.024
X-Microsoft-Antispam-Mailbox-Delivery:
abwl:0;wl:0;pcwl:0;kl:0;iwl:0;dwl:0;dkl:0;rwl:0;ucf:0;jmr:0;ex:0;auth:1;dest:J;OFR:SpamFilterAuthJ;ENG:(5062000282)(90000117)(91040095)(9000001)(9015001)(9050020)(9060021)(9100273)(5061607266)(5061608174)(4900115)(98391011)(4920090)(6394003)(4950131)(4990090)(9140004);RF:JunkEmail;
X-Message-Info:
qoGN4b5S4yqNFxkPKm3EVQuKR9OsRjZyTthWWLx7sBMj1tH5R4lH6bGmJFB22p2xfSNNCtql0WJwQuOcW0KqlZhVmLsPlLNvSC+DQIXl+SnNIm2GPLt8roydd+mk4wFjxFCWMIFLLO8kGZXye8wEZUSOOVSVVxODjb2NyMI0n7hfzmPJj7STSTf2zjt8ylta82feYR3uUDTm82bgU0b2HA==
X-Message-Delivery: Vj0xLjE7dXM9MDtsPTA7YT0xO0Q9MjtHRD0xO1NDTD02
X-Microsoft-Antispam-Message-Info:
=?utf-8?B?ZDVoMWxKMUdoNjFrWWtxRUNvME85eFBaT0tQUWlzaDhDOFNKcS80V3NSVWJV?=
=?utf-8?B?NjRjRUxVYktXVzRVQXlkUmM4TGdKYi9Cb2VMUW41WHYwVlRzdm56SXpDSlky?=
=?utf-8?B?Z0x1YVl1ajVkZ2djNUxmS1B6RDZScFdxMm9VbEZUa0QyUXNWb3EwcGYzR0pE?=
=?utf-8?B?V2tTN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J2bE4wL2d1bnJUWEtobmRnM0d1USsvQ3BNbmNkYURIeWtmYVNw?=
=?utf-8?Q?lTQ+dgBsl+NuyESlmtpkyfRKY0QX84=3D?=
MIME-Version: 1.0
The X-Microsoft-Antispam: BCL:2; is partly documented here:
https://learn.microsoft.com/en-us/microsoft-365/security/office-365-security/bulk-complaint-level-values?view=o365-worldwide
Most mailbox providers don't tell you too much about how their mail filtering works, for obvious reasons.
Your MAIL FROM is the provider's default. You may be able to customise the "bounce domain" which can improve reputation, by "aligning" the envelope FROM (=Return-Path, Bounce Domain, RFC5321 FROM), and "Header" FROM (RFC5322).
https://www.sparkpost.com/docs/tech-resources/custom-bounce-domain/
For meanings of the various FROM addresses etc:
https://www.sparkpost.com/blog/dmarc-howto/
The address 147.253.213.104 is your "delivery" IP address. You can check the reputation of this on various free tools, including
https://talosintelligence.com/reputation_center/lookup?search=147.253.213.104
and
https://mxtoolbox.com/blacklists.aspx

Laravel 7 Mail attachment with excel file using Maatwebsite\Excel 3.1

I want to attached excel file (xlsx format) in my email without saving file on the server.
I already have a working code for download.
Following is what i am trying to do and getting error.
Code
$excelFile = Excel::download(new OrderExport($this->order), 'Order-'. $this->order->id . '.xlsx');
$mail->attach($excelFile, ['as' => 'Order-'. $this->order->id . '.xlsx']);
Error
Unable to open file for reading [HTTP/1.0 200 OK
Cache-Control: public
Content-Disposition: attachment; filename=Order-4.xlsx
Date: Wed, 05 Aug 2020 13:55:24 GMT
Last-Modified: Wed, 05 Aug 2020 13:55:24 GMT]
I am using Laravel 7.x and Maatwebsite\Excel 3.1
I got it fixed with the following code
$excelFile = Excel::raw(new OrderExport($this->order), \Maatwebsite\Excel\Excel::XLSX);
$mail->attachData($excelFile, 'Order-'. $this->order->id . '.xlsx');

Ruby 2.2.3 invalid date

The following method
now = Date.today
#start_week = Date.commercial(now.cwyear,now.cweek+9)
is returning and argument error invalid date. This was working under ruby 1.9.3. Oddly enough, there are no complaints regarding
#start_week = Date.commercial(now.cwyear,now.cweek+8)
and the console returns Mon, 28 Dec 2015
So the issue is how does one concisely rollover the year in such a context.
Silly. Transform the method to a succinct
#start_week = Date.today.beginning_of_week + 9.weeks
[get percolator running]

`unknown encoding name - ISO` error raised when my string contains the chars: "ISO"

I have an email object (instance of the mail gem):
header = #<Mail::Message:70363632703900, Multipart: false, Headers: <Date: Tue, 03 Jan 2012 13:48:55 +0000>, <From: Mike Tyson <some#email.com>>, <To: <my#email.com>>, <Subject: RE: =?ISO?Q?Ordrebekr=E6ftelse_nummer_CCL1221805621?=>>
When I try to access the subject (which is a String object) by e.g. typing
puts header.subject
I get this error:
unknown encoding name - ISO
Instead of just reading the entire string it seems that Ruby reads the ISO as the encoding. I have no idea why this is.
Do anyone have an idea about how to access this string?
Additional info:
Here is an example of a string that also contains encoding info, but doesn't raise errors:
header_2 = #<Mail::Message:70327581075160, Multipart: false, Headers: <Date: Tue, 03 Jan 2012 13:01:29 +0100>, <From: J.C.W. <some#email.com>>, <To: Tiger Woods <my#email.com>>, <Subject: =?ISO-8859-1?Q?Re=3A_=D8v_alts=E5=2C_vi_er_n=F8dt_til_at_aflyse_din_ordre_?= =?ISO-8859-1?Q?107210?=>>

How do I view the response cookies from a HTTParty get request?

I'm using httparty to do a GET request to a certain website. I need the response cookies in order to successfully make a POST request to login.
rest_client makes it really easy, all I have to do is:
get_request = RestClient.get('<REDACTED>')
response_cookies = get_request.cookies
# =>
{
"sessiontype"=>"mpb",
"aac"=>"741F9EC20A4C422369F7564445611591",
"Expires"=>"Sun",
"Path"=>"%2F",
"Domain"=>"<REDACTED>",
"internetbankierenmi"=>"1559079104.20480.0000",
"TSdb640d"=>"d17ca2538ee2215b647c3466d4b06da7ec33c7a21dc7217953d3ffe7d4efbe89959deba9debace3f579e71c9e27e0b6b1ea2c663"
}
But I want to do the same with httparty. So my question is how do I view/access the response cookies from a GET request in httparty?
Since cookies are part of the response header, you can access them from the response header in httparty.
require 'httparty'
r = HTTParty.get('<REDACTED>')
r.headers
# => {"date"=>["Sat, 26 Jul 2014 19:34:09 GMT"], "cache-control"=>["no-cache", "no-store"], "pragma"=>["no-cache"], "expires"=>["Thu, 01 Jan 1970 00:00:00 GMT"], "content-length"=>["13987"], "set-cookie"=>["sessiontype=mpb; Secure", "aac=742A83A50A4C422C24D6F952C4BF6355; Expires=Sun, 26 Jul 2015 19:34:08 GMT; Path=/; Domain=<REDACTED>; Secure", "internetbankierenmi=1777182912.20480.0000; path=/", "TSdb640d=de34831032c17e8b66f123633372a9b341a9773368fccca553d402b1d4efbe89959deba9debace3fe0d47c86e27e0b6b1669bf05; Path=/"], "vary"=>["Accept-Encoding,User-Agent"], "content-type"=>["text/html;charset=ISO-8859-1"], "content-language"=>["en"], "connection"=>["close"], "strict-transport-security"=>["max-age=8640000"]}
r.headers['set-cookie']
# => "sessiontype=mpb; Secure, aac=742A83A50A4C422C24D6F952C4BF6355; Expires=Sun, 26 Jul 2015 19:34:08 GMT; Path=/; Domain=.ing.nl; Secure, internetbankierenmi=1777182912.20480.0000; path=/, TSdb640d=de34831032c17e8b66f123633372a9b341a9773368fccca553d402b1d4efbe89959deba9debace3fe0d47c86e27e0b6b1669bf05; Path=/"

Resources