Creating appspotmail address to receive eMail in GAE - google-app-engine

I set up an application in GAE and I want to be able to receive eMails.
The documentation says that:
You can set up your app to receive incoming email at
string#appid.appspotmail.com addresses
GAE documentation
I did not found any possibility to create a mail in this form (e.g. service#appid.appspotmail.com) in the application.
Can somebody help me how to set up an appspot mail address and to assign it to the application? (I do not know if I need to assign the address inside the permissions settings of the app or if it is sufficient to only put in the web.xml of the application)
Thank you!

All you have to do is adding the following in your appengine-web.xml :
<inbound-services>
<service>mail</service>
</inbound-services>
Source: GAE documentation - Receiving Mail
Once you have done that, any address in #yourappname.appspotmail.com will be valid.

Related

AppEngine authentication through Node.js

I'm trying to write a VSCode extension where users could log into Google AppEngine with a google account, and I need to get their SACSID cookie to make appengine requests.
So I'm opening a browser window at
https://accounts.google.com/ServiceLogin?service=ah&passive=true&continue=https://appengine.google.com/_ah/conflogin%3Fcontinue%3Dhttp://localhost:3000/
(generated by google.appengine.api.users.create_login_url)
The user logs in and is redirected to my local webserver at
localhost:3000/_ah/conflogin/?state={state}
Now I try to forward the request to my AppEngine app (since it knows how to decode the state parameter), so I do a request to
https://my-app.appspot.com/_ah/conflogin/?state={state}
basically just replacing localhost with the actual app.
but it doesn't work, presumably because the domain is different. I assume this is on purpose, for security.
Is there any way I can make this work ?
Not ideal, but the only solution I've found is to have an endpoint on my GAE instance that does the redirection. Then I can set that as the continue url, when I'm starting the authentication process
https://accounts.google.com/ServiceLogin?service=ah&passive=true&continue=https://appengine.google.com/_ah/conflogin%3Fcontinue%3Dhttps://my-app.appspot.com/redirect?to=http://localhost:3000
I think you should center the attention on the protocols you are using, since it’s known that the cookie name is based on the http protocol (HTTP : ACSID, HTTPS:SACSID), and that’s the security perspective till this point for me.
Having the error you are facing now would be helpful to understand the problem better. Also, how are you performing the call to the API and the code you are using would be helpful too.

Datastore admin - Unable to resolve the server's DNS address

I am trying to access Datastore Admin on Google App Engine but I get Unable to resolve the server's DNS address error.
The url that cannot be translated is: [https protocol]ah-builtin-python-bundle-dot-[myapp].gene.com/_ah/datastore_admin/?app_id=s~gene.com:[myapp]&adminconsolecustompage
I tried with adding exceptions to coookies because when I try directly access it with [http protocol][myapp].gene.com/_ah/datastore_admin I get error with redirect loop.
Any idea? Any workarounds are also welcomed - I just need to copy datastore to local environment.
Witek
Thank you, Patrick.
Your guess turned out to be the right one. The domain is not set up properly and this is the reason of problems.

How can i receive Salesforce Outbound Message from Mule?

I have use Outbound Message in salesforce. When the Trigger is Occur on the particular object outbound Message to pass particular End URL. here I want to receive the Outbound Message from the Mulesoft(EndPoint URL) . I have tried HTTP,UDP,TCP,Genric these Kind of endpoint URL but its not working. How i can Use the Mulesoft end point URL. by using Local host its possible or not. Because I have used Localhost:8081 this kind of URL only. what are all the way i have to receive salesforce outbound Message. Thanks
The target of the outbound message must be accessible from the web. It has to have some meaningful domain name or IP address (and if you're behind a firewall you need to allow messages from SF pool of IP addresses to pass through).
http://wiki.developerforce.com/page/Creating_an_Outbound_Messaging_Notification_Service_with_Eclipse_3.2#Testing_Your_Service
Testing can be a bit of a tricky wicket if you are not developing on a
machine that is accessible from the internet. Following the sample, we
have deployed our web service to localhost:8080. It is not possible
for the salesforce.com servers to make a request to that address.

saving appengine mail from spam filters

One of my clients uses Trend Micro InterScan Messaging Security to protect their internal mail services.
Suddenly InterScan decided to filter out all messages coming from Google App Engine.
Unfortunately they haven't been able to whitelist the sender address as each e-mail gets a different one. For example, *3ckihSOVMMHlZHSL.JSMMHlZHSL.JS*#apphosting.bounces.google.com, with everything before the # being variable.
Update I'm including this screenshot of how Interscan sees the incoming e-mail. Notice that all senders are different:
If I look into the e-mail headers, the apphosting domain appears inside the Return-Path field:
Return-Path: <36kSiSwYIBh0883XL3E7.5EH883XL3E7.5E#apphosting.bounces.google.com>
The "From" field looks ok. It says what I set it to say, but the spam filter only looks at the Return-Path.
My client sysadmin doesn't want to whitelist the whole apphosting domain, as it wouldn't be only whitelisting my application.
How could I bypass this e-mail filters if I can't get an unique sender?
Thanks,
You can't change the return-path header of mail sent by App Engine. The way I see it, you have two options:
Whitelist everything from App Engine. Spam from App Engine is not a big problem, because it's expensive to send in the huge numbers spammers need, and we're constantly monitoring for spamming and shutting spammers down.
Whitelist based on the X-Google-Appengine-App-Id header, which will be set to the app ID of your app.
I am not well versed in spam filters, but it seems to me that if it can only whitelist based on one field, it is pretty lame. Unfortunately that does not help you. If this is an important client, and they absolutely refuse to budge, I see two possible paths forward:
Do some research into interscan to see if you can give the client some pointers (tactfully) on how to configure it to whitelist in such a way that your mail can get through, but only your mail.
Maintain a server outside app engine specifically for the purpose of sending emails. You can build a super simple web app that just sends out emails, and call it from within your app engine app.

Is a JID a user identifier as well as an application address?

In the App Engine docs, a JID is defined like this:
An application can send and receive
messages using several kinds of
addresses, or "JIDs."
On Wikipedia, however, a JID is defined like this:
Every user on the (XMPP) network has a unique
Jabber ID (usually abbreviated as
JID).
So, a JID is both a user identifier and an application address?
A JID is globally unique in that anyone sending an XMPP message as you#domain.com can be you.
However, an App Engine app can send XMPP messages as any number of JIDs.
Your app can send XMPP messages as your-app-id#appspot.com or as foo#your-app-id.appspotchat.com or as bar#your-app-id.appspotchat.com or as anything#your-app-id.appspotchat.com.
These IDs are still globally unique and identifying -- anyone sending an XMPP message as foo#your-app-id.appspotchat.com can be assumed to be your app.
Since I happened to have this up in my browser, the current best canonical definition of JIDs is here: draft-saintandre-xmpp-address, which just got pulled out of RFC3920bis.

Resources