Custom Incoming Mail Domain With Google App Engine - google-app-engine

I have set up a custom domain for my google app engine application, which accepts incoming email. While this works great if you want to use an email address like example#example.appspotmail.com, I would like to use a custom domain like example#example.com. Is it possible to do this?
A solution that will not work, is to simply use Google Apps to forward emails to the appspotmail address. This is because I accept emails to any number of email addresses at my domain, and I would need to set up this forwarding for each one - simply not doable.
Thanks for any help!
Devon

App Engine doesn't currently support receiving email on custom domains. You'd need to point your MX records to a service that supports mail redirection, and have it redirect all addresses to your appspotmail subdomain.

If I understand correctly you have many different email addresses you want to forward to appspotmail and due to the large number of addresses it would be time prohibitive to set up forwarding for each one. One solution I admit isn't perfect but works well is to set up a single email account that forwards all email to appspotmail. Then in Google apps make that email address a Catch all email address. What this does is that any email address that does not match an existing email address will go to the catch all email adress then it will be forwarded to appspotmail. With this trick you must only verify a single email address.
It will also allow you to specify a few addresses that don't go to appspotmail by creating the email accounts if you need to. This solution allows you to have an unlimited number of addresses forwarded to appspotmail.
Solution 2 allows a limited number of addresses forwarded to appspotmail. Create an email address that forwards to appspotmail then you can assign that address multiple "nicknames" which are aliases for that account and will also forward. You can create up to 30 email aliases for an individual account. If you need more create another account and repeat. The maximum number of email aliases for your Google Apps account is 10 times the number of user accounts. Using this technique if you have a free account and you signed up after May 10, 2011 you can make up to 310 forwarding addresses. If you have a free account and signed up before May 10, 2011 the limit is 1550 forwarding addresses using this technique.

Related

send email on Google App Engine from custom domain

What I have done:
I have added my domain app.mydomain.com to my app engine project, and can successfully visit id.appspot.com using app.mydomain.com.
I have registered mydomain.com on google app for business.
The problem:
The problem is -- I am NOT able to send emails using #mydomain.com address. If I register an info#mydomain.com as an developer, this will probably solve the problem, but we need to send from more than one address, and I don't think registering a new developer for each address is reasonable.
Anybody knows how to solve this? Thanks!
You have two options:
Register all emails that you want to use as administrators/developers but as you mentioned in your post you don't want to do that.
Use SendGrid (or any other email services like Mandrill, Mailgun, etc.) which will give you a lot more features comparing to what GAE offers, including 25k free emails instead of GAE's 100.
According to the docs, the sender would need to be an administrator on the project (called "owner" in the new Developers Console). Another route would be to just use a separate email sending service like SendGrid or Postmark.
You can use the GMail API to send emails as users of your domain. Note that the emails need to be aliases, groups or users of your domain.
You shouldn't have any problem adding and verifying your domain, adding the necessary permissions to send emails. Then, every email address in your domain can be used. See here in the docs: https://developers.google.com/appengine/docs/java/mail/#Java_Sending_mail

java googlemail blocks multiple access

I need to allow a user of my App to email themselves when an even occurs. I am not sure how to do this.
My first idea is to create a dummy gmail account, and have my App sign-in and send from there via java code. This means hardcoding the password BUT as account not used for anything other than one way emailing - it does not seem to be a problem.
However, I understand that google is pretty proactive about security and if my App (which is global) tries to log into same account in several different countries during a 24 hour period - it will block the email.
I have seen the "delegate" functionality, but that would mean that each user needs their own gmail account which is not practical.
Is there a way to force gmail to allow the sign-ins to happen from wherever?
Or is there a better approach to this problem?
probably not a good idea to have your app to mail from a private account, if I understand you correctly. Best to use email service like http://expresspigeon.com or http://sendgrid.com and simply send a transactional email from your app account. In other words, use an ESP.
The safest would be to ask the user for all the configuration information necessary to access their email server as themself, then send the email as themself to themself. You can use JavaMail to send the message, but you'll need to ask for all the configuration information that any other email application would ask for in order to configure access to their mail server.
There may also be Android-specific ways to do this using the default email application.

