How to set up mailx and exim4?

689 Views Asked by At

I have an air-gapped collection of local networks that are acting as mini-ISPs (connected to other LANs, but not the internet) for understand networking concepts like EBGP, policies, DNS, etc.

In my ISP, I have one laptop running DNS (bind9), one running a Web Server (apache2), and now I'm trying to set up an Email server (exim4).

I have mailx (to send mail) installed on all laptops already. I've also modified the DNS record (and reverse DNS) for my 'domain' so that I have an MX record that points to the laptop that I want the email server on. I know DNS works because the valid addresses are returned when I dig mail.my.domain.

How do I set it up so that all three of my laptops can send emails to each other and to the outside world via the central mail server? Do I need to have a 'smarthost' set up? What about relaying? Are they relevant to that I'm trying to build?

I'm having trouble understanding the concepts behind exim4 in general. What computer should the mail be stored on? Is it possible that I need to run exim4 in two different configurations (one main server and two 'slave' servers) or would mailx take care of that?

I understand that these are a lot of questions for one stackoverflow post, but I don't know enough about the interaction between all the pieces that are supposed to come together for this. Any nudge in the right direction would be appreciated. Thanks for reading.

1

There are 1 best solutions below

0
On

How do I set it up so that all three of my laptops can send emails to each other and to the outside world via the central mail server?

exim on your Internet-connected mail server will have two routers, one for local destinations and one for the Internet. It will act as a relay for machines on your local network.

Do I need to have a 'smarthost' set up?

You technically don't have to, however unless you have a static IP address, you'll want to use a smarthost because mail servers with an ip address in known dynamically allocated IP address blocks are blacklisted as probable spam by RBLs.

What computer should the mail be stored on?

It would be simplest to store it on the gateway computer, because you generally want to be able to access email from the Internet.

Is it possible that I need to run exim4 in two different configurations (one main server and two 'slave' servers) or would mailx take care of that?

Since system messages are usually delivered to root account on each machine, I think you'll probably need some kind of MTA (exim or postfix) on each machine. You could configure mailx (or another MUA like mutt or pine) to IMAP to the one gateway server. You'd still need to find a way to redirect your system messages though.