3
votes

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: '[email protected]',
        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?

1
Hi, Do you got any solution on this, as I am also facing the same issue. Please let me know what you have done to solve this issue. - Jyoti

1 Answers

0
votes

I have fixed the same issue! Try this (on your VPS):

  • cd /home/yourProject/bundle/programs/server && npm install --production
  • npm install bcrypt simplesmtp
  • reboot
  • cd /home/yourProject/bundle/programs/server/npm/node_modules/meteor/ && rm -rf npm-bcrypt/
  • cd /home/yourProject/bundle/programs/server/npm/node_modules/meteor/email/node_modules/ && rm -rf simplesmtp/
  • restart your app