Sending email works locally but not once deployed? - email

I have a meteor app that is using the email and passwords packages to handle basic password reset functionality.
On my local machine I set the MAIL_URL env variable to:
smtps://{user}:{password}#smtp.gmail.com:465
and after some fiddling with the associated gmail account (I had to allow less secure applications) it worked.
My live environment is heroku, so I set the env variable there using:
heroku config:set MAIL_URL=smtps://{user}:{password}#smtp.gmail.com:465
and then confirmed that it was set using heroku config. But for some reason when I try to reset the password on my production environment, it throws the following error:
Exception while invoking method 'forgotPassword' Error: Invalid login:
534-5.7.14
I even did a heroku restart to be absolutely sure that the env variable was picked up and I still get the error. What's odd is that this is the same error I was getting before I enabled "Less secure apps".
Can anyone see why this might happen? Suggestions as to how I might fix it?

in the Heroku web on your box in Settings/ Config Vars do you actually see this setting?
I see your issue may be due to not confirming the Captcha... Check this out: Nodemailer with Gmail and NodeJS

Related

Trouble connecting to Realm Server on AWS EC2

I am having trouble connecting to my online Realm on EC2. I've got an EC2 instance running. I've run start-object-server.command. I've pasted the code for my setupRealm() method.
let address = "XX.YYY.ZZZ.AA:9080" // "IPv4 PublicIP" from my EC2 dashboard
var httpURL: URL! { return URL(string: "http://" + address)! }
var realmURL: URL! { return URL(string: "realm://" + address)! }
func setupRealm() {
// My credentials when setting up the Realm admin dashboard after launching realm object server.
let username = "XXXXX#gmail.com"
let password = "XXXX"
let credentials = SyncCredentials.usernamePassword(username: username, password: password)
SyncUser.logIn(with: credentials, server: httpURL) { user, error in
guard let user = user else {
print(String(describing: error!))
return
}
...
}
}
SyncUser.logIn produces this error:
Error Domain=NSURLErrorDomain Code=-1004 "Could not connect to the server."
UserInfo={NSUnderlyingError=0x600000059680 {Error Domain=kCFErrorDomainCFNetwork Code=-1004 "(null)"
UserInfo={_kCFStreamErrorCodeKey=61, _kCFStreamErrorDomainKey=1}},
NSErrorFailingURLStringKey=http://XX.YYY.ZZZ.AA:9080/auth,
NSErrorFailingURLKey=http://XX.YYY.ZZZ.AA:9080/auth, _kCFStreamErrorDomainKey=1, _kCFStreamErrorCodeKey=61,
NSLocalizedDescription=Could not connect to the server.}
I also can't log in to my synced realm using the Realm Browser, though I am able to open local (non-synced) realms from the iOS simulator. And I am running the latest version of Realm Browser.
What's strange is that a week or so ago I was able to connect to the EC2 realm using both my app and the browser, as well as another app that syncs with the realm. I've compared the code and they're basically the same –- any differences I've spotted I am very confident that they don't matter (and I've tried changing some things back, to no avail.)
Since the time it was working, I've installed the recent macOS updates, as well as the Realm 2.5 update. I had some trouble with the realm updates and wound up installing and reinstalling them a few times, but I believe it's working normally, with, again, the latest version of everything. I don't think I changed anything else, I don't remember.
Unfortunately, I actually don't remember my process for setting up the EC2 server -- that is:
I don't think I did anything with AMI's. I don't remember installing any, or anything like that. Although my EC2 instance does have an AMI ID: realm-object-server-hvm-20170309 (ami-d518b9c3). So maybe I did.
I have my keypair in a safe place on my HD, and I think I used it for something at some point...but I don't remember.
I think I used my Public DNS for something at some point...but I don't remember.
What I do remember is:
I didn't use CocoaPods for anything. I dragged in the Realm frameworks and did import RealmSwift (though I have since installed and used CocoaPods for other things and would be fine converting these projects to use CocoaPods)
In the instructions to install Realm Object Server the only thing I did was install the macOS bundle and run start-object-server.command to start the server. I didn't do anything past that. No configuration or security groups or anything. I didn't do any of these because I'm a relative beginner and I don't understand most, if any of it (doing very well with swift but all this terminal code and server stuff is generally over my head). For instance, I don't really understand any of the "Mandatory settings" section, like how to specify settings in the config file, or how to give them as command line arguments.
Similarly, I'm unclear when it's necessary to have the server running in the terminal. I only just realized today that the reason that localhost:9080 sometimes doesn't work is because I'm not running the server.
I'm sure I've done a great many things wrong, but what's strange is that this all used to work, even with all the things I've probably done wrong or left out. I hope someone can help. Thanks a lot.
PS. Here's how the Realm Browser behaves when I try to access my realm in various ways:
(you can see by the number of options I'm trying that I don't really know which is which/which one I'm supposed to use. Again, one of these worked in the past, but I don't remember which)
Open Sync URL, realm://XX.YYY.ZZZ.AA:9080/~/ gives the "Please provide valid credentials to access this Realm" dialog. And I am pretty damn sure I'm entering the correct credentials.
Open Sync URL, http://XX.YYY.ZZZ.AA:9080/~/ leaves the "Connect" button disabled
Connect to Object Server, realm://XX.YYY.ZZZ.AA:9080/ gives "Could not connect to the server."
Connect to Object Server, http://XX.YYY.ZZZ.AA:9080/ leaves the "Connect" button disabled
I've got an EC2 instance running. I've run
start-object-server.command.
start-object-server.command is for running local instances of the Realm Object Server; the ones accessible via http://localhost:9080. You might need to be careful since if you're running a local instance of ROS locally, as well as trying to connect to one remotely on AWS, there might be some confusion as to which server you ended up talking to. :)
I've pasted the code for my setupRealm() method.
That code looks correct. Just remember that if you ran start-object-server.command, you would have been presented with the localhost instance of ROS automatically, so those credentials wouldn't exist on your EC2 instance at present.
I also can't log in to my synced realm using the Realm Browser, though I am able to open local (non-synced) realms from the iOS simulator. And I am running the latest version of Realm Browser.
That's normal behavior. You can open local Realm files in the Browser, but for ones created with the Realm Mobile Platform, you'll need to connect to them; you cannot open them directly. If you can't connect to a Realm, that either means the Realm Mobile Platform isn't running, or isn't configured for the right URLs properly.
I had a play with setting up my own EC2 instance, and I got it working as intended. You can tell if it's working because you should be able to navigate to your public DNS URL with port 9080 and see the Realm Mobile Platform dashboard login page. (eg 'http://ec2-00-000-000-00.compute-1.amazonaws.com:9080').
It's possible that while you set up an EC2 instance, the Realm Mobile Platform itself wasn't installed too. If that's the case, you can easily manually install RMP by connecting to your instance via SSH and running the Ubuntu installation script:
# Setup Realm's PackageCloud repository
curl -s https://packagecloud.io/install/repositories/realm/realm/script.deb.sh | sudo bash
# Update the repositories
sudo apt-get update
# Install the Realm Object Server
sudo apt-get install realm-object-server-developer
# Enable and start the service
sudo systemctl enable realm-object-server
sudo systemctl start realm-object-server
But the crux of the matter is that you need to confirm you can access your Realm Mobile Platform dashboard on your EC2 in order to confirm that the Object Server is indeed running, and you've set the proper credentials. Good luck!

