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

**URL:** https://meta.discourse.org/t/how-to-set-no-user-pass-for-smtp-in-discourse-setup/58900
**Category:** Support
**Created:** [3월 11, 2017, 9:55오후 UTC](https://meta.discourse.org/t/how-to-set-no-user-pass-for-smtp-in-discourse-setup/58900 "2017-03-11T21:55:27Z")
**Posts on this page:** 11
**Page:** 1

<div class="post-metadata">

### Author: ![watchmanmonitor](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/watchmanmonitor/32/430970_2.png) [@watchmanmonitor](https://meta.discourse.org/u/watchmanmonitor)
#### Post date: [3월 11, 2017, 9:55오후 UTC](https://meta.discourse.org/t/how-to-set-no-user-pass-for-smtp-in-discourse-setup/58900/1 "2017-03-11T21:55:27Z")

</div>

Continuing the discussion from [Setting up DISCOURSE\_SMTP\_ADDRESS: 'localhost'?](https://meta.discourse.org/t/setting-up-discourse-smtp-address-localhost/16027):

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

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

```

What I need is:

```plaintext
  #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?

---

<div class="post-metadata">

### Author: ![pfaffman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pfaffman/32/120154_2.png) [@pfaffman](https://meta.discourse.org/u/pfaffman)
#### Post date: [3월 11, 2017, 9:59오후 UTC](https://meta.discourse.org/t/how-to-set-no-user-pass-for-smtp-in-discourse-setup/58900/2 "2017-03-11T21:59:23Z")

</div>

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

---

<div class="post-metadata">

### Author: ![JagWaugh](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jagwaugh/32/69335_2.png) [@JagWaugh](https://meta.discourse.org/u/JagWaugh)
#### Post date: [3월 11, 2017, 10:06오후 UTC](https://meta.discourse.org/t/how-to-set-no-user-pass-for-smtp-in-discourse-setup/58900/3 "2017-03-11T22:06:15Z")

</div>

Install nano like all the rest of us mortals.

---

<div class="post-metadata">

### Author: ![watchmanmonitor](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/watchmanmonitor/32/430970_2.png) [@watchmanmonitor](https://meta.discourse.org/u/watchmanmonitor)
#### Post date: [3월 11, 2017, 10:12오후 UTC](https://meta.discourse.org/t/how-to-set-no-user-pass-for-smtp-in-discourse-setup/58900/4 "2017-03-11T22:12:58Z")

</div>

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.

---

<div class="post-metadata">

### Author: ![JagWaugh](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jagwaugh/32/69335_2.png) [@JagWaugh](https://meta.discourse.org/u/JagWaugh)
#### Post date: [3월 11, 2017, 10:25오후 UTC](https://meta.discourse.org/t/how-to-set-no-user-pass-for-smtp-in-discourse-setup/58900/5 "2017-03-11T22:25:53Z")

</div>

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

I wouldn’t like to be tasked with looking after intrusion detection [here](http://www.whois.com/whois/none.com)

---

<div class="post-metadata">

### Author: ![watchmanmonitor](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/watchmanmonitor/32/430970_2.png) [@watchmanmonitor](https://meta.discourse.org/u/watchmanmonitor)
#### Post date: [3월 26, 2017, 2:52오후 UTC](https://meta.discourse.org/t/how-to-set-no-user-pass-for-smtp-in-discourse-setup/58900/6 "2017-03-26T14:52:15Z")

</div>

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.

---

<div class="post-metadata">

### Author: ![pfaffman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pfaffman/32/120154_2.png) [@pfaffman](https://meta.discourse.org/u/pfaffman)
#### Post date: [3월 26, 2017, 3:09오후 UTC](https://meta.discourse.org/t/how-to-set-no-user-pass-for-smtp-in-discourse-setup/58900/7 "2017-03-26T15:09:07Z")

</div>

> [@watchmanmonitor](#):
>
> 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.

`./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. 😉

> [@watchmanmonitor](#):
>
> but don’t know how to safely get out of the wizard when it’s time to enter ‘’ for the password.

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.

---

<div class="post-metadata">

### Author: ![watchmanmonitor](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/watchmanmonitor/32/430970_2.png) [@watchmanmonitor](https://meta.discourse.org/u/watchmanmonitor)
#### Post date: [3월 26, 2017, 4:15오후 UTC](https://meta.discourse.org/t/how-to-set-no-user-pass-for-smtp-in-discourse-setup/58900/8 "2017-03-26T16:15:06Z")

</div>

> [@pfaffman](#):
>
> ./discourse-setup is for people with limited (or no) sysadmin skills.

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.

> [@pfaffman](#):
>
> 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.

Sounds good, but that still leaves me entering known-bad data in the face of this DIRE 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?

---

<div class="post-metadata">

### Author: ![pfaffman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pfaffman/32/120154_2.png) [@pfaffman](https://meta.discourse.org/u/pfaffman)
#### Post date: [3월 26, 2017, 5:21오후 UTC](https://meta.discourse.org/t/how-to-set-no-user-pass-for-smtp-in-discourse-setup/58900/9 "2017-03-26T17:21:14Z")

</div>

> [@watchmanmonitor](#):
>
> 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?

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.

---

<div class="post-metadata">

### Author: ![watchmanmonitor](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/watchmanmonitor/32/430970_2.png) [@watchmanmonitor](https://meta.discourse.org/u/watchmanmonitor)
#### Post date: [3월 26, 2017, 6:54오후 UTC](https://meta.discourse.org/t/how-to-set-no-user-pass-for-smtp-in-discourse-setup/58900/10 "2017-03-26T18:54:21Z")

</div>

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](https://meta.discourse.org/t/jquery-error-prevents-email-from-being-sent-on-first-run/59902).

\*(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

---

<div class="post-metadata">

### Author: ![JammyDodger](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jammydodger/32/254611_2.png) [@JammyDodger](https://meta.discourse.org/u/JammyDodger)
#### Post date: [10월 2, 2022, 8:30오전 UTC](https://meta.discourse.org/t/how-to-set-no-user-pass-for-smtp-in-discourse-setup/58900/13 "2022-10-02T08:30:46Z")

</div>


