Net::SMTPSyntaxError · 501 Invalid command or cannot parse from address - ruby-on-rails

I have read some discussion, Q&A about the error w/c is thrown if sender email is invalid,
but I'm not sure if
this error Net::SMTPSyntaxError · 501 is for both invalid email from & to.

Net::SMTPSyntaxError 501 error is thrown if you have bad sender address. Sender address should be an email address. Any fake email will also do. like: abc#fakemail.com

Related

CANOe Diagnostic console show Error when processing of response message("Primitive has invalid length")

In CANOe Diagnostic console when I request SID and I see Error when processing of response message("Primitive has invalid length") and I receive Positive response message. Please could someone tell me how to removeenter image description here the above error ? I have attached a screenshot for reference.
the Basic Diagnostics Editor there is the parameter "sessionParameterRecord" configured, which is missing in the received response.
Thats why the Diagnostic Console reports that the "primtive has an invalid length", its too short
enter image description here

error | 253 | Message specified does not match with any template

I am getting following error while hitting gupshup send message API:
error | 253 | Message specified does not match with any template
If you are sending any messages from bulk you need to first approve that template by mailing the message content to enterprise-support#smsgupshup.com with your 10 digit gupshup account Id. And also note the approved content should exactly match the message which you are trying to send from API even an extra space can cause error 253

Unable to fetch access token mule <-> salesforce

