Testing with gmail account - testing

I try to test schema integration with rails application. I used my personal Gmail account to configure SMTP :
config.action_mailer.delivery_method = :smtp
config.action_mailer.smtp_settings = {
address: 'smtp.gmail.com',
port: 587,
domain: 'gmail.com',
user_name: 'XXXX#gmail.com',
password: 'XXXX',
authentication: 'plain',
enable_starttls_auto: true
}
I test to send it to my own account. But it's seems that doesn't work..
I test with example code from :
PS : The mail pass validation
Thank you
EDIT : Header of my mail
Return-Path: <XXX#gmail.com>
Received: from gmail.com (84-74-24-22.dclient.hispeed.ch. [84.74.24.22])
by mx.google.com with ESMTPSA id m8sm9364668eeg.11.2014.04.23.13.34.35
for <XXX#gmail.com>
(version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);
Wed, 23 Apr 2014 13:34:35 -0700 (PDT)
Date: Wed, 23 Apr 2014 22:34:34 +0200
From: XXX#gmail.com
To: XXX#gmail.com
Message-ID: <535823da92e7c_3d223ffc2442dbe093598#WS-39.local.mail>
Subject: =?UTF-8?Q?Merci_d'avoir_command=C3=A9_!?=
Mime-Version: 1.0
Content-Type: multipart/alternative;
boundary="--==_mimepart_535823da916a1_3d223ffc2442dbe0934a9";
charset=UTF-8
Content-Transfer-Encoding: 7bit

Related

Google safe browsing API not returning threat URLs

I'm sending requests to the Google safe browsing API. I believe I'm following their documentation correctly. I've tried regenerating my key.
I'm sending the request below
POST https://safebrowsing.googleapis.com/v4/threatMatches:find?key=AIxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx HTTP/1.1
User-Agent: Fiddler
Host: safebrowsing.googleapis.com
Content-Length: 511
{
"client": {
"clientId": "yourcompanyname",
"clientVersion": "1.5.2"
},
"threatInfo": {
"threatTypes": ["MALWARE", "SOCIAL_ENGINEERING"],
"platformTypes": ["WINDOWS"],
"threatEntryTypes": ["URL"],
"threatEntries": [
{"url": "http://www.urltocheck1.org/"},
{"url": "http://malware.testing.google.test"},
{"url": "http://www.urltocheck2.org/"},
{"url": "http://www.urltocheck3.com/"}
]
}
}
And getting back an empty response which is not what I'm expecting with the URLs supplied and following their example.
HTTP/1.1 200 OK
Content-Type: application/json; charset=UTF-8
Date: Wed, 08 Sep 2021 15:05:59 GMT
Server: scaffolding on HTTPServer2
Cache-Control: private
X-XSS-Protection: 0
X-Frame-Options: SAMEORIGIN
X-Content-Type-Options: nosniff
Alt-Svc: h3=":443"; ma=2592000,h3-29=":443"; ma=2592000,h3-T051=":443"; ma=2592000,h3-Q050=":443"; ma=2592000,h3-Q046=":443"; ma=2592000,h3-Q043=":443"; ma=2592000,quic=":443"; ma=2592000; v="46,43"
Accept-Ranges: none
Vary: Accept-Encoding
Content-Length: 3
{}
https://transparencyreport.google.com/safe-browsing/search?url=malware.testing.google.test
https://developers.google.com/safe-browsing/v4/lookup-api
You need to pass API key
You need to pass MALWARE url": "http://www.urltocheck1.org/"
if it is not malware it will show empty. try the following url
https://testsafebrowsing.appspot.com/s/malware.html with your code. please search and test with other maleware site

Calling https://graph.microsoft.com/v1.0/users/<ID Calendar>/calendar/calendarView? doesn't return appointments, and there is appointments

