Anyone using gmail for SMTP?


#1

Trying to get discourse up and running I used gmail for the SMTP mentoned in app.yml. A feature of gmail is allowing this according to this article. It doesn’t work. My settings are something like this (I changed my email and pw).

on initial signup example ‘user1@example.com,user2@example.com’

DISCOURSE_DEVELOPER_EMAILS: ‘myemail@gmail.com’

TODO: The domain name this Discourse instance will respond to

DISCOURSE_HOSTNAME: ‘localhost’

TODO: The mailserver this Discourse instance will use

DISCOURSE_SMTP_ADDRESS: smtp.gmail.com
DISCOURSE_SMTP_PORT: 587
DISCOURSE_SMTP_USER_NAME: myemail@gmail.com
DISCOURSE_SMTP_PASSWORD: thepassword
DISCOURSE_SMTP_ENABLE_START_TLS: true


Dscourse aws EC2 G Suite troubleshoting
(Kane York) #6

Trying to use gmail to send your email will not go over well.

It’s fine to use for incoming mail, as that’s much lower volume.


#7

It will only be for a couple of messages a day while I tinker. I wouldn’t consider using it for a production site :slight_smile:


(Sam Saffron) #8

Pretty sure the terms and conditions of Google would disallow you from using GMail as an SMTP endpoint. You are probably risking freezing your account or something. Plenty of free options for an smtp service … https://sendgrid.com and for local dev you would just use mailcatcher.


How to configure Gmail in discourse SMTP?
Webhook to forward posts to a mailinglist: best practice?
(Clay Heaton) #13

@sam If I’m reading the G Suite documents correctly, organizations with a business account can use gmail for SMTP. Is that how it reads to you?


(Anthony) #14

Still seems pointless to use gmail for SMTP mailing, when there’s plenty of alternatives around.


(Clay Heaton) #15

Why? It’s reliable and for an internal deployment for use by a small group of people, there’s no real reason to push mail outside of the existing systems – that just introduces another point or two of vulnerability. It can also save some money.


(Sam Saffron) #16

It reads as though you could try it out… I would go for a dedicated smtp service which would give you better visibility and diagnostics


(Jeff Atwood) #17

@clay knows what he is doing. Try it out and let us know.


(Charles Walter) #18

@clay, we have used a google for work email account setup for discourse with minimal issues. our reply via email works smoothly. I see they just renamed g suite


(Clay Heaton) #19

I will - might be a few weeks, though.

Very glad to hear that. It would simplify the case I’m making to migrate to Discourse both at a school where I’m on the board and at my new job.


(Clay Heaton) #20

@codinghorror This seems to be working fine for me. While it’s not practical as a general recommendation, for people using paid G Suite accounts, it’s acceptable. You may want to consider providing the ability to disable this warning.


(Jeff Atwood) #21

We’ll just remove that check for now.


(Kane York) #22

Wouldn’t there be some telltale sign that it’s a google apps domain? e.g. @<not gmail.com> in the username?


(Clay Heaton) #23

Not entirely sure what you’re asking – you mean in the context of that error? Yes, the G Suite (neé Google Apps) domain is custom, not @gmail.com.


(Kane York) #24

I was saying that the “don’t use Gmail for outgoing” could be silenced for usernames with a non-gmail domain, so the original warning stays.


(Nathaniel Ford) #27

Did anyone end up getting this working? I am attempting to set up a discourse server with a gmail-backed domain (on Digital Ocean, following their instructions). The DNS for the domain works (goes to the DO box correctly) and the mail works (I can send and receive), but I am getting a mysterious error in the mail log:

Sent mail to (me)@(mydomain).(com) (10143.9ms)
Job exception: end of file reached

(Where me/mydomain is the actual email address and domain.) What little I can find on the above error is not much help. Can anyone indicate where I might be going wrong, or where to look for answers?


(Peter O'Brien) #28

I’ve also been trying to get setup with paid business gmail from a custom domain and using smtp-relay.gmail.com.

Haven’t got it working yet (but I’m a fumbling newbie with this stuff - so don’t write it off on my efforts thus far!)

Is anyone using smtp-relay.gmail.com without a hitch? Are there any particular settings that make or break the deal? i.e. How to setup email for Discourse Forum with Google Apps SMTP-relay right way? • Crunchify suggests not to SMTP authenticate

Or is it advised that paid gmail is not a good enough dedicated email service to feature on the recommend list

Thanks!


(Dean Taylor) #29

You might find this post useful for specific GMail related settings:

And always refer to the steps here when tracking down issues:


(Peter O'Brien) #30

Thanks Dean! (Hope life is good with you!)

I threw in the towel with gmail and took mailgun up on their free tier in the end - which worked pretty seamlessly.

I did try what was suggested in your linked thread (not to smtp auth) but didn’t get it working - I might have misconfigured something else though…