Host GitLab in VirtualBox

I tried the prepared VirtualBox stack from bitnami, which I run in bridged mode, but could not pull/push through SSH, I would get prompted with a password request. I have no idea what kind of password this guy wants from me, since none of them worked and I would always get access denied.
I then disabled passwords in the sshd configuration file on the server, since I want to work with keys anyway, defined my own authorized_keys and added public keys for a sample user.
I then got the message:
no supported authentication methods available (server sent: publickey)
I tried calling the repository through HTTP, but this would not enforce any permissions.
I tried setting up my own Virtual Machine with the installer from GitLab, but despite doing everything from tutorials I can't connect to GitLab from outside the VM.
Why and what kind of password does tortoise gitplink want from me? Why can't I use the keys public keys that are placed in the default location on my Windows, and also in a file authorized_keys on the server I am referring to in the sshd configuration file, why does it tell me that there is no authorization method after I disable passphrases?

Jenkins won't send e-mails anymore

This might be a tough thing to figure out but i have to give it a try.
With no changes i am aware of, my jenkins just stopped sending out e-mail notifications. I use jenkins 1.609 and email extension plugin 2.40.5. Jenkins runs as a service using a service user who also has the rights on the server to send e-mails. Ports to our smtp-server are unlocked. Used telnet for testing that everything works as expected. SMTP-server works fine, so it has something to do with jenkins and i cant figure out what is going wrong.
For some unknown reason jenkins still fails to send e-mails. When i use the test-feature that jenkins offers i get: javax.mail.AuthenticationFailedException: 535 5.7.3 Authentication unsuccessful which tells me that either user or pw is incorrect, but as mentioned i've checked many times, it's setup correctly. Can anyone help out with this?
UPDATE:
After decrypting the password i can safely say that jenkins does save the password correct. Is there any way i can check that jenkins actually compares the correct encrypted passwords with each other? From my understanding jenkins uses 2 different encrypting techniques, maybe it uses tech1 for stored pw and tech2 for compare pw?
ANOTHER UPDATE:
Just tried adding a new certificate to the keystore, just in case, still no change.
MORE UPDATES:
Tried updating the mailer plugin- no change
Tried different users - all failed with the same error
So no matter what user i try, they all fail, but have jenkins execute a script which sends e-mails using said users it works.
August 18, 2016 - no change

