mandatoryprogrammer / xsshunter-express

An easy-to-setup version of XSS Hunter. Sets up in five minutes and requires no maintenance!
MIT License
1.64k stars 320 forks source link

Not receiving email notification on gmail #37

Open sagar0121 opened 1 year ago

sagar0121 commented 1 year ago

Hi,

I have edited the settings as below

  - SMTP_EMAIL_NOTIFICATIONS_ENABLED=true
  - SMTP_HOST=smtp.gmail.com
  - SMTP_PORT=465
  - SMTP_USE_TLS=true
  - SMTP_USERNAME=YourEmail@gmail.com
  - SMTP_PASSWORD=YourEmailPassword
  - SMTP_FROM_EMAIL=YourEmail@gmail.com
  - SMTP_RECEIVER_EMAIL=YourEmail@gmail.com

I'm getting an error like below

xsshunterexpress_1 | (node:29) UnhandledPromiseRejectionWarning: Error: Invalid login: 535-5.7.8 Username and Password not accepted. Learn more at xsshunterexpress_1 | 535 5.7.8 https://support.google.com/mail/?p=BadCredentials x14-20020a170902a38e00b001b8b2b95068sm9112067pla.204 - gsmtp xsshunterexpress_1 | at SMTPConnection._formatError (/app/node_modules/nodemailer/lib/smtp-connection/index.js:774:19) xsshunterexpress_1 | at SMTPConnection._actionAUTHComplete (/app/node_modules/nodemailer/lib/smtp-connection/index.js:1513:34) xsshunterexpress_1 | at SMTPConnection. (/app/node_modules/nodemailer/lib/smtp-connection/index.js:540:26) xsshunterexpress_1 | at SMTPConnection._processResponse (/app/node_modules/nodemailer/lib/smtp-connection/index.js:932:20) xsshunterexpress_1 | at SMTPConnection._onData (/app/node_modules/nodemailer/lib/smtp-connection/index.js:739:14) xsshunterexpress_1 | at TLSSocket.SMTPConnection._onSocketData (/app/node_modules/nodemailer/lib/smtp-connection/index.js:189:44) xsshunterexpress_1 | at TLSSocket.emit (events.js:314:20) xsshunterexpress_1 | at addChunk (_stream_readable.js:297:12) xsshunterexpress_1 | at readableAddChunk (_stream_readable.js:272:9) xsshunterexpress_1 | at TLSSocket.Readable.push (_stream_readable.js:213:10) xsshunterexpress_1 | (node:29) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag --unhandled-rejections=strict (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 2)

I have checked in the forums it is mentioned that Gmail SMTP port: 465 (SSL) or 587 (TLS), so I changed to 587, I got the below message.

xsshunterexpress_1 | (node:30) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag --unhandled-rejections=strict (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1) xsshunterexpress_1 | (node:30) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

Smorgashboard commented 1 year ago

Did you ever get this to work? I'm in the same boat and have tried every combination of gmail relay server with tls and no tls i can think of.

sheltyy commented 12 months ago

If you are getting the "Connection Timed Out" error than it is very likely that your VPS provider is blocking out port 465

nikokosm commented 11 months ago

For anyone having this issue, Google has changed some things in the authentication part and you need to use an app password instead of your account's password. After that, the notifications will work fine. More info on how to do it can be found here https://support.google.com/accounts/answer/185833

PS: No need to change your ports in the config file - the default works fine

adamjsturge commented 7 months ago

@sagar0121 @Smorgashboard I added more notification services in my rewrite https://github.com/adamjsturge/xsshunter-go feel free to check it out, email should also work but I find discord, slack, and telegram more convenient.