How to change the number of unicorns?

I’m self-hosting my Discourse forum on Yunohost, and I ran into an issue with the SMTP email configuration. After scouring the meta.discourse documentation, I couldn’t find any information on Yunohost’s specific operations or save locations. I uninstalled and reinstalled Discourse, copied the log file, and finally located the configuration file that contained the SMTP information.

If you’re also using Yunohost and need to configure your Discourse SMTP settings, you can find the file you’re going to modify at

/var/www/discourse/config/discourse.conf.

Open that file, configure the SMTP settings, save and exit, and then restart Discourse with the command “systemctl restart discourse”.

root@yuno:~# nano /var/www/discourse/config/discourse.conf
root@yuno:~# systemctl restart discourse

And if it helps anyone else, because also, I couldn’t find information -

To configure Discourse with your Office365 you’ve got to do the following:

  1. Go to your Microsoft 365 admin center
  2. Click on Settings then Domains
  3. Click on Add Domain
  4. Follow the instructions on the screen to add your forum’s URL
  5. Once you’ve completed the above steps and the DNS is verified, you’re now able to create an inbox using that subdomain
  6. Click on Users and then Active users
  7. Click on Add a user
  8. Create the mailbox for your forum (example: noreply@forum.yourlinks.com) mailbox domain must match the hostname from where the forum runs
  9. Click on Licenses & Apps
  10. Assign this mailbox an Exchange Online (Plan 1) license (10,000 messages daily 30msg/min throttle) It is required to have a license attached to the mailbox for the purpose of direct-delivery. At the time of writing, the cost is $4.00USD/mo or $5.10/CAD | Should you require a higher limit or a shorter throttle, there are other plans available
  11. Click on Mail and then Manage email apps
  12. Enable “Authenticated SMTP”
  13. Click Save changes
  14. Go to your Azure portal
  15. Browse to your active directory
  16. Select Properties in the left sidebar, right under User settings
  17. Select Manage security defaults
  18. Set Security defaults to “disabled”
  19. Click save
  20. Go back to Users > Active users
  21. Click on Multi-factor authentication
  22. Disable MFA on the mailbox being used

Now as far as Office365/Microsoft365 is concerned, your newly created mailbox is now ready to direct send on behalf of your Discourse instance.

Settings to use the Office365 mailbox:
modify these lines in /var/www/discourse/config/discourse.conf

# hostname running the forum
hostname = "forum.yourlinks.com"

# backup hostname mainly for cdn use
backup_hostname =

# address of smtp server used to send emails
smtp_address = smtp.office365.com

# port of smtp server used to send emails
smtp_port = 587

# domain passed to smtp server
smtp_domain = forum.yourlinks.com

# username for smtp server
smtp_user_name = noreply@forum.yourlinks.com

# password for smtp server
smtp_password = YourLinksPassWordHere

# smtp authentication mechanism
smtp_authentication = login

# enable TLS encryption for smtp connections
smtp_enable_start_tls = true

# mode for verifying smtp server certificates
# to disable, set to 'none'
smtp_openssl_verify_mode =

# force implicit TLS as per RFC 8314 3.3
smtp_force_tls = false

# load MiniProfiler in production, to be used by developers
load_mini_profiler = false

# hostname running the forum
hostname = "forum.yourlinks.com"