Traffic Splitting By IP Address on Google App Engine

I'd like to direct traffic to different versions of Google App Engine code based on a set list of known IP Addresses.
For example, if an incoming request is from an IP Address on a given list, then traffic is directed to version 1. If not, then version 2.
Is there a way to do this from the admin console or deployment configuration?
The end goal is to grant access to extra features when the site is accessed from an approved IP Address. If I can't do this from the admin console, then I plan to get the IP Address during the user's login process, and set their security role based on IP.
There's not a way within the admin console or deployment process. However, if you do cookie-based traffic splitting, you can set the cookie yourself (based on the incoming IP address, or another value you desire). The value is stored in GOOGAPPUID and the value you'd want to use is described in the documentation, and varies depending on the number of versions you're splitting between and the respective levels of traffic you'd like to send to each version.
If you don't want to do traffic splitting for users not on a given list of IPs, you should make sure to explicitly set the cookie for all users. Otherwise, App Engine will provide the value (and send some users to both versions) by default.

How do I send email from Google App Engine with a random sender?

How do I send email from Google App Engine with a random, non-app admin sender using a custom domain name (e.g. xyz#myshop.com ) ? We need to allow the users of our website to communicate with each other through a custom made messaging system but also allow them to reply directly from their email. Something similar with the craigslist system. However seems that GAE doesn't allow us to send email from an address that is not admin. Is there any workaround / patch ? We are the owner of myshop.com domain name (verified through google apps) so I don't see why a such thing is not allowed.
While you can't use just any random address, you can use a registered administrator address with a '+' suffix. So you could send the mail with a 'from' of, say, message-reply+HASH_VALUE#myshop.com. Then your app will receive the reply, and can use the hash to decide which user to forward the mail to.
How about sending the email from your admin account, but adding a reply-to header, specifying the user's email-address?
Google doesn't allow to use random addresses. You can star this bug.
http://code.google.com/p/googleappengine/issues/detail?id=3069
However, since the users are apparently registered with Google Apps, the system can send emails on their behalf when they are signed into your application.
The sender address must be one of the following types:
...
The address of the user for the current request signed in with a
Google Account. You can determine the current user's email address
with the Users API. The user's account must be a Gmail account, or be
on a domain managed by Google Apps.
http://code.google.com/appengine/docs/python/mail/emailmessagefields.html

Directing email for a domain to AppEngine email receiving service?

I'd like to have emails to a given domain, say http://mydomain.com/, processed by an AppEngine app, let's call it http://emailprocessor.appspot.com/ .
That is, an email to "hello#mydomain.com" should be received and processed by emailprocessor.appspot.com as if it was an email to "hello#emailprocessor.appspot.com" .
I imagine I could do this via MX records for my mydomain.com domain, but I can't find instructions anywhere.
Is this possible, and if so does one set it up?
Also there is no direct support for this according to documentation
BUT
if your http://mydomain.com/ hosted on google apps and you create user hello#mydomain.com as gmail account and in it configure email forwarding rule to the "hello#emailprocessor.appspotmail.com" it should work as it works for any general gmail account email forwarding. It preserves original headers like sender etc.
I almost sure that most of other mail services or servers can support this feature. check documentation of your mail service.
PAY ATTENTION! it must be emailprocessor.appspotmail.com note the appspotmail.com not appspot.com
I did not try it myself yet so I will be happy if you confirm that this works. Again it should.
What I have done is to point the MX record to a server that allows you to do email domain forwarding. Then you can forward all emails to emailprocessor.appspotmail.com.
The advantage of this is that you catch all usernames: hello#mydomain.com, goodbye#mydomain.com, etc...
If your host has cPanel see this: http://www.siteground.com/tutorials/email/email_domain_forwarding.htm
No, there's no documented support for receiving mail on a custom domain.
You would need to host mail elsewhere and configure a forwarder to emailprocessor.appspotmail.com.

Resources