Open Caroga opened 3 years ago
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)
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: 'commento@domain.net'
COMMENTO_SMTP_USERNAME: 'user@name.com'
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.
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.
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!
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?
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?
I will try this in the next few days 👍🏻 thanks so far.
Please try the latest unstable release after having merged the pull request above to see if this is still an issue!
Hey, me again. I was wondering if you are able to send out emails, e.g. the data export function. I keep getting the following error in my log:
I've found this in the source and I've traced the configuration for SMTP settings but it should match up. My configuration is based on IP access, therefore I do not require a smtp username/password:
Could you maybe confirm being able to send out emails? Also, preferable, using the docker image from my PR?