Why javax.mail packages in google app engine sdk? - jakarta-mail

I can find javax.mail packages in google app engine sdk. Can anyone tell me the purpose of including such packages in google app engine where we already have a dedicated jar ( java mail) for these packages in market.

Control of the environment. When the JavaMail API is provided it allows GAE to control what mail server and javamail providers are used for sending and receiving.
From the Overview of Sockets API for Java:
Sockets are only available for paid apps, and traffic from sockets is billed as outgoing bandwidth.
[snip]
Port 25 (SMTP) is blocked;
The GAE javax.mail API provides email to free GAE accounts where as if you had to include a jar you would have to get a paid GAE account to send or receive email.

Related

Can't send email using email function in Google Cloud Platform

We have G Suite account with our domain name. And our server is Google Cloud Platform. We are using PHP for our development, we trying different code for sending mails, but cant receive any mails using mail functions, and we contact G Suite account they said all the settings are working perfectly... This issue is regarding Google Cloud Platform, cloud reject the mails.
Is any additional settings needed to implement on Google Cloud Platform to establish a connection with G suite account?
Should we have an App Engine account for sending email via code?
Any ideas on what might be happening here or what to test next?
Disclosure: I am a product manager on Google Cloud Platform (though not the products discussed here specifically).
Note that outgoing connections on port 25 (SMTP) are disabled, so you cannot use that for sending email programmatically. This is probably the issue that you're running into.
Here are some alternatives, depending on what server product you are using:
Google App Engine (GAE): use the Mail API
Google Compute Engine (GCE) or Google Container Engine (GKE):
send email via G Suite domain, or
work with one of our email partners, such as SendGrid, Mailgun, or Mailjet

google app engine not able to connect to outlook mailbox

I are trying to read emails from an outlook mailbox using javamail api. The protocol for this mail reading is imap. Google SDK comes with java mail API but it doesn’t support imap protocol. For the purpose I need to include java mail api libraries in pom.xml. Now there are two copies of javamail api in app engine project, one that comes with google sdk and the other one from pom.xml. During execution of java code to connect to mailserver, app engine is not able make a connection sometimes. The behavior is not consistent as GAE might be loading java mail api in random order. When GAE doesn't connect to mailbox, i see the following error:
javax.mail.MessagingException: No login methods supported!
(com.sun.mail.iap.ProtocolException: No login methods supported!)
at com.sun.mail.imap.IMAPStore.protocolConnect(IMAPStore.java:477)
at javax.mail.Service.connect(Service.java:248)
at javax.mail.Service.connect(Service.java:91)
at com.disney.util.MailBoxConnector.connect(MailBoxConnector.java:48)
I could not find a workaround for this problem. Any suggestion will be greatly appreciated.

Google PubSub: SSL error when subscribing using an AppEngine push endpoint

I created a topic which I subscribe to using a push endpoint. The endpoint is a simple AppEngine web service. The Google PubSub documentation states that endpoints must be secured by HTTPS.
I am not receiving any traffic to the push endpoint. The AppEngine web service shows no requests. I've verified through the Google PubSub dashboard that messages are being published on the topic successfully. The dashboard shows unreachable_ssl_error for push subscriptions. Why is Google PubSub reporting this error?
When I try to access the SSL AppEngine endpoint via a browser I receive an SSL cert error also. Is this normal for AppEngine sites?
As documented at https://cloud.google.com/appengine/kb/general#https , SSL is supported on App Engine, but in a somewhat peculiar way.
Specifically, and I quote...:
Note: After April 2013 Google does not issue SSL certificates for
double-wildcard domains hosted at appspot.com (i.e. *.*.appspot.com).
If you rely on such URLs for HTTPS access to your application, change
any application logic to use "-dot-" instead of ".". For example, to
access version v1 of application myapp use
https://v1-dot-myapp.appspot.com.
Also look at the previous paragraph at this same URL about the need for secure in app.yaml and a link to language-specific instructions on exactly how to configure things, e.g https://cloud.google.com/appengine/docs/python/config/appconfig#Python_app_yaml_Secure_URLs if you're programming in Python.

Can I Use Google App Engine as XMPP Gateway

I have a Cloud App hosted on Windows Azure and I need to integrate XMPP with the service. Can I use GAE's XMPP API to achieve this? I'll need to be able to create new Jabber IDs and send & receive messages from other clients like GTalk.
As far as I know, GAE only supports Java, Python and my expertise is limited to .NET & C#; so, I'll have to make my Azure App to communicate with the GAE.
Finally, can I use GAE as an alternative to running ejabbered on Windows Azure Virtual Machines or Amazon EC2?
Thanks in advance... :)
You could but it would be very limited. You may be better off running ejabbered somewhere else.
With GAE's XMPP API, your username selection is rather limited. See the GAE XMPP Overview API documentation.
Your Cloud App would need to send and receive messages from your GAE app via HTTP accesses. This is no big deal for sending, but you'll have to work your own way of receiving messages. You could buffer your messages to the datstore and poll for messages. You could use the Channel API to receive messages directly, but so far the Channel API client is only available in Javascript, so your app would need some sort of javascript interpreter to use the client.
You will be able to send/receive messages from other XMPP addresses like GTalk clients.

Email Support in Google App Engine

Is there a mechanism to receive emails and/or establish IMAP connections in Google App Engine? I know that GAE provides limited support for the JavaMail API (i.e. only allow to send emails). Any workaround?
For future readers of this post: the ability to receive email has been recently added to Google App Engine. Link to announcement
Not currently, but it is on the roadmap:
http://code.google.com/appengine/docs/roadmap.html
See http://www.smtp2web.com/ (made by a googler) for a temporary solution.
No, that is a limitation of the system (network calls are essentially limited to web requests).

Resources