Mailing functionality using node.js's nodemailer fails in openshift - node.js

I have an issue with nodemailer support in openshift. I created a simple node.js application that sends a mail using nodemailer, following the hello world example given in https://github.com/andris9/Nodemailer
The mail is sent from a gmail id to two other gmail ids. This functionality is invoked while rendering the home page of my application. It worked well when the node.js application was run locally. I created a node js application in openshift and tested the application locally. I worked well. But on deploying the app to open shift, the mailing functionality failed, though the home page was rendered properly.
Is this mailing feature supported in openshift? Or am I missing something, like some extra configuration that is required in openshift for enabling this mailing support?
Thanks.

Hmm, this should work ... can you try changing the port # you are using -- say try 587 with TLS in the
wellknown.js configuration. See if that works.
The other thing to check is that your email provider allows authenticated connections from Amazon AWS EC2 hosts.
HTH

Related

Node JS. How to send email without third-party mail server

I need to send (and maybe in the future also receive) email to Node JS without the help of third party servers (such as gmail).
I found node-mailer-direct-transport, but it looks like it is outdated and unsupported.
Is it possible to send email directly using Node JS without a mail server, if not, is it possible to create a mail server locally using Node JS?
You can use maildev. It is a good thing to use the locally easy to build in your environments.
And here is the docker-compose example to run maildev in container

Testing Instagram Basic API locally

I followed with success the "first steps" guide here to test the Instagram API.
I did it as suggested in the docs with an heroku app.
Now that I obtained my access token, I would like to test this NodeJS Instagram private API on my local machine, without having to deploy on Heroku only for development purposes all the time I make changes.
In practice, I would like to test it with localhost, instead of myapp.herokuapp.com.
I thought to add a redirect OAuth URI like https://localhost:8443/auth/ in the section of the image below.
As it requires the URI to begin with HTTPS, I guess I have to enable it in my Express JS, as explained here.
Question
Before venturing in such (for me) complicated realm, does anybody have experience in this or know if this is the right way to test the Instagram API locally?
I was able to make it work with localhost, but it was very tedious.
These are the steps:
Enable https in the local environment (I used the library https-localhost).
[I don't know if this is mandatory] create a test app* from the main app (https://developers.facebook.com/docs/development/build-and-test/test-apps/)
Set the redirect OAuth URI to https://localhost:<MY_PORT>/auth/ and update also all other URIs in .../instagram-basic-display/basic-display/ settings.
Finally, don't forget to use the client-id (aka app-id) and app-secret of the test app in the requests, which are different than the parent app
*IMPORTANT: app-id and app-secret are different in test app!
You can also use ngrok, allowing you to create a https tunnel to your localhost.
It enables you to access your localhost via https over the internet by creating a public url for you (e.g https://xxxxxxx.ngrok.io/) accepted as valid URI by developer dashboard.
Also, no need to create a test app for this. Great tool for dev. IMHO.

Email is not working in Live only in Node.js

I'm using the node to send the email and it works fine in Local but when I upload on AWS instance it's not working.
To send the Email I'm using the Node Mailer which is very common so I'm not putting the whole code but I'm sharing the Link and the code is 100% the same.
I'm getting below Error in live only.
Note: I Enable the Google less secure app also.
seems like they ask you to follow link in smtp server negotiations response, and probably fill captcha.
I'm not sure for less secure app, but for me creating application password for access email on this page
https://myaccount.google.com/apppasswords
worked properly both with nodemailer and Claws email client
You can try this:
Enable less secure apps - https://www.google.com/settings/security/lesssecureapps
Disable Captcha temporarily so you can connect the new device/server - https://accounts.google.com/b/0/displayunlockcaptcha
Finally I found the solution that It was related to AWS server config issue.
In AWS, EC2 -> Security Group I open all TCP port and tried and it's working fine now.

Steam Web API via Node.js on my shared hosting

Basically, what I'm trying to do is have the Steam Web API running via Node.js on my shared hosting so I can display Steam user profile information on my site. Unfortunately, I'm having a lot of trouble getting it working. I've been following this guide.
This is what I followed to get NodeJS running.
I have it set up like so:
Node.js version - 9.11.2
Application mode - Production
Application root - /home/<name>/nodejs/steamapi-server
Application URL - <mysite.com>/steamapi-server
Application startup file - server.js
My server.js file (minus my API key).
My package.json file.
All dependencies are installed and the script is running.
However, when I go to /steamapi-server all I get is: Cannot GET /steamapi-server/ whereas I would normally be seeing "Hello, World!".
I tested this all locally beforehand and it was working.
Turns out I needed to change app.get('/' to app.get('/steamapi-server'
Now it's working.

OpenProject webhooks not fired

I'm trying to use the OpenProject's webhook to send workpackage's data to a third-party system, but it isn't even fired.
I did all my tests using this OP docker container from version 7.4.0 to 7.4.7 but none of them worked. In all of these images, the webhook is included and configured, then theoretically any additional setting isn't needed (except the webhook register in the web interface).
The passenger and the worker:jobs are running. There isn't clue in the log files. The webhook is enabled and set to trigger a http POST call in a localhost address.
Did anyone pass through a similar issue? I'm not a Ruby developer, and I wonder if some kind of daemon or service start is missing.
Our team figured out how to make the webhooks works. It's only needed check the Work package added and Work package updated options in the Email notifications group on System settings of the instance.
This is a undocumented setting, and I see it as a feature issue.
Nevertheless, it's working.

Resources