donejs / bitballs

A basketball tourney application.
https://donejs.com/bitballs.html
MIT License
11 stars 17 forks source link

Error registering new user #280

Open Macrofig opened 7 years ago

Macrofig commented 7 years ago

It seems like the email server won't let me send out emails. Maybe because i'm on default/local host? Maybe it is my the way my personal email is configured? Either way, there doesn't seem to be any documentation on how to configure the email system or error handling (this caused the server to stop). If it is something I did wrong, I can document it.

Node app is running on port 5000
Potentially unhandled rejection [6] {"readyState":4,"responseText":"{\"message\":\"No session\"}","responseJSON":{"message":"No session"},"status":404,"statusText":"error"} (WARNING: non-Error used)
POST USERS: creating a new user. Current count of users: 0
User Registration step 1 succesful
ERROR sending email { Error: Sending failed
    at DirectMailer.<anonymous> (/Users/jorozco/projects/donejs/bitballs/node_modules/nodemailer-direct-transport/lib/direct-transport.js:157:41)
    at DirectMailer.<anonymous> (/Users/jorozco/projects/donejs/bitballs/node_modules/nodemailer-direct-transport/lib/direct-transport.js:228:30)
    at DirectMailer.<anonymous> (/Users/jorozco/projects/donejs/bitballs/node_modules/nodemailer-direct-transport/lib/direct-transport.js:326:28)
    at SMTPConnection.g (events.js:286:16)
    at emitOne (events.js:96:13)
    at SMTPConnection.emit (events.js:188:7)
    at SMTPConnection._onError (/Users/jorozco/projects/donejs/bitballs/node_modules/smtp-connection/lib/smtp-connection.js:518:10)
    at SMTPConnection._actionGreeting (/Users/jorozco/projects/donejs/bitballs/node_modules/smtp-connection/lib/smtp-connection.js:893:14)
    at SMTPConnection._processResponse (/Users/jorozco/projects/donejs/bitballs/node_modules/smtp-connection/lib/smtp-connection.js:669:16)
    at SMTPConnection._onData (/Users/jorozco/projects/donejs/bitballs/node_modules/smtp-connection/lib/smtp-connection.js:493:10)
    at emitOne (events.js:96:13)
    at Socket.emit (events.js:188:7)
    at readableAddChunk (_stream_readable.js:177:18)
    at Socket.Readable.push (_stream_readable.js:135:10)
    at TCP.onread (net.js:542:20)
  errors: 
   [ { Error: Invalid greeting from server:
     554 5.7.1 Service unavailable; Client host [45.37.20.35] blocked using urbl.hostedemail.com; http://www.spamhaus.org/query/bl?ip=45.37.20.35: 554 5.7.1 Service unavailable; Client host [45.37.20.35] blocked using urbl.hostedemail.com; http://www.spamhaus.org/query/bl?ip=45.37.20.35
         at SMTPConnection._actionGreeting (/Users/jorozco/projects/donejs/bitballs/node_modules/smtp-connection/lib/smtp-connection.js:893:23)
         at SMTPConnection._processResponse (/Users/jorozco/projects/donejs/bitballs/node_modules/smtp-connection/lib/smtp-connection.js:669:16)
         at SMTPConnection._onData (/Users/jorozco/projects/donejs/bitballs/node_modules/smtp-connection/lib/smtp-connection.js:493:10)
         at emitOne (events.js:96:13)
         at Socket.emit (events.js:188:7)
         at readableAddChunk (_stream_readable.js:177:18)
         at Socket.Readable.push (_stream_readable.js:135:10)
         at TCP.onread (net.js:542:20)
       code: 'EPROTOCOL',
       response: '554 5.7.1 Service unavailable; Client host [45.37.20.35] blocked using urbl.hostedemail.com; http://www.spamhaus.org/query/bl?ip=45.37.20.35',
       responseCode: 554,
       command: 'CONN',
       domain: 'juanorozco.com',
       exchange: 'mx.hover.com.cust.hostedemail.com',
       recipients: [Object] } ] }
/Users/jorozco/projects/donejs/bitballs/services/users.js:192
                throw err;
                ^

Error: Sending failed
    at DirectMailer.<anonymous> (/Users/jorozco/projects/donejs/bitballs/node_modules/nodemailer-direct-transport/lib/direct-transport.js:157:41)
    at DirectMailer.<anonymous> (/Users/jorozco/projects/donejs/bitballs/node_modules/nodemailer-direct-transport/lib/direct-transport.js:228:30)
    at DirectMailer.<anonymous> (/Users/jorozco/projects/donejs/bitballs/node_modules/nodemailer-direct-transport/lib/direct-transport.js:326:28)
    at SMTPConnection.g (events.js:286:16)
    at emitOne (events.js:96:13)
    at SMTPConnection.emit (events.js:188:7)
    at SMTPConnection._onError (/Users/jorozco/projects/donejs/bitballs/node_modules/smtp-connection/lib/smtp-connection.js:518:10)
    at SMTPConnection._actionGreeting (/Users/jorozco/projects/donejs/bitballs/node_modules/smtp-connection/lib/smtp-connection.js:893:14)
    at SMTPConnection._processResponse (/Users/jorozco/projects/donejs/bitballs/node_modules/smtp-connection/lib/smtp-connection.js:669:16)
    at SMTPConnection._onData (/Users/jorozco/projects/donejs/bitballs/node_modules/smtp-connection/lib/smtp-connection.js:493:10)
    at emitOne (events.js:96:13)
    at Socket.emit (events.js:188:7)
    at readableAddChunk (_stream_readable.js:177:18)
    at Socket.Readable.push (_stream_readable.js:135:10)
    at TCP.onread (net.js:542:20)
justinbmeyer commented 7 years ago

@James0x57 being the email expert, any ideas?

554 5.7.1 Service unavailable; Client host [45.37.20.35] blocked using urbl.hostedemail.com; http://www.spamhaus.org/query/bl?ip=45.37.20.35 makes me thing @Macrofig 's ISP is blocking him, but I thought all traffic would be local in dev.

JaneOri commented 7 years ago

@Macrofig @justinbmeyer Hey, yep, it doesn't work from local host unless you use the --develop flag. I think it's because most ISPs block traffic on 1025 and 25. You've gotta use the middle man "maildev" which just captures the request and sets up a fancy webmail service locally ( http://localhost:1080/ ): https://github.com/donejs/bitballs/blob/3317082b83c4ae425bb20e8fac8a69568f67f361/services/email.js#L7 ( ..and just test the actual service live >.> )

Maildev should happen automatically when running donejs develop. Make sure your node modules are installed with npm 3+ as well!

bitovi@Jamess-MBP bitballs [master] $ donejs -V 0.9.2 bitovi@Jamess-MBP bitballs [master] $ node -v v6.0.0 bitovi@Jamess-MBP bitballs [master] $ npm -v 3.8.6

I didn't see this issue until just now - please ping me if need anything else!