Unable to connect to my GAE account through appcfg

I was surprized not to be able to connect to my account through appcfg my password was right, butthe app ansered it's not.
When I change the google setting : https://www.google.com/settings/security/lesssecureapps to make Access for less secure apps enabled, it worked.
Is there something I'm missing or must i have this security hole open to be able to use appcfg?
Please notice I'm using eclipse to publish my apps, and the eclipse plugin connects with even if the accont security is safe, but calling appcfg from the command line for roll back was the operation that failed...
I thought eclipse uses the command line to upload my app? I'm obviously wrong.
So the question is: is there something I have to do to be able to have Access for less secure apps disabled and use appcfg ?
Workaround is to use an OAuth2 token instead of using password based authentication.It is more convenient.
just add the option --oauth2 before the update, you get a key which you paste in for appcfg
I recommend you to try uploading your GAE app from the command line by:
Open CMD
Going to the GAE \ BIN directory
Enter the following command:
appcfg.exe update PATH_YOUR_APP_WAR
After that you will be required to enter your GAE email address and password, that's it

SilverStripe RestfulServer basic auth fails on some servers

I seem to have run afoul of a known bug with RESTfulServer: https://github.com/silverstripe/silverstripe-restfulserver/issues/6
I'm using SilverStripe 3.1 with RESTfulServer. On my test server, the setup functions as expected: when not logged in, a request to http://www.example.com/api/v1/ObjectName/ID pops up a basic HTML auth box, and a username and passw## Heading ##ord can be entered successfully.
The test server is running Ubuntu 14.04 with Apache2, PHP5 and MySQL5 from the repos.
On the production server, when an unauthenticated user tries to GET http://www.example.com/api/v1/ObjectName/ID the same basic HTML auth box pops up, but the login always fails.
The production server is hosted at icdsoft, running PHP5, MySQL5 and Apache2.
Things I've tried:
- Including the credentials in the URL: http://user:pass#example.com/api/v1/ObjectName/ID
- Removing special characters from the login name and password
- Calling http://www.example.com/dev/build?flush=1
If anyone could shed some light on a cause or solution, I'd be very grateful.
Thanks,
Jeremy.