Why are my e-mails from AppEngine re-written to be from "XXXX#appid.googleusercontent.com" when sending to a Project Fi address? - email

I'm using App Engine to send text messages to users (by sending e-mails to their SMS/MMS gateways). The e-mails act essentially as push notifications for iPhone users (since Apple doesn't support Web Push at this time).
The plan is to allow users to also reply to those messages and tweak their subscription (for example, replying with "unsubscribe" would remove their subscription and stop sending them text messages without having to log in to the site and make changes in the "account" screen).
I am sending e-mails using a From: address of notification#XXXX.appspotmail.com, where XXXX is my App Engine project ID.
If I send an e-mail to an AT&T subscriber at NNNNNNNNNN#mms.att.net (or my personal e-mail addresss ZZZZZZ#gmail.com), the sender appears exactly as I originally sent it, and those users may reply to the message (and it is received by App Engine, since it is of the proper format for App Engine to proces it).
However, when App Engine sends an identical e-mail to NNNNNNNNNN#msg.fi.google.com, the sender (the address in the From: line) is always rewritten to be XXXX#appid.googleusercontent.com (where "XXXX" is the App Engine project ID). I don't have any access to the mail for that e-mail address, and it is not posted to App Engine.
When sending mail from App Engine, it adds the following MIME headers:
X-Google-Appengine-App-Id: s~XXXX
X-Google-Appengine-App-Id-Alias: XXXX
My guess is that there's something on the Project Fi MMS gateway that's doing some translation that it shouldn't be doing, using those headers.
I couldn't find any useful references to appid.googleusercontent.com online, so I thought that I'd post here.
I checked in with Project Fi's support, and this was not in their playbooks or documentation at all.
So, two questions:
Why are e-mails sent from App Engine to Project Fi having their From: address rewritten?
Is there anything that can be done to fix it?

Related

How does SendGrid verify that an email was "delivered", and how can I do the same when using Gmail SMTP?

SendGrid is able to track if an email "... was accepted by the receiving server".
How would one go about doing this in an application that uses Gmail SMTP servers rather than SendGrid? (For example, a NodeJS application that uses nodemailer, or a Ruby-on-Rails app that uses Action Mailer, to send email through Gmail SMTP)
Google's different levels of paid G Suite offerings have logging you can use: Track message delivery with Email Log Search (google.com).
If you're not paying for G Suite and you're trying to build a way to collect statistics yourself, that becomes more tricky. Email service providers will generally count an "open" using something like a click-through on a link in the email (linked back to a property you control), or the loading of an image in the email (again, loaded from a property you control). You can read more about how ESP email open rates work here: The Science Behind Email Open Rates (and How to Get More People to Read Your Emails) (superoffice.com)
Gmail's SMTP servers don't report email delivery, only if there's a bounce. Google is somewhat closed with that, only paid users in G Suite can actually see the detailed delivery status using the Email Log Search tool.
Hope this helps.

Routed google domain emails

i have an idea about system where users respond to website's messages using the emails they received.
Is it even possible to have multiple imaginary emails with hash in the e-mail's name field(f.e., 1h2149g0as1gasd9123#mysite.com ) and those all imaginary e-mails just forward content to messaging#mysite.com e-mail. And afterwards we are able to parse the contents and know for which conversation the message was sent.
The emails are hosted in Google service. Could not find any information about this in internet.
Such option would be excellent, because there would be no need of including the identificator in e-mail's content which might be deleted if no quoted text is in replied e-mail.
I'm open to any other suggestions that would fit in this situation.
When using Google's service, you can add tags after the e-mail address using a +. For example...
test#domain.com
test+12345#domain.com
test+wuishw78#domain.com
will all go through to test#domain.com, and you can then look at the address.
Note this is not supported by all e-mail systems, so while this works on Google's hosted e-mail, it may not work on others.

JavaMail to send email out which server?

