"Require Email Verification" doesn't verify


#1

Talk team,
I have Talk running. I want to have email verification up. I added the smtp variable in docker-compose file,
- TALK_SMTP_FROM_ADDRESS=“The Coral Project” xxxxxx@example.org
- TALK_SMTP_HOST=smtp.gmail.com
- TALK_SMTP_PASSWORD=xxxxx
- TALK_SMTP_PORT=465
- TALK_SMTP_USERNAME=xxxxxx@example.org
saved and re-ran docker-compose up -d
Seems NO verification emails are sent when I register a new email, so I can’t get verified. I know there’s a simple step I’m missing. Thanks in advance.
talk-email-verification


#2

Hey @jhardingmmfa

We haven’t tested with gmail stmp - and I know from previous projects, it can be a bit unreliable. I would highly recommend using mailgun or sendgrid and trying with those to see if that’s the issue here.


#3

Thank you, will follow up on your suggestions.


#4

Hey @kgardnr I’m looking at SENDGRID. Any suggestions on with language to use? I want to have TALK verify folks email at the comments logon page. I’m running Talk on a docker, yarn on ubuntu.


#5

Hey @jhardingmmfa! We have SMTP support already built into Talk - so you can choose your mailing service, add the config, and you’re good to go.

https://docs.coralproject.net/talk/advanced-configuration/#talk-smtp-from-address


#6

Ok. will try it shortly. Thanks


#7

Hey, is this the file I need to put sendgrid code into?

node_modules/smtp-connection/lib/smtp-connection.js

the send code looks like this:

// using SendGrid’s v3 Node.js Library
// https://github.com/sendgrid/sendgrid-nodejs
const sgMail = require(’@sendgrid/mail’);
sgMail.setApiKey(process.env.SENDGRID_API_KEY);
const msg = {
to: ‘test@example.com’,
from: ‘test@example.com’,
subject: ‘Sending with SendGrid is Fun’,
text: ‘and easy to do anywhere, even with Node.js’,
html: ‘and easy to do anywhere, even with Node.js’,
};
sgMail.send(msg);


#8

Hey @jhardingmmfa, actually you don’t need to modify any code at all. You’ll need to update your .env file with the environment variables to set up the SMTP connection.

For example:

TALK_SMTP_FROM_ADDRESS=noreply@domain.com
TALK_SMTP_HOST=smtp.sendgrid.com
TALK_SMTP_PASSWORD=password
TALK_SMTP_PORT=2525
TALK_SMTP_USERNAME=username

That’s it! Then email verification and all email sending functionality will work out of the box!


#9

Ok, I kinda did that earlier. Here’s my docker-compose… ( there is no .env file inside talk server container )

  - TALK_SMTP_FROM_ADDRESS="Apps" <apps@example.org>
  - TALK_SMTP_HOST=smtp.gmail.com
  - TALK_SMTP_PASSWORD=XXXXXXXXX
  - TALK_SMTP_PORT=465
  - TALK_SMTP_USERNAME="Apps"

I tried to register with real email account, but I’m not sure an email verification is being sent. Don’t seen any email in my inbox and I can’t get past this screen.
Inside the container, I don’t see Talk listening on 465.


#10

Yeah but that is back to the original issue :slight_smile: I don’t think it works with gmail smtp.

Use sendgrid for that same config above, and use port 2525.

And let me know if it works!


#11

Ok, corrected smtp settings, but getting same results… The “apps” email isn’t “registered” with sendgrid. It’s just a email (gsuite) account it setup for testing.

same-results

Here’s what the sendgrid smtp relay wizard looks like. You make up an name, it gens a key and there are the settings…

I double checked the ports…
services:
talk:
# image: coralproject/talk:4.5
image: coralproject/talk:4.5-onbuild
restart: always
ports:
- “3000:3000”
- “2525:2525”


#12

Ok, can you test the SMTP on the Sendgrid side to make sure it’s not on that end? Because your Talk stuff now looks correct.

https://sendgrid.com/docs/API_Reference/SMTP_API/getting_started_smtp.html


#13

Ok. Will let you know. Thanks for the hand holding…


#14

I don’t mind at all! Email is a PITA :slight_smile:


#15

Update: I successfully tested SMTP with sendgrid per the tutorial you suggested. I changed my port to 587 (like the tutorial) and added the encrypted username and password (tutorial said use base64 encryt). I’m using email aliases to test. No joy. No email is sent to my inbox from Talk.
Here’s my compose file…

root@linux-C3ZWG42:/home/johnathan/talk# cat docker-compose.yml 
# For details on the syntax of docker-compose.yml files, check out:
# https://docs.docker.com/compose/compose-file/compose-file-v2/

version: '2'
services:
  talk:
#    image: coralproject/talk:4.5
    image: coralproject/talk:4.5-onbuild
    restart: always
    ports:
      - "3000:3000"
      - "587:587"
    depends_on:
      - mongo
      - redis
#      - curl
    environment:
      - NODE_ENV=development # remove this line in production
      - TALK_MONGO_URL=mongodb://mongo/talk
      - TALK_REDIS_URL=redis://redis
      - TALK_ROOT_URL=http://127.0.0.1:3000
      - TALK_PORT=3000
      - TALK_JWT_SECRET=password
      - TALK_SMTP_FROM_ADDRESS="xxxxxx" <xxxxxx@xxxorg>
      - TALK_SMTP_HOST=smtp.sendgrid.net
      - TALK_SMTP_PASSWORD='XXXXXXXXXXXXXXXX'
      - TALK_SMTP_PORT=587
      - TALK_SMTP_USERNAME='XXXXXXXXXXXXXXXXX'

Screenshot%20from%202018-11-13%2011-03-44


#16

Can you try again with port 2525; I don’t remember the circumstances but 587 we were never able to get working with Sendgrid. I don’t know if that’s changed, but worth a try.

Also add this to your .env, and you should get error messaging in the logs for the mailer service that will be helpful.

DEBUG=talk:jobs:mailer


#17

Also how close are you to being able to launch? Can you send me an email, we might be able to give you some resources to help get this up and running

kim at mozillafoundation dot org