claabs / epicgames-freegames-node

Automatically login and find available free games the Epic Games Store. Sends you a prepopulated checkout link so you can complete the checkout after logging in. Supports multiple accounts, login sessions, and scheduled runs.
https://hub.docker.com/r/charlocharlie/epicgames-freegames
MIT License
1.35k stars 92 forks source link

Email notifier doesn't work with Gmail app password (both SSL on 465 and TLS on 587) #320

Open melo0187 opened 1 year ago

melo0187 commented 1 year ago

Describe the bug I want to set up notifications, but the email notifier doesn't work with my Gmail account. I have 2-Step Verification set up in Gmail, which is why I set up an app password. However, both combinations of secure=true with port 465 and secure=false with port 587 always end with the same error.

Screenshots or Logs

> epicgames-freegames-node@4.1.0 entrypoint-config
> node dist/src/entrypoint-config.jsSetting
timezone: Europe/Berlin
Run on startup: true
[2023-02-02 11:52:05.000 +0100] INFO: Started epicgames-freegames-node    
    COMMIT_SHA: "5fc6de6ce0306d51e1867b10e76e9dbd1343faa0"
    BRANCH: "master"    
    DISTRO: "alpine"
[2023-02-02 11:52:05.523 +0100] INFO: Testing all configured notifiers
[2023-02-02 11:52:07.214 +0100] ERROR: Error sending email. Please check your configuration    
    user: "***@gmail.com"    
    reason: "TEST"    
    emailConfig: {      
        "type": "email",      
        "secure": false,
        "smtpHost": "smtp.gmail.com",
        "smtpPort": 587,
        "emailSenderAddress": "***@gmail.com",
        "emailSenderName": "Epic Games Captchas",
        "emailRecipientAddress": "***@gmail.com"
    }
[2023-02-02 11:52:07.214 +0100] ERROR: Mail command failed: 530-5.7.0 Authentication Required. Learn more at
530 5.7.0  https://support.google.com/mail/?p=WantAuthError f8-20020a05600c44c800b003dc433bb5e1sm4333056wmo.9 - gsmtp
    err: {
        "type": "Error",
        "message": "Mail command failed: 530-5.7.0 Authentication Required. Learn more at\n530 5.7.0  https://support.google.com/mail/?p=WantAuthError f8-20020a05600c44c800b003dc433bb5e1sm4333056wmo.9 - gsmtp",
        "stack":
            Error: Mail command failed: 530-5.7.0 Authentication Required. Learn more at
            530 5.7.0  https://support.google.com/mail/?p=WantAuthError f8-20020a05600c44c800b003dc433bb5e1sm4333056wmo.9 - gsmtp
                at SMTPConnection._formatError (/usr/app/node_modules/nodemailer/lib/smtp-connection/index.js:784:19)
                at SMTPConnection._actionMAIL (/usr/app/node_modules/nodemailer/lib/smtp-connection/index.js:1566:34)
                at SMTPConnection. (/usr/app/node_modules/nodemailer/lib/smtp-connection/index.js:1041:18)
                at SMTPConnection._processResponse (/usr/app/node_modules/nodemailer/lib/smtp-connection/index.js:947:20)
                at SMTPConnection._onData (/usr/app/node_modules/nodemailer/lib/smtp-connection/index.js:749:14)
                at TLSSocket.SMTPConnection._onSocketData (/usr/app/node_modules/nodemailer/lib/smtp-connection/index.js:189:44)
                at TLSSocket.emit (node:events:513:28)
                at addChunk (node:internal/streams/readable:324:12)
                at readableAddChunk (node:internal/streams/readable:297:9)
                at TLSSocket.Readable.push (node:internal/streams/readable:234:10)
        "code": "EENVELOPE", 
        "response": "530-5.7.0 Authentication Required. Learn more at\n530 5.7.0  https://support.google.com/mail/?p=WantAuthError f8-20020a05600c44c800b003dc433bb5e1sm4333056wmo.9 - gsmtp",
        "responseCode": 530,
        "command": "MAIL FROM"
    }
[2023-02-02 11:52:07.218 +0100] WARN: Current version
    COMMIT_SHA: "5fc6de6ce0306d51e1867b10e76e9dbd1343faa0"
    BRANCH: "master"
    DISTRO: "alpine"

Additional context I looked up the error code at Google Support, see here.

530, "5.7.0", Must issue a STARTTLS command first.

Don't think I can do anything about this on my site.

Would be happy to help debug the issue and hope you find the time to look into it.

johnSaunders99 commented 1 year ago

587 is for STARTTLS, try with port 456. and be sure your smtp service is enable in google mail setting

johnSaunders99 commented 1 year ago

BTW, you should set secure to true if you re using the google mail to notify

melo0187 commented 1 year ago

587 is for STARTTLS, try with port 456. and be sure your smtp service is enable in google mail setting

Did you mean port 465? As stated in my original post I already tested port 465 with secure set to true, but without success. Since I stopped using google mail, I simply moved on to Gotify, which works like a charm =)