mercredi 15 avril 2015

Meteor forgot password email not sending

I'm building a meteor based website. And deploy it in ubuntu vps, with nginx and SSL certified.


When creating forgot password mechanism using forgotPassword method:



Accounts.forgotPassword({email: the_email});


I got "HTTP/1.1 502 Bad Gateway" message, and it seems come from Meteor websocket. And of course, no email sent.


I use mandrill for sending email, and the configuration more-less like this:



smtp = {
username: 'dummy@email.com',
password: 'abgfgtyhuyujkQVD1ox1Od7eQ',
server: 'smtp.mandrillapp.com',
port: 587
}

process.env.MAIL_URL = 'smtp://' + encodeURIComponent(smtp.username)
+ ':' + encodeURIComponent(smtp.password) + '@' + encodeURIComponent(smtp.server) + ':' + smtp.port;


This config is inside the server folder.


I also tried defining the MAIL_URL environment variable with that mandrill setting and still didn't work.


This only happen in deployed version, but runs well in local. The reset password email successfully sent when I test it in local.


Anybody have experienced this problem?


Aucun commentaire:

Enregistrer un commentaire