I am stuck in something which i thought it is gonna be a very easy one.
I am trying to setup a Mule flow to connect with Salesforce and get OAUTH token.
<flow>
<sfdc:config-with-oauth consumerKey="thatgirliscute" consumerSecret="nosheishOT" doc:name="Salesforce (OAuth)" name="Salesforce__OAuth_" connectionTimeout="10000" readTimeout="10000">
<sfdc:oauth-callback-config domain="localhost" localPort="8081" path="callback"/>
</sfdc:config-with-oauth>
<flow name="salesforce-oauthFlow1" doc:name="salesforce-oauthFlow1">
<http:inbound-endpoint exchange-pattern="request-response" host="localhost" port="8081" doc:name="HTTP"/>
<sfdc:authorize accessTokenUrl="https://login.salesforce.com/services/oauth2/token" authorizationUrl="https://login.salesforce.com/services/oauth2/authorize" config-ref="Salesforce__OAuth_" display="PAGE" doc:name="Authorize at Salesforce"/>
</flow>
But I get an error message saying 'Unable to fetch access token. Message payload is of type: String'
Message : Unable to fetch access token. Message payload is of type: String
Code : MULE_ERROR--2
--------------------------------------------------------------------------------
Exception stack is:
1. Connection timed out: connect (java.net.ConnectException)
java.net.PlainSocketImpl:-2 (null)
2. Error found while consuming http resource at https://login.salesforce.com/services/oauth2/token (java.lang.RuntimeException)
org.mule.security.oauth.util.HttpUtilImpl:93 (null)
3. Unable to fetch access token. Message payload is of type: String (org.mule.api.MessagingException)
org.mule.security.oauth.processor.OAuth2FetchAccessTokenMessageProcessor:91 (http://www.mulesoft.org/docs/site/current3/apidocs/org/mule/api/MessagingException.html)
--------------------------------------------------------------------------------
Root Exception stack trace:
java.net.ConnectException: Connection timed out: connect
Any pointers to resolve is of great help. thanks
-- EDIT : I am behind a corporate firewall - does it matters ? But i am able to successfully do the basic authentication with Salesforce connector. Only OAuTH is leading to a problem.
When i type in localhost:8081 i get redirected to
https://ap1.salesforce.com/setup/secur/RemoteAccessAuthorizationPage.apexp?source=l86Hcy6qEKtWNqzXVErZDlmcRQs0D_HBE55Mqtm_Al6fTUPSfuQ%3D%3D&display=page&sdtd=1
and then redirected automatically to below URL with error 'Unable to fetch access token. Message payload is of type: String' in the browser and the console reads as i have posted above.
http://localhost:8081/callback?display=page&code=aPrxaSyVmC8fBbfefEfQB5xrKXrrRhK3DiVFrPu5ia0Q%3D%3D&state=%3C%3CMULE_EVENT_ID%3D0-546bdbb1-0095-11e5-9fcb-2c4138b080c9%3E%3E
This was a bug in Mule and the Salesforce Connector 6.2 resolves it.

OAuth "Invalid verification code format"

I've got a production app and occasionally I see this error appear in the logs.. I can't seem to duplicate it on my end, so it seems like there is a user out there somewhere with some specific settings / cookies / etc that are causing this problem. I am not sure... The log shows that this user was redirected to this callback url: "users/auth/facebook/callback?code=AQCayaAoFOruFgwbfg1D682j8DbxOt0CZYNH3Vv5RtYKlQgSzISyN8ygTn25W_RTl3fu35cS1-tl5ArZ9B_XylwORP0hGU6st8P6TyTYUzfiR1m0poaSRkX-KBeWiBvT6IUsm-Af0VJcUNTQPg-dM1F9y5CgJ2bTJEJqhCE9wYlvkUY3kguwcl3TQ48FTT4-PhA///"
The actual error is:
RuntimeError: #<OAuth2::Response:0x1da7fae0 #error=#<OAuth2::Error: OAuth2::Error>, #options={:parse=>:query}, #parsed={"{\"error\":{\"message\":\"Invalid verification code format.\",\"type\":\"OAuthException\"}}"=>nil}, #response=#<Faraday::Response:0x1da8fa80 #on_complete_callbacks=[], #env={:response=>#<Faraday::Response:0x1da8fa80 ...>, :request_headers=>{"Content-Type"=>"application/x-www-form-urlencoded"}, :body=>"{\"error\":{\"message\":\"Invalid verification code format.\",\"type\":\"OAuthException\"}}", :status=>400, :url=>#<Addressable::URI:0xed52bf0 URI:https://graph.facebook.com/oauth/access_token>, :request=>{:proxy=>nil}, :parallel_manager=>nil, :response_headers=>{"expires"=>"Sat, 01 Jan 2000 00:00:00 GMT", "access-control-allow-origin"=>"*", "content-type"=>"text/javascript; charset=UTF-8", "connection"=>"close", "www-authenticate"=>"OAuth \"Facebook Platform\" \"invalid_code\" \"Invalid verification code format.\"", "date"=>"Thu, 13 Oct 2011 15:58:29 GMT", "content-length"=>"81", "cache-control"=>"no-store", "x-fb-rev"=>"457598", "x-fb-server"=>"10.65.13.60", "pragma"=>"no-cache"}, :ssl=>{:ca_file=>"/etc/pki/tls/certs/ca-bundle.crt"}, :method=>:post}>>
and the parameters were:
{"code"=> "AQCayaAoFOruFgwbfg1D682j8DbxOt0CZYNH3Vv5RtYKlQgSzISyN8ygTn25W_RTl3fu35cS1-tl5ArZ9B_XylwORP0hGU6st8P6TyTYUzfiR1m0poaSRkX-KBeWiBvT6IUsm-Af0VJcUNTQPg-dM1F9y5CgJ2bTJEJqhCE9wYlvkUY3kguwcl3TQ48FTT4-PhA///",
"action"=>"",
"controller"=>""}
I know if I manually go to "users/auth/facebook/callback?code=blah" it will trigger this same error because the callback code parameter is obviously bogus, but it doesn't look like there's anything suspicious about the actual code in the user's params hash-- so I am wondering why it would be an invalid format?
Has anyone else experienced this?
I think the following link provides the answer: http://developers.facebook.com/docs/authentication/#authenticating-users-in-a-web-application
You first need to call https://graph.facebook.com/oauth/authorize with your client_id and redirect_uri. This will then redirect you back to the redirect_uri, with a verification code in the query string that you can pass to your https://graph.facebook.com/oauth/access_token call (via the code parameter) to exchange for an oAuth access token.
Good luck! :)

Rails Twitter Gem 404 Error Handling in the view

I have this line in my view file:
- tweets = Twitter.user_timeline(#organization.twitter_name)
The attr twitter_name is entered by the user. If they enter an invalid twitter account name, it throws a 404 error.
How can I deal with the error to avoid getting this action controller exception? Twitter::NotFound in Organizations#show
You ca use rescue to catch an exception and show a user friendly error message

Resources