server_configuration:email

Mail Server

One day, I'll be able to write this up for DigitalOcean, and get some credit for my account: Write For DigitalOcean Share Your Technical Expertise!. But that's gong to take too long!

Why You May Not Want To Run Your Own Mail Server

All I want (right now) is to be able to send emails (from applications), and to send/receive on my own address using mutt. Nothing that clever, postfix should be sufficient!

Having already configured an email server previously (see some extra notes below), I'd already setup DNS records, similar to in this guide:

Start off following instructions from the DigitalOcean Community Documentation How To Install and Configure Postfix on Ubuntu 20.04.

Note, postfix was already installed, so I needed to run:

sudo dpkg-reconfigure postfix

I followed the instructions up to the point of installing s-nail, I prefer mutt.

sudo apt-get install mutt

mutt worked right away, sending an email to my personal email account, and receiving a reply from it.

Sent a test email to: Test sender TLS.

<html lang="en">
  <head>
    <meta http-equiv="content-type" content="text/html; charset=utf-8">
    <title>SUCCESSFUL</title>
  </head>
  <body>
<p>SUCCESSFUL <a href="https://www.checktls.com/TestSender">//email/test <b>From:</b></a></p>
<p>Your email was sent securely using TLS.</p>
  </body>
</html>

Useful Tricks

# Change to home directory
cd ~
 
# Copy mailbox data from backup
sudo cp -r /mnt/volume_lon1_01/disk_backup/home/david/Maildir .
 
# Fix file and directory ownership
sudo chown -R david:david Maildir

In mutt to bounce (forward) an email to another address (say a HTML email forward to a regular mailbox), press b when the email is selected and then put the address into the application and hit enter.

Mail servers must meet a number of requirements to prevent their messages from being blocked, e.g. have a PTR record. The use of authentication methods such as SPF, DKIM or DMARC minimize the chance that messages are marked as spam.

Mixed Links

  • server_configuration/email.txt
  • Last modified: 2023/08/20 14:39
  • by david