Giter Club home page Giter Club logo

Comments (8)

souramoo avatar souramoo commented on August 12, 2024

Hey! Can confirm that I've definitely got email sending working on my instance with this repo (tested it just now!).

Have you got any other entries in your log that might help diagnose the cause? For example any entries that start with cannot send data export email: (https://github.com/souramoo/commentoplusplus/blob/e8d2af5e6f2e80471d39392b004ebf38c6539b87/api/smtp_domain_export.go)

from commentoplusplus.

Caroga avatar Caroga commented on August 12, 2024

Update from my side: I've found that the following configurations works:

COMMENTO_SMTP_HOST: 'smtp.gmail.com'
COMMENTO_SMTP_PORT: '25' 
COMMENTO_SMTP_FROM_ADDRESS: '[email protected]'
COMMENTO_SMTP_USERNAME: '[email protected]'
COMMENTO_SMTP_PASSWORD: 'password'

This is not using the smtp-relay from Google but rather users a specific account.
I found that the mail is now sent using this account, so it ignores the COMMENTO_SMTP_FROM_ADDRESS.

For the sake of sanity, I installed telnet on my instance and was able to connect successfully with the SMTP server, this would suggest the problem is not on the network level.

from commentoplusplus.

Caroga avatar Caroga commented on August 12, 2024

Yeah I've got some here, get them while they are fresh.
Also, I have a suspicion. Do you work on Windows perhaps?

2021/01/02 22:34:03 [INFO] version.go:13 versionPrint(): starting Commento 
2021/01/02 22:34:03 [INFO] database_connect.go:20 dbConnect(): opening connection to postgres: postgres://commento:redacted@db:5432/commento?sslmode=disable
2021/01/02 22:34:03 [INFO] database_migrate.go:47 migrateFromDir(): 30 migrations already installed, looking for more
2021/01/02 22:34:03 [INFO] database_migrate.go:91 migrateFromDir(): none found
2021/01/02 22:34:03 [INFO] smtp_configure.go:28 smtpConfigure(): configuring smtp: smtp-relay.gmail.com
2021/01/02 22:34:03 [WARNING] smtp_configure.go:30 smtpConfigure(): no SMTP username/password set, Commento will assume they aren't required
2021/01/02 22:34:03 [INFO] smtp_templates.go:43 smtpTemplatesLoad(): loading templates: [confirm-hex reset-hex domain-export domain-export-error]
2021/01/02 22:34:03 [INFO] oauth_google.go:27 googleOauthConfigure(): loading Google OAuth config
2021/01/02 22:34:03 [INFO] oauth_twitter.go:34 twitterOauthConfigure(): loading twitter OAuth config
2021/01/02 22:34:03 [INFO] oauth_github.go:27 githubOauthConfigure(): loading github OAuth config
2021/01/02 22:34:03 [INFO] oauth_gitlab.go:27 gitlabOauthConfigure(): loading gitlab OAuth config
2021/01/02 22:34:03 [INFO] sigint.go:22 sigintCleanupSetup(): setting up SIGINT cleanup
2021/01/02 22:34:03 [INFO] router.go:38 routesServe(): starting server on 0.0.0.0:8080
2021/01/02 22:35:21 [ERROR] smtp_domain_export.go:24 smtpDomainExport(): cannot send data export email: EOF
2021/01/02 22:35:21 [ERROR] domain_export.go:103 domainExportBegin(): error sending data export email for domain: Email dispatch failed. Please contact support to resolve this issue.

I encountered some Windows line endings in some files when I was trying to patch over Commento before, I feel this might be causing some issues on this. I will patch this and report back with my findings.

from commentoplusplus.

souramoo avatar souramoo commented on August 12, 2024

So the EOF error appears to be because smtp-relay.gmail.com is just closing the connection when the configuration is being rejected by the SMTP server - I found this issue that might be related - https://gitlab.com/gitlab-org/gitlab/-/issues/35713

I'm working on VSCode connected to a WSL Ubuntu remote - I just ran find . -not -type d -exec file "{}" ";" | grep CRLF to try and find any windows line endings and they all seem to be in api/vendor and frontend/node_modules where I can't do much about!

from commentoplusplus.

Caroga avatar Caroga commented on August 12, 2024

Great, thanks for checking.
I've installed telnet inside the docker image and was able to connect with the smtp-relay service, as well as sent out a mail.
Used the same protocol and port as configured in the machine, e.g. port 25 unauthenticated using the containers internal hostname.
I can use my personal mail address for now but I wonder how to proceed to fix this issue?

from commentoplusplus.

souramoo avatar souramoo commented on August 12, 2024

Alright, so this must be an issue with the way GoLang's Smtp SendMail is communicating with Gmail.

To debug this please could you post:

  1. The telnet log of what sequence of commands works to send the email through smtp-relay (omitting your password ofc)
  2. The corresponding output of what commento is sending to smtp-relay.gmail.com using something like mitmproxy, burp suite, fiddler, or some other proxy that can log the traffic being sent to the gmail server (omitting your password, etc)

Or look through and spot the difference between the two?

from commentoplusplus.

Caroga avatar Caroga commented on August 12, 2024

I will try this in the next few days πŸ‘πŸ» thanks so far.

from commentoplusplus.

souramoo avatar souramoo commented on August 12, 2024

Please try the latest unstable release after having merged the pull request above to see if this is still an issue!

from commentoplusplus.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.