The call to Graph API is not working properly since yesterday :
https://graph.microsoft.com/v1.0/users/<my calendar ID>/calendar/calendarView?startDateTime=2019-10-04T19:10:24.0000000&endDateTime=2019-11-03T19:10:24.0000000&top=100
Is returning 0 events - appointments, and there are appointments to list on
That call was working ok until yesterday, every 8 minutes, 24x7 since last month :
// List events.
string fini = string.Format("{0}-{1}-{2}T{3}:{4}:{5}.0000000",
UpDateTime.Year.ToString("0000"),
UpDateTime.Month.ToString("00"),
UpDateTime.Day.ToString("00"),
UpDateTime.Hour.ToString("00"),
UpDateTime.Minute.ToString("00"),
UpDateTime.Second.ToString("00")
);
string ffin = string.Format("{0}-{1}-{2}T{3}:{4}:{5}.0000000", //
EndTime.Year.ToString("0000"),
EndTime.Month.ToString("00"),
EndTime.Day.ToString("00"),
EndTime.Hour.ToString("00"),
EndTime.Minute.ToString("00"),
EndTime.Second.ToString("00")
);
String _requestURI = _GraphURLEvents.Replace("events", "calendarView") + string.Format("?startDateTime={0}&endDateTime={1}&top=100", fini, ffin);
_requestURI = String.Format(_requestURI, _userId);
HttpRequestMessage request = new HttpRequestMessage(HttpMethod.Get, _requestURI);
//Authentication token
request.Headers.Add("Prefer", "outlook.timezone=\"Romance Standard Time\"");
request.Headers.Authorization = new AuthenticationHeaderValue("Bearer", System.Web.HttpUtility.UrlEncode(access_token));
HttpClient client = new HttpClient();
var response = await client.SendAsync(request)
var returnURL = await
response.Content.ReadAsStringAsync();
Get kind CALL returns:
{StatusCode: 200, ReasonPhrase: 'OK', Version: 1.1, Content: System.Net.Http.StreamContent, Headers:
{
Transfer-Encoding: chunked
request-id: <r>
client-request-id: <t>
x-ms-ags-diagnostic: {"ServerInfo":{"DataCenter":"West Europe","Slice":"SliceC","Ring":"5","ScaleUnit":"003","RoleInstance":"AGSFE_IN_52","ADSiteName":"WEU"}}
Preference-Applied: outlook.timezone="Romance Standard Time"
OData-Version: 4.0
Duration: 66.8258
Strict-Transport-Security: max-age=31536000
Cache-Control: private
Date: Fri, 04 Oct 2019 17:11:31 GMT
Content-Type: application/json; odata.metadata=minimal; odata.streaming=true; IEEE754Compatible=false; charset=utf-8
}}
Content: {System.Net.Http.StreamContent}
Headers: {Transfer-Encoding: chunked
request-id: <x>
client-request-id: <y>
x-ms-ags-diagnostic: {"ServerInfo":{"DataCenter":"West Europe","Slice":"SliceC","Ring":"5","ScaleUnit":"003","RoleInstance":"AGSFE_IN_52","ADSiteName":"WEU"}}
Preference-Applied: outlook.timezone="Romance Standard Time"
OData-Version: 4.0
Duration: 66.8258
Strict-Transport-Security: max-age=31536000
Cache-Control: private
Date: Fri, 04 Oct 2019 17:11:31 GMT
}
IsSuccessStatusCode: true
ReasonPhrase: "OK"
RequestMessage: {Method: GET, RequestUri: 'https://graph.microsoft.com/v1.0/users/<mycalendar>/calendar/calendarView?startDateTime=2019-10-04T19:10:24.0000000&endDateTime=2019-11-03T19:10:24.0000000&top=100', Version: 1.1, Content: <null>, Headers:
{
Prefer: outlook.timezone="Romance Standard Time"
Authorization: Bearer <my authorization bearer>
}}
StatusCode: OK
Version: {1.1}
That call must return something like :
https://learn.microsoft.com/en-us/graph/api/user-list-calendarview?view=graph-rest-1.0&tabs=http
HTTP/1.1 200 OK
Content-type: application/json
Content-length: 354
{
"value": [
{
"originalStartTimeZone": "originalStartTimeZone-value",
"originalEndTimeZone": "originalEndTimeZone-value",
"responseStatus": {
"response": "",
"time": "datetime-value"
},
"iCalUId": "iCalUId-value",
"reminderMinutesBeforeStart": 99,
"isReminderOn": true
}
]
}
... and since yesterday the result is :
{\"#odata.context\":\"https://graph.microsoft.com/v1.0/$metadata#users('<calendarId>')/calendar/calendarView\",\"value\":[]}
Based on my test the url should be:
1. To get the calendar of a specific user
https://graph.microsoft.com/v1.0/users/<user_id>/calendar/calendarView?startDateTime=2019-10-06T16:00:00Z&endDateTime=2019-10-10T16:00:00Z&top=100
or
https://graph.microsoft.com/v1.0/users/<user_id>/calendars/<calendar_id>/calendarView?startDateTime=2019-10-06T16:00:00Z&endDateTime=2019-10-10T16:00:00Z&top=100
2. To get the calendar of me
https://graph.microsoft.com/v1.0/me/calendar/calendarView?startDateTime=2019-10-06T16:00:00Z&endDateTime=2019-10-10T16:00:00Z&top=100
or
https://graph.microsoft.com/v1.0/me/calendars/<calendar_id>/calendarView?startDateTime=2019-10-06T16:00:00Z&endDateTime=2019-10-10T16:00:00Z&top=100
I can get successful responses from the above urls.
By the way, please check if you have set the correct time period. The timestamp should be UTC formatted.

IllegalArgumentValueException calling addSiteAccount1

I am not having much success getting the addSiteAccount1 API to work. I am using .NET, but I don't believe that has anything to do with my issue. Seems like I am missing something in the request, however I have read the documentation and other posts, but can't figure out what might be missing.
Here is my request (captured from Fiddler):
cobSessionToken <<REMOVED>>
userSessionToken <<REMOVED>>
siteId 2852
credentialFields[1].valueMask LOGIN_FIELD
credentialFields[1].valueIdentifier PASSWORD
credentialFields[1].value <<REMOVED>>
credentialFields[1].size 20
credentialFields[1].name PASSWORD
credentialFields[1].maxLength 20
credentialFields[1].isOptionalMFA False
credentialFields[1].isOptional False
credentialFields[1].isMFA False
credentialFields[1].isEscaped False
credentialFields[1].isEditable True
credentialFields[1].helpText 5372
credentialFields[1].fieldType.typeName IF_PASSWORD
credentialFields[1].fieldInfoType com.yodlee.common.FieldInfoSingle
credentialFields[1].displayName Passcode
credentialFields[0].valueMask LOGIN_FIELD
credentialFields[0].valueIdentifier LOGIN
credentialFields[0].value <<REMOVED>>
credentialFields[0].size 20
credentialFields[0].name LOGIN
credentialFields[0].maxLength 40
credentialFields[0].isOptionalMFA False
credentialFields[0].isOptional False
credentialFields[0].isMFA False
credentialFields[0].isEscaped False
credentialFields[0].isEditable True
credentialFields[0].helpText 5371
credentialFields[0].fieldType.typeName IF_LOGIN
credentialFields[0].fieldInfoType com.yodlee.common.FieldInfoSingle
credentialFields[0].displayName Online ID
This is the response:
HTTP/1.1 200 OK
X-Powered-By: Unknown
yodlee-ref-id: q1464831683738d12W27T
Set-Cookie: JSESSIONID=6E8CF7DA66E80B567118AF1956589519; Path=/services; Secure
Content-Type: application/json
Transfer-Encoding: chunked
Date: Thu, 02 Jun 2016 01:41:22 GMT
Server: Unknown
{"errorOccurred":"true","exceptionType":"com.yodlee.core.IllegalArgumentValueException","referenceCode":"_54f9c9b6-60f9-49d9-8aa6-43542d7ec598","message":"Null argument specified"}
I have also tried the suggested answer (removing fieldInfoType and adding enclosedType):
cobSessionToken <<REMOVED>>
userSessionToken <<REMOVED>>
siteId 2852
credentialFields.enclosedType com.yodlee.common.FieldInfoSingle
credentialFields[0].displayName Online ID
credentialFields[0].fieldType.typeName IF_LOGIN
credentialFields[0].helpText 5371
credentialFields[0].maxLength 40
credentialFields[0].name LOGIN
credentialFields[0].size 20
credentialFields[0].value <<REMOVED>>
credentialFields[0].valueIdentifier LOGIN
credentialFields[0].valueMask LOGIN_FIELD
credentialFields[0].isEditable True
credentialFields[0].isOptional False
credentialFields[0].isEscaped False
credentialFields[0].isOptionalMFA False
credentialFields[0].isMFA False
credentialFields[1].displayName Passcode
credentialFields[1].fieldType.typeName IF_PASSWORD
credentialFields[1].helpText 5372
credentialFields[1].maxLength 20
credentialFields[1].name PASSWORD
credentialFields[1].size 20
credentialFields[1].value <<REMOVED>>
credentialFields[1].valueIdentifier PASSWORD
credentialFields[1].valueMask LOGIN_FIELD
credentialFields[1].isEditable True
credentialFields[1].isOptional False
credentialFields[1].isEscaped False
credentialFields[1].isOptionalMFA False
credentialFields[1].isMFA False
This is the response:
HTTP/1.1 200 OK
X-Powered-By: Unknown
yodlee-ref-id: q1465437863468f12C27S
Set-Cookie: JSESSIONID=3600322EF154E726209C217844FF935E; Path=/services; Secure
Content-Type: application/json
Transfer-Encoding: chunked
Date: Thu, 09 Jun 2016 02:04:22 GMT
Server: Unknown
{"errorOccurred":"true","exceptionType":"com.yodlee.core.IncompleteArgumentException","referenceCode":"_418a82c7-90b9-4a1f-8aad-87ba16cfbb67","message":"Incomplete argument: FieldInfoSingle: {FieldInfo: name=\"null\" displayName=\"null\" editable=false optional=false helpText=\"null\" valuePattern=\"null\" } defaultValue=\"null\" value=\"null\" validValues=[null] displayValidValues=[null] valueIdentifier=\"null\" valueMask=\"null\" fieldType=\"null\" validationRules=[null] size=null maxlength=null userProfileMappingExpression=null fieldErrorCode=null fieldErrorMessage=null "}
I can tell what the null argument might be...
Add this in your login form
credentialFields.enclosedType com.yodlee.common.FieldInfoSingle
instead of
credentialFields[1].fieldInfoType com.yodlee.common.FieldInfoSingle
credentialFields[0].fieldInfoType com.yodlee.common.FieldInfoSingle
Hope this helps.

Reset password email is not sent by Devise

Rails 3.2.13, Ruby 1.9.3
My Devise controller is working fine sending emails, with one exception: sending the reset password instructions email.
When I click on the "Forgot your password?" link, I get the message:
You will receive an email with your password reset instructions in a few minutes.
But, I do not receive the email. Following is the relevant dump from the log file:
Started GET "/password/new.user" for 174.xx.xxx.xx at 2013-04-29 01:28:48 +0000
Processing by Devise::PasswordsController#new as
BlogPost Load (0.5ms) SELECT `blog_posts`.* FROM `blog_posts`
Rendered devise/_links.erb (1.0ms)
Rendered devise/passwords/new.html.erb within layouts/application (23.1ms)
Rendered layouts/_shim.html.erb (0.0ms)
Rendered layouts/_header.html.erb (2.5ms)
Rendered layouts/_promo_bar.html.erb (0.9ms)
Rendered layouts/_footer.html.erb (2.6ms)
Completed 200 OK in 54ms (Views: 51.2ms | ActiveRecord: 0.5ms)
Started POST "/password" for 174.xx.xxx.xx at 2013-04-29 01:30:19 +0000
Processing by Devise::PasswordsController#create as HTML
Parameters: {"utf8"=>"✓", "user"=>{"email"=>"emailaddress#outlook.com"}, "commit"=>"Send me reset password instructions"}
BlogPost Load (137.8ms) SELECT `blog_posts`.* FROM `blog_posts`
User Load (82.4ms) SELECT `users`.* FROM `users` WHERE `users`.`email` = 'emailaddress#outlook.com' LIMIT 1
User Load (14.8ms) SELECT `users`.* FROM `users` WHERE `users`.`reset_password_token` = 'NysDaribCpgNySc5Nmog' LIMIT 1
(0.2ms) BEGIN
(99.0ms) UPDATE `users` SET `reset_password_token` = 'NysDaribCpgNySc5Nmog', `reset_password_sent_at` = '2013-04-29 01:30:19', `updated_at` = '2013-04-29 01:30:19' WHERE `users`.`id` = 113
(60.6ms) COMMIT
Rendered devise/mailer/reset_password_instructions.html.erb (1.3ms)
Rendered devise/mailer/reset_password_instructions.text.erb (1.5ms)
Sent mail to emailaddress#outlook.com (133ms)
Date: Mon, 29 Apr 2013 01:30:21 +0000
To: emailaddress#outlook.com
Message-ID: <517dcd2db584b_71bc6778701193#testsite-test.mail>
Subject: testsite Account Reset password instructions
Mime-Version: 1.0
Content-Type: multipart/alternative;
boundary="--==_mimepart_517dcd2d93927_71bc677870116dc";
charset=UTF-8
Content-Transfer-Encoding: 7bit
----==_mimepart_517dcd2d93927_71bc677870116dc
Date: Mon, 29 Apr 2013 01:30:21 +0000
Mime-Version: 1.0
Content-Type: text/plain;
charset=UTF-8
Content-Transfer-Encoding: 7bit
Content-ID: <517dcd2d9bfb9_71bc677870117a2#testsite-test.mail>
Hello emailaddress#outlook.com!
A Request to change the password for this account has been received. If this is you, and you still want to change the password, you can do so by clicking on the link below.
Change my password
If you didn't request this, please ignore this email.
----==_mimepart_517dcd2d93927_71bc677870116dc
Date: Mon, 29 Apr 2013 01:30:21 +0000
Mime-Version: 1.0
Content-Type: text/html;
charset=UTF-8
Content-Transfer-Encoding: 7bit
Content-ID: <517dcd2db365a_71bc677870118da#testsite-test.mail>
<p>Hello emailaddress#outlook.com!</p>
<p>A Request to change the password for this account has been received. If this is you, and you still want to change the password, you can do so by clicking on the link below.</p>
<p>Change my password</p>
<p>If you didn't request this, please ignore this email.</p>
----==_mimepart_517dcd2d93927_71bc677870116dc--
Redirected to http://test.testsitethefuture.com/login
Completed 302 Found in 2520ms (ActiveRecord: 0.0ms)
Started GET "/login" for 174.xx.xxx.xx at 2013-04-29 01:30:22 +0000
Processing by Devise::SessionsController#new as HTML
BlogPost Load (3.0ms) SELECT `blog_posts`.* FROM `blog_posts`
Rendered devise/_links.erb (0.8ms)
Rendered devise/sessions/new.html.erb within layouts/application (7.0ms)
Rendered layouts/_shim.html.erb (0.0ms)
Rendered layouts/_header.html.erb (2.2ms)
Rendered layouts/_promo_bar.html.erb (1.2ms)
Rendered layouts/_footer.html.erb (2.6ms)
Completed 200 OK in 49ms (Views: 35.9ms | ActiveRecord: 3.0ms)
Any ideas of what I should be looking for?
environments/test.rb
Myapp::Application.configure do
config.cache_classes = false
config.serve_static_assets = true
config.static_cache_control = "public, max-age=3600"
config.whiny_nils = true
config.consider_all_requests_local = true
config.action_controller.perform_caching = false
config.action_dispatch.show_exceptions = false
config.action_controller.allow_forgery_protection = false
config.active_record.mass_assignment_sanitizer = :strict
config.active_support.deprecation = :stderr
config.action_mailer.default_url_options = {:host => 'myapp.com'}
config.action_mailer.delivery_method = :smtp
config.action_mailer.perform_deliveries = true
config.action_mailer.raise_delivery_errors = false
config.action_mailer.default :charset => "utf-8"
config.action_mailer.smtp_settings = {
address: "smtp.gmail.com",
port: 587,
domain: "myapp.com",
authentication: "plain",
enable_starttls_auto: true,
user_name: 'Admin#myapp.com',
password: 'xxxxxxxxxxx'
}
end
Check the SMTP Mailer settings in your config file, from log it is showing that mail is sending correctly but it is not delivered, because of SMTP settings problem.
Correct the smtp settings and check the mailer from console
Ex:-
Notification.forgot_password("sample#test.com").deliver
Having the line ActionMailer::Base.delivery_method = :smtp in config/environment.rb overrides ActionMailer::Base.delivery_method = :test in config/environments/test.rb.
So, add that line, ActionMailer::Base.delivery_method = :smtp' from config/environment.rb and place it in config/environments/test.rb. That allows you to place
ActionMailer::Base.delivery_method = :test in config/environments/test.rb.
Note: You must restart your server for these changes to take effect.
In config/environment.rb:
# Configuration for using SendGrid on Heroku
ActionMailer::Base.smtp_settings = {
:address => 'smtp.sendgrid.net',
:port => '587',
:authentication => :plain,
:user_name => 'app[my app number]#heroku.com',
:password => '[something super secret]',
:domain => '[let's get this party started!.com]',
:enable_starttls_auto => true
}
ActionMailer::Base.delivery_method = :smtp
Worked for me.

Why sendmail setting is not sending mail in ruby on rails 3

I am trying to send mail using sendmail settings but i am not receiving the mail I can see the mail sent in development log.
config/application.rb
config.action_mailer.delivery_method = :sendmail
config.action_mailer.sendmail_settings = {
:location => '/usr/sbin/sendmail',
:arguments => '-i -t'
}
config.action_mailer.perform_deliveries = true
config.action_mailer.raise_delivery_errors = true
mailers/Notifier.rb
class Notifier < ActionMailer::Base
default :from => "deepika#xxx.com"
def welcome_email
mail(:to => "deepika#xxx.com", :subject => "Welcome to My Site test mail")
end
end
And i am calling Notifier.welcome_email.deliver from index method.
I can see log
Sent mail to deepika#xxx.com (339ms)
Date: Wed, 10 Apr 2013 15:16:33 +0530
From: deepika#xxx.com
To: deepika#xxx.com
Message-ID: <516534f983356_30f3262c7c84610d2#cybage-virtual-machine.mail>
Subject: Welcome to My Site test mail
Mime-Version: 1.0
Content-Type: text/html;
charset=UTF-8
Content-Transfer-Encoding: 7bit
<p>Thanks for joining and have a great day!</p>
But i am not receiving mail.
when i do service sendmail status i am getting
MSP: is run via cron (20m)
MTA: 123995 /usr/sbin/sendmail-mta -Am -L sm-mta -bd -q10m
UID PID PPID C STIME TTY TIME CMD
root 123995 1 0 15:36 ? 00:00:00 sendmail: MTA: accepting connections
Daemon Status: (process 132996) Queue runner
Current number of children: 1
QueueDir free disk space (in blocks): 285222800
Load average: 1
Child Process 139595 Status: accepting connections
Child Process 144035 Status: console socket child
QUE: Same as MTA
Also when i do vi /var/mail/root, I am getting following
This is a MIME-encapsulated message
--r3A9kDux012954.1365587178/cybage-virtual-machine.cybage.com
The original message was received at Wed, 10 Apr 2013 15:02:21 +0530
from localhost
with id r3Adsdsd9WLU5012559
----- The following addresses had permanent fatal errors -----
<deepika#xxx.com>
(reason: Client was not authenticated)
----- Transcript of session follows -----
... while talking to mail.xxx.com.:
>>> MAIL From:<> SIZE=268814
<<< 530 5.7.1 Client was not authenticated
Service unavailable
Can you please tell me what is the reason behind not receiving mail.