Private self hosted smtp relay server setup?

private self hosted smtp relay server setup??

looking to cut off third party server for our mail relaying and many reasons

need to setup own simple smtp relay server much needed ,thanks in advance to everyone out there to help :wink:

smtp methods listed none are working could anybody help??

Have you tried the steps in Troubleshooting email on a new Discourse install

1 Like

yes tried but nothing worked using ubuntu 16.04 kvm vps

and everything failed finally trying sendgrid pls check this


  ## TODO: The SMTP mail server used to validate new accounts and send notifica$
  # SMTP ADDRESS, username, and password are required
  # WARNING the char '#' in SMTP password can cause problems!

tried telnet also working connected at 465. dont know whats blocking

Does the emails get to Sendgrid and not being delivered? Or the emails do not get to Sendgrid?

What was the answer to these questions —

What do the Discourse logs say?

What do your email provider logs say?


these are the discourse logs

Sent mail to (30002.4ms)
Job exception: execution expired

Sent mail to (30002.5ms)
Job exception: execution expired

Sent mail to (30004.2ms)
Job exception: execution expired

how to get sendgrid logs??

You’ll need to contact sendgrid, most mass email for-pay providers let you view logs through their web GUIs in some way.

checked the activity finally not even trace of single mail there

Sounds like your server can’t communicate with the external mail server then.

ok i am trying to fix my server for that now and

pls consider this method of just 5 minutes only needed

and how to use this

will this be an solution so we could avoid extra corporate smtp costs and hosting ourself pls take a look and reply based and docker and so simple and could turn any server into smtp server in minutes

Looks like you don’t have connectivity. Try port 2525 and/or ask your hosting service if they are blocking port 465.

Yes now mailed them waiting for reply from tech team and fixed at the mail provider side and the problem is with my server smtp outbound connections and will post about this asap

and asked about whether we can use as a mailserver???

to avoid costs and headaches??

Mailgun is free for the first 10k messages or month. Running a mail server is a sure source of headaches.

It looks like your current problem is on your server side and will exist with every mail server on the internet

1 Like

do i need to install any email applications like postfix on my server as it is an freshly installed raw ubuntu server not even LAMP installed ???

No. You do not need lamp. Do not install it.

Mailgun or AWS SES are best options.

But, still if you want have a look at mailcow / mailinabox

If you are asking that question it is highly improbable that running your own mail server will be fun or fruitful. Neither Mail nor DIscourse needs LAMP.