Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Invalid login: 535 5.7.8 Error: authentication failed: authentication failed #208

Open
Rapter1990 opened this issue Jun 25, 2024 · 1 comment

Comments

@Rapter1990
Copy link

Rapter1990 commented Jun 25, 2024

I try to send test report of my node.js project with github action automatically.

Here is the relevant part of github action

- name: Send test report email
        uses: dawidd6/action-send-mail@v3
        with:
          server_address: smtp.protonmail.ch
          server_port: 587
          username: ${{ secrets.EMAIL_USERNAME }}
          password: ${{ secrets.EMAIL_PASSWORD }}
          subject: Test Report
          body: Test results attached.
          to: <mail_address>
          from: ${{ secrets.EMAIL_USERNAME }}
          attachments: report.png

I always get the error shown below

Invalid login: 535 5.7.8 Error: authentication failed: authentication failed

EMAIL_USERNAME refers to my email of proton.me
EMAIL_PASSWORD refers to my email's password of proton.me

I also tried to use username of proton.me account but nothing changed. I still got the same error.

Where is the problem? How can I fix it?

@Aetherinox
Copy link

Aetherinox commented Sep 28, 2024

I got this same error. However, I did two things at once, and I can't tell which fixed it.

  1. I have my password as a Github secret (obviously), I went back and re-entered it again just in case it was a typo. No quotations in the secret, check for spaces.
  2. My SPF record was invalid. SPF has a limit of 10 domains. I went to a couple of websites to validate my SPF:

The 2nd URL gives more detail.

After I updated my SPF record in Cloudflare and re-tried the action, it worked, and sent the email right through. I've spent a lot of time making sure I have every damn required record, SPF, DMARC, etc.

The invalid authentication error doesn't make a lot of sense to be thrown by SPF, but it's worth a shot.

And also just double-confirm you really did enter the right password.

        - name: Send mail
          uses: dawidd6/action-send-mail@v3
          with:
                server_address: ${{secrets.EMAIL_SMTP}}
                server_port: 465
                secure: true
                username: ${{secrets.EMAIL_FROM}}
                password: ${{secrets.EMAIL_KEY}}
                subject: Test Email
                to: ${{secrets.EMAIL_TO}}
                from: ${{secrets.EMAIL_FROM}}
                body: Build job of ${{github.repository}} completed successfully!
                html_body: |
                  <html>
                    <body>
                        this is a text email
                    </body>
                  </html>
                ignore_cert: false
                convert_markdown: true
                priority: normal

For me, port 25 isn't an option. DMARC blocks the email, and if I set the rules too low, I start failing tests.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants