How to set no user/pass for smtp in discourse setup?

Continuing the discussion from Setting up DISCOURSE_SMTP_ADDRESS: 'localhost'?:

I’m moving a forum, and wanted to try out the ./discourse-setup script.

SMTP is allowed via whitelisting an IP address, so no user/pass is needed.

I can’t guess what to enter to skip these settings.

I tried "" but that left me with

  DISCOURSE_SMTP_USER_NAME: ""
  DISCOURSE_SMTP_PASSWORD: """"
  # DISCOURSE_SMTP_ENABLE_START_TLS: true           # (optional, default true)

What I need is:

  #DISCOURSE_SMTP_USER_NAME: user@example.com      # (optional)
  #DISCOURSE_SMTP_PASSWORD: pa$$word               # (optional)
  DISCOURSE_SMTP_ENABLE_START_TLS: false           # (optional, default true)

Do we want to add support for disabling user/pass in the quick setup?

1 Like

I’m inclined to think that those who can set up a mail server can use vim as God intended.

4 Likes

Install nano like all the rest of us mortals.

5 Likes

Sure, but even an advanced user might want to know how to get off the easy-setup gracefully.

I guess that what I did: just hit enter & continue til I got an error is ok, but I didn’t know what other goodness I might have missed out.

Using the setup tool prevented me from having swap issues on this new 1GB DO instance later on.

Looking at the old & new app.yml from the instance I’m migrating shows me that some of the syntax changed.

Sure, I’m fine with dropping down to nano, but I didn’t know the best place to do that.

1 Like

Since my first migrations away from x400 I have installed a significant number of systems and packages with, none@none.com, username: none, password: none.

I wouldn’t like to be tasked with looking after intrusion detection here

1 Like

I just set up another discourse using discourse-setup and am sure that’s the way to go.

I’m still a bit confused as to how I should handle the case of “port 25, no password needed” in the setup.

I assume that entering in no value would cause an error, as I assume that the SMTP credentials would be tested here. If SMTP isn’t tested, maybe note that so it’s clear that I have to put in an incorrect value, and go back to edit it later?

Not that it makes any sense to have to fake it.

Ultimately the problem that I’m smart enough to know that using the wizard is going to help catch rough edges that I didn’t know might exist (auto-setup of the swap, if needed, etc) . and know enough about SMTP to allow our primary mail server to accept & forward emails from a new forum I’m setting up, but don’t know how to safely get out of the wizard when it’s time to enter '' for the password.

1 Like

./discourse-setup is for people with limited (or no) sysadmin skills. If you’re able to configure a mail server to accept mail from a given IP, then you’re able to use vim and edit the mail config. Surely, you did that to configure the mail server. :wink:

Ah! That I can help with! There’s an undocumented feature. discourse-setup sleeps for 5 seconds after it writes the config file. Just run the wizard and ^C a second or two after you’ve hit enter after the last prompt.

You’ve made the point that I’m not the only person who might make use of that feature. Next time I submit a PR I’ll add a prompt that mentions that delay.

3 Likes

Or, those who don’t know if/how to setup a swap image. That’s me… that’s literally what I want to use the setup wizard for (unless there’s other goodness which Discourse knows, that I don’t, in which case I’d like the benefit of the wizard.

Also, later on when I’m submitting bugs, it’s FAR easier to say “I followed the guide” vs guessing where I might have taken unknown paths.

Sounds good, but that still leaves me entering known-bad data in the face of this DIRE WARNING

:warning: Email is CRITICAL for account creation and notifications in Discourse. If you do not properly configure email before bootstrapping YOU WILL HAVE A BROKEN SITE!

It’d be cleaner to have a way to set no password, if none is required. Maybe that would show as an option if the port was set to 25?

1 Like

Well, @codinghorror can weigh in here (as he’s who’ll accept the PR should I submit it), but that DIRE WARNING applies to the people for whom discourse-setup is designed. Most of those people cannot and should not be configuring a no-password mail server on port 25; that’s a bad idea except in situations few people are likely to encounter. The likelihood that someone who tries to configure mail that way will then come here asking why, oh why, is their mail not getting delivered is fairly high. Again, if you know how to run a mail server, then you can know that the DIRE WARNING does not apply to you.

1 Like

I know enough to run a mail server, but not enough to emulate the logic in

https://github.com/discourse/discourse_docker/blob/master/discourse-setup#L131-L223

From swap setup to bumping up defaults if the host I’m installing on is beefy enough.

I wish I knew enough logic to add this following pseudo-code here:

https://github.com/discourse/discourse_docker/blob/master/discourse-setup#L287-L288

If port = 25 then print “Enter none to disable SMTP Authentication, only choose this if you what you are doing”

This would allow me to have a uniform setup, and know that it wasn’t me when I run in to other issues during setup.

*(Note that the forum I’m trying to set up today is using sparkpost/port 587/smtp_injection/password), the topic at hand is about a different forum which is working now.)

Edited the second code area to reference DISCOURSE_SMTP_PORT, which was my initial intent

1 Like