Here is my issue, I'm creating a website with a little login and resetting password. It's basic stuff, when user forget the password they can click the link and my application will send an email with a link to reset the password. Now, I'm using Google App to send/receive email so I created a new alias like noreply#company.com.
And I just got a confirm email from Google that I'm not allowed to use Google Server to send out email by JavaMail, because they do not support JavaMail as a mail client, the issue that I'm having is I'm getting AuthenticationException back from smtp.google.com.
Moreover, I'm using Amazon EC2 to host the application as well, and amazon provides SES service to send out emails. So, the question would be can I use Google App to host our company email for every employee, but can I still use Amazon SES to send out emails by JavaMail within the same domain name as we are using with Google Apps?. So, the emails that we'll be sending out would be noreply#company.com but will be from Amazon SES.
I'm not sure if I'm making this clear enough, my concern would be we redirect email MX Record to Google App already, I think we cannot redirect to Google and Amazon at the same time?
The application we are writing is based on Grails, so the email would be from Spring Email
Cheers,
Based on my usage of Amazon SES, you should be able to use the configuration you are suggesting without any issues. You do not need to add/change any MX record when using SES, because SES does not allow you to receive emails. It is only a service for sending (relaying) email messages, i.e., as far as I understood your needs, it will serve you perfectly, and your source email address will be the same as you use today.
When you sign up for SES and want to start sending test messages, you need to verify your source and destination email addresses before actually sending emails. You can achieve this verification through either scripting (ses-verify-email-address.pl) or API (VerifyEmailAddress on AWS SDK). After sending the verification request, you should receive an email address on the verified account. Just follow the message instructions and you can safely send some test messages.
When you are satisfied with your testing, you should request production access, and after this step, you no longer need to perform verification on destination e-mail addresses.
In order to call the API, I think you can use the AWS SDK for Java without problems in your application.
See more on:
http://aws.amazon.com/ses/
http://aws.amazon.com/sdkforjava/

How do I build a notification email/reply system like Facebook?

When users receive a notification email about a new private message on Facebook, they can reply to the email and have their response automatically added to the conversation on the site.
How can I build a cross platform system like that? I'm building a group chat system.
This is obviously way over-simplified, but here we go:
The way Facebook's emails work is by using a string that's unique to the receiver in the reply-to address:
<m+50edqb50000003jtdj389k6xib6hofj6t41q1c45sdt92qc#reply.facebook.com>
So when Facebook receive an email into reply.facebook.com, they (presumably) parse the string after the plus sign, decide which user/conversation it's relevant to, and add the text of the email into that conversation.
One option:
Send every notification email with a unique reply-to address, then receive replies with a customized SMTP server that will pair responses with the originating message object in your DB.
Since you are using django (according to your tags) I would recommend looking at the Lamson python SMTP server. It can be programmed to correctly attribute each message. Using Lamson with Django is documented.

Send mail without MFMailComposeViewController

I want to send mail from an iPhone app without showing an MFMailComposeViewController. I also want this mail to be sent from the user's default Mail account. Is it possible to do this?
This is not supported by the iPhone SDK, probably because Apple doesn't want you to do it.
Why not? My guess: Because it's easy to abuse. If we knew user's email address, we could spam them, we could fake emails from them, etc. Imagine finding out an iPhone app sent an email as you without your knowledge -- not cool, even if the app had good intentions.
So, anything you do to get around that, is likely to get you rejected from the app store.
Having said all that, you could basically write your own smtp interaction code to chat with the user's outgoing mail server. For example, if the user has a gmail account, you could ask them for their email and password, you'd have to know how to talk to the gmail servers, and send email through them.
Going that route means asking the user for their username, password, and either asking for or figuring out their mail server information. Another choice is to send directly from the phone (your own smpt server, not just a client), which is a bit more coding. And if you write your own server, the mail you send is more likely to be blocked since your originating IP might not match the domain on the sender's email.
There also exist some libraries that might help out. Previous related question:
Open Source Cocoa/Cocoa-Touch POP3/SMTP library?
There are legitimate reasons for wanting to send an email. (Such as communicating with a server using SMTP instead of HTTP)
This blog post should get you going: http://vafer.org/blog/20080604120118
It is possible to use MFMailComposeViewController without user interaction. See my answer on the iPhone send email not using MessageUI question.