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

Login Email / SMTP Failing #105

Open
emjayess opened this issue Feb 14, 2024 · 2 comments
Open

Login Email / SMTP Failing #105

emjayess opened this issue Feb 14, 2024 · 2 comments

Comments

@emjayess
Copy link

On a new installation via the loomio_deploy repo and readme

  • on AWS Lightsail instance
    • having AWS SES smtp credentials
    • verified identities, verified sending domain, etc

SMTP_* in .env:

  • Note: nice.npbgs.org is the verified FROM DOMAIN (for email headers); is that what SMTP_DOMAIN is intended to store? Or should that be the next value (SES Endpoint) that I currently have configured for SMTP_SERVER? This distinction of these two env vars wasn't precisely clear to me..

  • Is the port significant, or sensitive, within loomio? 2587 is one of several AWS SES smtp config supports or offers.

# smtp settings
SMTP_AUTH=plain
SMTP_DOMAIN=nice.npbgs.org
SMTP_SERVER=email-smtp.us-west-2.amazonaws.com
SMTP_PORT=2587
SMTP_USERNAME=REDACTED
SMTP_PASSWORD=REDACTED
SMTP_USE_SSL=1

Relevant log follow:

nginx-proxy-1       | nginx.1     | loomio.npbgs.org 104.28.242.6 - - [14/Feb/2024:03:26:33 +0000] "GET /api/v1/profile/email_status?email=matt%40sorensonbros.net HTTP/2.0" 200 307 "https://loomio.npbgs.org/dashboard" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/121.0.0.0 Safari/537.36" "172.22.0.8:3000"
loomio-app          | I, [2024-02-14T03:26:47.500110 #13]  INFO -- : source=rack-timeout id=30d09667-56fb-4edd-801f-ee7ee93e0ec4 timeout=15000ms state=ready
loomio-app          | I, [2024-02-14T03:26:52.629456 #13]  INFO -- : [30d09667-56fb-4edd-801f-ee7ee93e0ec4] Delivered mail 65cc32fc6b4e7_d1ac9887010@5ab6e5552965.mail (202.5ms)
loomio-app          | I, [2024-02-14T03:26:52.629914 #13]  INFO -- : [30d09667-56fb-4edd-801f-ee7ee93e0ec4] method=POST path=/api/v1/login_tokens format=json controller=API::V1::LoginTokensController action=create status=500 allocations=522896 duration=5056.78 view=0.00 db=42.88
loomio-app          | F, [2024-02-14T03:26:52.630518 #13] FATAL -- : [30d09667-56fb-4edd-801f-ee7ee93e0ec4]   
loomio-app          | [30d09667-56fb-4edd-801f-ee7ee93e0ec4] OpenSSL::SSL::SSLError (SSL_connect returned=1 errno=0 peeraddr=44.225.148.59:2587 state=error: wrong version number):
loomio-app          | [30d09667-56fb-4edd-801f-ee7ee93e0ec4]   
loomio-app          | [30d09667-56fb-4edd-801f-ee7ee93e0ec4] app/services/login_token_service.rb:7:in `create'
loomio-app          | [30d09667-56fb-4edd-801f-ee7ee93e0ec4] app/controllers/api/v1/login_tokens_controller.rb:4:in `create'
loomio-app          | [30d09667-56fb-4edd-801f-ee7ee93e0ec4] app/helpers/locales_helper.rb:8:in `use_preferred_locale'
loomio-app          | I, [2024-02-14T03:26:52.633308 #13]  INFO -- : source=rack-timeout id=30d09667-56fb-4edd-801f-ee7ee93e0ec4 timeout=15000ms service=5133ms state=completed
nginx-proxy-1       | nginx.1     | loomio.npbgs.org 104.28.242.6 - - [14/Feb/2024:03:26:52 +0000] "POST /api/v1/login_tokens HTTP/2.0" 500 46 "https://loomio.npbgs.org/dashboard" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/121.0.0.0 Safari/537.36" "172.22.0.8:3000"

Observations

  • a "Delivered mail" on line 3
  • a status=500 on line 4
  • a FATAL on line 5
  • and an OpenSSL error after that

I'm not sure how to make heads or tails of this; unsure it's even SMTP issue or something else mis-configured, or openssl mis-compatibility??

@robguthrie
Copy link
Member

Thanks for the detailed issue.
Try SMTP_PORT: 587
and if that does not fix it.. try removing the line for SMTP_USE_SSL (any value present will cause it to be true)

Please let me know how you get on

@emjayess
Copy link
Author

465 actually seems to've resolved it (did not try 587, so inconclusive)..

Per AWS SES SMTP docs:

  • 465 and 2465 are offered for "TLS Wrapper"
  • 25, 587, and 2587 are offered as "STARTTLS"

One might assert that the TLS Wrapper options both may work, while the STARTTLS may not (by testing and confirming results of each of these ports).

I noticed before posting the issue that there are/were a handful of smtp/email-related trouble reports, getting up and running.

Might be worthwhile to detail/document some starter sets for various providers, or something similar (~commonly encountered config issues).

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