How to determine SMTP setting from Exim?

I’m about to try the Docker install on a linux box running Exim. I’m reading the guide in pre-flight mode, trying to make sure I understand the process before starting. I come to the SMTP setting part:

SMTP server address? [smtp.example.com]: 
SMTP user name? [postmaster@discourse.example.com]: 
SMTP port [587]:
SMTP password? []:

And I don’t know where to get the exact values to put in these. I scanned the massive Exim config files in /etc, where I found:

in the local file:
daemon_smtp_ports = 25 : 26 : 465 : 587

And nothing else that looks remotely like the options in the sample. I did a few hours of web searching for “smtp setting exim” and so on, but nothing was even close. The above values are utterly meaningless to me, three of the four have values but convey no information about what is expected or why those values were chosen. Given the large number of questions about email settings I find here, I’d expect there to be some docs that go into detail and help those of us who have never configured a mail server or depended on that configuration. Is there a document I’ve overlooked?

Thanks.

If you want the container to use the exim set up on the hosted computer, I’m pretty sure you use:

SMTP server address? $container_host_fqdn
SMTP user name? “”
SMTP port? 587
SMTP password? “”

That is, you only need the host name and port, not the other two values. Port 25 would be my old-fashioned choice for a local connection, but 587 might be prefered by Discourse.

1 Like

Thanks, elijah,

What exactly do you mean by $container_host_fqdn, is that the Docker container’s fqdn, or something else? And where do I get that before or during install?

And, can I really get by with no username/password? I assumed that it needed that for sending email, is that wrong?

I guess what I am trying to understand about the user name is what purpose does this account have? Is it to be used by Discourse to send mail? Is it a contact email?

I don’t feel like I’m certain in my answer, because I don’t understand your set up (and I’m not expert in this). BUT that said, let me explain further.

My environment has a robust local mail system. My environment has countless small VMs that are all pre-configured to have local mail forward appropriately.

When I set up Discourse, I installed (ran discourse-setup) on web-forum-1.$colo_name.$dotcom and configured it to use mailhost.internal.$dotcom for SMTP host and 25 for SMTP port, with no username or password. But it would have worked to use web-forum-1.$colo_name.$dotcom, too, because telnet localhost 25 works on that box, and Postfix there is configured to relay through mailhost.internal.$dotcom. That is a CNAME for one of the Exchange (eww, ick, says my inner Unix guru) servers, which does spam checks and routing to internal or external addresses.

(Separately I have the network configured to map the external hostname of discussion.$dotcom to the internal server web-forum-1.$colo_name.$dotcom because I want the service name to be independent of the backend.)

So going back to your question, since it seems you have a working Exim set up on your linux box, the Docker container should probably be configured to talk to that local Exim instance. The hostname will be the name of the “linux box running Exim” and the port 25, or 587, or one of the other two. And no authentication values.

Thanks so much for taking the time to go into detail. I just followed your advice and found that I could not replace the user name on the prompt, so I ran it to the end and modified the app.yml file to hold an empty string ("") in that field.

Unfortunately, I could not verify that these setting would work for me because, when I tried to build it, the script complained that my Docker 1.7 was not sufficient, that I needed 1.8 or better. When I tried to update I was informed that my kernel was not 3.10 and I could not install the latest Docker. So I am off to figure out how to either get Docker 1.8, or manually install Discourse from packages & sources (shudder!) or get my hosting provider to upgrade my CentOS 6.8 to something newer, which may or may not work.

I really wish the “easy” instructions would include a link to the full requirements so that I could check them all off before even starting. This is like being fed ingredients one at a time and running to the store to buy item, only to have the next ingredient revealed once you try again! :slight_smile:

But that’s not your issue, thanks for this valuable info and I’ll test it in detail once I solve these other problems. Maybe I should jump into trying to do a full install from packages & source, etc.

You might not want to use mail on the server unless your provider has explicitly configured it to do the right thing. It is very easy to get mail wrong, which is why Discourse recommends external mail services.

And with the 3.10.x line of kernels are at least three years old now, that’s not exactly a bleeding edge requirement. Similarly Docker 1.8 is from August 2015. For internet facing servers, you probably should be upgrading distros every two to three years anyway to limit exposure to security significant bugs. (And upgrading components more often.)

I fully agree, I didn’t think this server config was so old. I understand that hosting providers don’t like to upgrade things very often, but even then, it was surprisingly oldish. However, they have done very well hosting mail and web, etc., for me for nearly a decade with excellent support and offered me an 85% discount on this box, which meets my budget of $0. Since I am eating the cost for a community I belong to that wants to get off facebook and have a non-commercial and private area to talk about our specialized subject, it was hard to pass up the price. I don’t like to mess with installing packages and that particular nightmare, nor upgrading kernels, but I will do so if I have to.

I’ll first try to get to some happy medium where everything is not too old. I’ve first asked the provider to upgrade it to something more modern and will go from there.

1 Like