There is a very nice tutorial on how to install and setup mail server on Ubuntu 18.04 LTS. It's a bit involved. For our class, I just want to be able to setup an SMTP server (called "bind9") on our standard 32-bit Ubuntu 16.04 system so you can play with it a little bit. (The problem with a real SMTP server these days is that they all want to go "secure" and it's a lot more difficult to talk to such a server.) So, I start with the above tutorial and simplify it so you can try things out without getting the full-blown SMTP to work on your 32-bit Ubuntu 16.04 system. This SMTP server will only respond to messages coming from within the 32-bit Ubuntu 16.04 system (i.e., localhost). Here's a quick summary about what you can do to get setup an SMTP server and send and receive email. If you need more details, please see the original tutorial.

DISCLAIMER: I do not know what every command below is doing or the meaning of lines inside some configuration files. Some commands are specific to the way the bind9 SMTP server is set up.

Add the student account to be able to receive mail.
sudo usermod -aG mail student
Install bind9 (BIND stands for "Berkeley Internet Name Domain").
sudo apt-get -y update
sudo apt-get install -y bind9
Edit /etc/hosts:
sudo pico /etc/hosts
Change the first line from:
127.0.0.1       localhost
to the following 3 lines:
127.0.0.1       localhost localhost.localdomain
127.0.0.1       ns1.localhost.localdomain
127.0.0.1       mail.localhost.localdomain
Then save the file and quit pico.
Change the full name of your machine to be localhost.localdomain:
sudo hostnamectl set-hostname localhost.localdomain
Create and edit /var/cache/bind/db.test:
sudo pico /var/cache/bind/db.test
Enter the following lines:
$ORIGIN localhost.localdomain.
$TTL 1D
@       IN SOA     ns1 root(
                1 ;serial
                1D ;refresh
                2H ;retry
                2W ;expire
                5H ;minimum
);
@       IN        NS ns1
ns1     IN        A 127.0.0.1
mail    IN        A 127.0.0.1
@       IN        MX 5 mail
Then save the file and quit pico.
Run the following command to make sure that the above file is entered correctly:
sudo named-checkzone localhost.localdomain /var/cache/bind/db.test
You should see the following printout:
zone localhost.localdomain/IN: loaded serial 1
OK
Edit /etc/bind/named.conf.default-zones:
sudo pico /etc/bind/named.conf.default-zones
Add the following 4 lines at the end of the file:
zone "localhost.localdomain." {
       type master;
       file "db.test";
};
Then save the file and quit pico.
Edit /etc/bind/named.conf.options:
sudo pico /etc/bind/named.conf.options
Find the following 3 lines:
        // forwarders {
        //         0.0.0.0;
        // };
and change them to:
        forwarders {
                0.0.0.0;
        };
Then save the file and quit pico.
Start bind9:
sudo service bind9 start
Install postfix so that you can send email:
sudo apt install -y postfix
You will be prompted with a couple of questions. Just accept the default values ("Internet Site" and "localhost").
Install mailutils so that you can read email:
sudo apt install -y mailutils
Send email to student@localhost.localdomain:
mail student@localhost.localdomain
This is a commandline program. When you are done with your message, press <Ctrl+D> to terminate and send email.

To check if you have an email, do:
from
If from doesn't print anything, it means that you have no email.

To read your email, do:
mail
This is a commandline program. You can type an message number (e.g., 1) to read the corresponding email number. Type "h" to list email numbers and header information. Type "d #" to delete a particular email number. Type "q" to quit.

Let's try the commands mentioned in section (2.3) of the textbook (on "Electronic Mail in the Internet"). Of course, you must not send such an e-mail to anyone outside of your virtual machine!

Run telnet to connect to the SMTP server on localhost:

telnet localhost.localdomain 25
You should see:
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
220 localhost ESMTP Postfix (Ubuntu)
Tell the SMTP server that you are saying hello from mars.planets:
HELO mars.planets
Tell the SMTP server that you have a mail from bill.gates@microsoft.come:
MAIL FROM: bill.gates@microsoft.com
Tell the SMTP server that you have a mail fo student@localhost.localdomain:
RCPT TO: student@localhost.localdomain
Tell the SMTP server that you are ready to send mail data:
DATA
Type the following:
From: Bill Gates <bill.gates@microsoft.com>
To: Student <student@localhost.localdomain>
Subject: Greetings from Bill Gates

Seriously, this is Bill Gates.

--Bill Gates
.
If you have no more messasges to send, disconnect by typing:
QUIT
and telnet will terminate.
Now go back and check to see if you got an e-mail from Bill Gate.