# Test & activation emails are sent with port 4000 included

**URL:** <https://meta.discourse.org/t/test-activation-emails-are-sent-with-port-4000-included/26768>\
**Category:** Support\
**Created:** [2015年三月25日 14:04 UTC](https://meta.discourse.org/t/test-activation-emails-are-sent-with-port-4000-included/26768 "2015-03-25T14:04:10Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![apotry](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/apotry/32/115822_2.png) [@apotry](https://meta.discourse.org/u/apotry)\
**Post date:** [2015年三月25日 14:04 UTC](https://meta.discourse.org/t/test-activation-emails-are-sent-with-port-4000-included/26768/1 "2015-03-25T14:04:10Z")

</div>

Everthing is working, including e-mail delivery - but: the activation/test links in the emails are of the form:

[http://discuss.mysite.com:4000/](http://discuss.mysite.com:4000/)…

I’ve checked my app.yml and there’s no port 4000 in there. Is the system somehow thinking it’s running in development mode?

---

<div class="post-metadata">

**Author:** ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)\
**Post date:** [2015年三月25日 22:34 UTC](https://meta.discourse.org/t/test-activation-emails-are-sent-with-port-4000-included/26768/2 "2015-03-25T22:34:42Z")

</div>

Do you have any of the WARNING: DEVELOPER ONLY settings set? Is this installed using our Docker guide?

---

<div class="post-metadata">

**Author:** ![apotry](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/apotry/32/115822_2.png) [@apotry](https://meta.discourse.org/u/apotry)\
**Post date:** [2015年三月26日 11:37 UTC](https://meta.discourse.org/t/test-activation-emails-are-sent-with-port-4000-included/26768/3 "2015-03-26T11:37:42Z")

</div>

Installed via Docker, but imported a vBulletin database from inside the development environment (using git clone … → vagrant up → vagrant ssh → ruby script/import\_scripts/vbulletin.rb etc.). Inside vagrant I then took a database dump using:

pg\_dump -xOf ./discourse-backup.sql -n public discourse\_development

Then copied this dump to my production discourse install and did inside psql:

drop schema public cascade;  
create schema public;  
…  
Then on the command line  
sudo -u postgres psql -f /shared/discourse-backup.sql discourse

Noticed that the gravatar paths are all wrong as well. Since the vBulletin import took ~8 hours (200 000 posts), I’m reluctant to start over. Can the email-path be edited inside the database (couldn’t find anything doing a simply ‘grep’ on the dump)?

---

<div class="post-metadata">

**Author:** ![zogstrip](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/zogstrip/32/512781_2.png) [@zogstrip](https://meta.discourse.org/u/zogstrip)\
**Post date:** [2015年三月26日 16:03 UTC](https://meta.discourse.org/t/test-activation-emails-are-sent-with-port-4000-included/26768/4 "2015-03-26T16:03:22Z")

</div>

> [@apotry](#):
>
> pg\_dump -xOf ./discourse-backup.sql -n public discourse\_development

Why didn’t you use the backup/restore feature in Discourse?

> [@apotry](#):
>
> Can the email-path be edited inside the database (couldn’t find anything doing a simply ‘grep’ on the dump)

The `discourse remap` script might help you here.

---

<div class="post-metadata">

**Author:** ![apotry](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/apotry/32/115822_2.png) [@apotry](https://meta.discourse.org/u/apotry)\
**Post date:** [2015年三月26日 16:29 UTC](https://meta.discourse.org/t/test-activation-emails-are-sent-with-port-4000-included/26768/5 "2015-03-26T16:29:56Z")

</div>

Actually also noticed that the load times (in ms) show up on the left side of the screen. Does that mean my discourse is running in development mode and not in production?

How can I change this?

codinghorror: where do I find the “WARNING: DEVELOPER ONLY” settings?

---

<div class="post-metadata">

**Author:** ![zogstrip](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/zogstrip/32/512781_2.png) [@zogstrip](https://meta.discourse.org/u/zogstrip)\
**Post date:** [2015年三月26日 16:37 UTC](https://meta.discourse.org/t/test-activation-emails-are-sent-with-port-4000-included/26768/6 "2015-03-26T16:37:02Z")

</div>

> [@apotry](#):
>
> Actually also noticed that the load times (in ms) show up on the left side of the screen. Does that mean my discourse is running in development mode and not in production?

It’s only displayed for administrators, even in production.

> [@apotry](#):
>
> codinghorror: where do I find the “WARNING: DEVELOPER ONLY” settings?

If you search for `DEVELOPER ONLY` in the site settings and you have results, then you’re definitely running in development mode (we hide them when running in production mode).

---

<div class="post-metadata">

**Author:** ![apotry](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/apotry/32/115822_2.png) [@apotry](https://meta.discourse.org/u/apotry)\
**Post date:** [2015年三月26日 16:58 UTC](https://meta.discourse.org/t/test-activation-emails-are-sent-with-port-4000-included/26768/7 "2015-03-26T16:58:22Z")

</div>

No, nothing comes up when I do that - No results found.

---

<div class="post-metadata">

**Author:** ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)\
**Post date:** [2015年三月26日 18:43 UTC](https://meta.discourse.org/t/test-activation-emails-are-sent-with-port-4000-included/26768/8 "2015-03-26T18:43:15Z")

</div>

But if you imported a database from a development mode import, that setting might be present, I guess.

---

<div class="post-metadata">

**Author:** ![elberet](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/elberet/32/122404_2.png) [@elberet](https://meta.discourse.org/u/elberet)\
**Post date:** [2015年三月26日 19:06 UTC](https://meta.discourse.org/t/test-activation-emails-are-sent-with-port-4000-included/26768/9 "2015-03-26T19:06:53Z")

</div>

The odd thing is that it’s port 4000. That’s used for Unicorn, not the dev-mode webserver (which defaults to 3000, as does `SiteSetting.port`)…

Anyway, try:

```plaintext
/var/discourse/launcher enter app
rails c 
SiteSetting.port = ""
SiteSetting.force_hostname = ""
SiteSetting.queue_jobs = true

```

---

<div class="post-metadata">

**Author:** ![apotry](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/apotry/32/115822_2.png) [@apotry](https://meta.discourse.org/u/apotry)\
**Post date:** [2015年三月27日 12:42 UTC](https://meta.discourse.org/t/test-activation-emails-are-sent-with-port-4000-included/26768/10 "2015-03-27T12:42:34Z")

</div>

SiteSetting.port returned 4000, so setting this to “” fixed the email issue. Thank you!

---

<div class="post-metadata">

**Author:** ![zogstrip](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/zogstrip/32/512781_2.png) [@zogstrip](https://meta.discourse.org/u/zogstrip)\
**Post date:** [2015年三月27日 12:45 UTC](https://meta.discourse.org/t/test-activation-emails-are-sent-with-port-4000-included/26768/11 "2015-03-27T12:45:04Z")

</div>


