Email error. Unable to send out email



I followed the instructions here and am able to get the instance running.
Now I am unable to get verification mail.
I am able to log in to the smtp server using ssh. My main site is on cPanel based host also the domain. I am using a subdomain for the instance.
I also tried Admin Login it shows only error message.


I asked digital ocean support they suggested me to install postfix.
Is having a mail server necessary? Can i not use the SMTP settings of my host?

I also tried to access admin/email_logs… it says The page you requested doesn’t exist or is private.

(Felix Freiberger) #3

You should not need to install postfix.

I’d recommend manually activating your admin user to allow you to access the log files.

(Jeff Atwood) #4

We STRONGLY recommend you outsource email, or you will be in a world of suffering. Sign up with MailGun, MailJet, etc.

(DJ) #5

Sorry if this is a dumb question, but can someone explain why is this recommended? The community I’m working with is finishing up getting Discourse ready on DigitalOcean and getting ready to set up postfix. If this is going to be a problem or not reliable I’d rather not go through with it and just have email set up the right way to begin with.

I tried searching but I’m having a hard time finding much information on this topic.

(Jeff Atwood) #6

Sending email is the hardest problem in computer science.

I’m not even joking. :neutral_face:

We’ve seen many, many people get completely tangled up in it and stuck – and Discourse requires functioning email to work at all.

If you’re the world’s greatest sysadmin and setting up postfix and sending email ain’t no thang to you, go for it. Literally everyone else should use one of the recommended mail services in our install doc with free tiers. (And I just added SparkPost to that list, which is another great free option).


Thank you. I was able to activate admin account.
Still admin/email_logs says The page you requested doesn’t exist or is private.

@codinghorror I did. I registered with Mailgun. Still it is showing error.

DO I need postfix?

(Felix Freiberger) #8

Can you check /admin/email/all and /logs for relevant entries?

(Tobias Eigen) #9


Wishing I had read that post in 2010 when you wrote it. I went through all this when I started working at my current job back in February - it was hairy business! I guess it’s the rite of passage for anyone dealing with email.

This bit at the bottom of your post is particularly valuable which I will keep in my back pocket from now on:

Port25 offers a really nifty public service – you can send email to and it will reply to the from: address with an extensive diagnostic! Here’s an example summary result from a test email I just sent to it:

SPF check: pass
DomainKeys check: fail
DKIM check: pass
Sender-ID check: pass
SpamAssassin check: ham

You want to pass SPF, DKIM, and Sender-ID. Don’t worry about the DomainKeys failure, as I believe it is spurious – DKIM is the “newer” version of that same protocol.


550-Verification failed for

I registered at sparkpost
Now Admin is sending mail though i am getting error 550 5.7.1 Unconfigured Sending Domain <>

(Jeff Atwood) #11

The is also excellent and @watchmanmonitor turned me on to that. It is listed in our help email that is sent from Admin, Email, send test email as well.

(Tobias Eigen) #12

Yes - agreed! This is what I actually used back in February. Thanks for the reminder.

Cute UI too.

(Flap Jack) #13

I strongly recommend OpenBSD’s OpenSMTPD over Postfix. It’s a lot simpler, a lot more elegant and a lot more secure.

Having said that – and considering all the other email-from-localhost threads remain unanswered – is it safe to conclude that Discourse will NOT work with local mail servers?

(Jeff Atwood) #14

It will work, but we do not have the staff to teach people how to configure postfix. Sorry.

(Flap Jack) #15

Do local mail servers require any special settings to work with Discourse then? My local mail servers work perfectly with other Rails apps, just not with Discourse.

According to log/production.rb, no verification emails are being sent after the registration. However, after logging in and clicking the resend link I do get this:

Started POST "/users/action/send_activation_email" at 2015-07-03 19:19:43 +0200
Processing by UsersController#send_activation_email as */*
  Parameters: {"username"=>"forumworld2000"}
  Rendered text template (0.1ms)
Completed 200 OK in 229ms (Views: 3.4ms | ActiveRecord: 22.1ms)

But unfortunately still no emails in my inbox.

This is my config/discourse.conf:

# hostname running the forum
hostname = ""

# address of smtp server used to send emails
smtp_address = localhost

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

# domain passed to smtp server
smtp_domain =

# username for smtp server
smtp_user_name =

# password for smtp server
smtp_password =

# smtp authentication mechanism
smtp_authentication = none

# enable TLS encryption for smtp connections
smtp_enable_start_tls = false

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

I’m using the sendmail / Postfix replacement OpenSMTPD and it’s running just fine:

% telnet localhost 25
Connected to localhost.
Escape character is '^]'.
220 forumworld2000 ESMTP OpenSMTPD



ok sparkpost seems to be working
Thanks everyone…

Awesome! :smile:

(Felix Freiberger) #17

Here’s your problem. Discourse runs inside a container, so localhost points to this container, not the host where your mail server runs.

See here, here or here.

(Kane York) #18

The only sticky point is that you need to point Discourse to a publically (at least, to the Docker container) routable IP for your mail server. A address would probably work, haven’t tested it.

(Conor O'rourke) #19

Hey there,

I’ve just installed an instance of Discourse on a Digital Ocean droplet. For email, I signed up for Sparkpost, following all the instructions that I found here.

After that I tried to set up the admin email, but I’m not receiving the verification email. I found this Troubleshooting page, and followed its instructions as best I could, doublechecking everything, but still no dice. The troubleshooting guide describes how to use Mandrill. Are there any specific tips you guys can need? Any diagnostics I can run to show you how I have things arranged? I tried to connect to the smtp server with the command line and that worked fine, so I’m not being blocked.

I don’t need a CDN just to send email, do I?

anyway any help specifically relating to Sparkpost would be great, I am pretty stumped.

edit: huge delays, but now an email seems to be being dispatched, just rejected for some reason with this error
550 5.7.1 Unconfigured Sending Domain

edit2: solved, thanks everyone!

(Conor O'rourke) #20

hey @substance_D , how did you get past the (550 5.7.1) Unconfigured Sending Domain problem?