1 of 23

Email

Peter Lord

Except where otherwise noted, the content on this presentation is licensed under a Creative Commons Attribution-ShareAlike 4.0 International Licence.

2 of 23

About me, Peter Lord

  • Retired software engineer, worked in domains such as finance, telecoms and AI (modelops). Mostly on large servers, with highly-available logic with containers and UNIX.
  • I’m slowly building up a set of computing related talks for local groups in Wokingham - see https://plord.co.uk/talks/
  • More than happy to re-do these to other groups
  • I run the U3ACommunities Computing group - https://u3acommunities.org/interest-groups/computing/
  • If you have feedback, please use https://u3acommunities.org/computing-feedback/
  • Also do a lot of festival volunteering :-)
  • Email: peter@plord.co.uk, also available on Signal and Telegram. Meta X.
  • Fediverse: @plord12@mastodon.social Bluesky: @peter.plord.co.uk

3 of 23

Talks - https://plord.co.uk/talks/

  • Animal and bird spotting with science and technology
  • Automating the home with Home Assistant (introduction)
  • DIY sensor for Home Assistant with esphome
  • How to reduce your electricity bill to zero (with Home Assistant & solar)
  • Discussion on electricity tariffs
  • DHCP, DNS, trackers and ads
  • Email
  • How Generative AI works
  • Local Generative AI
  • Passwords
  • Reading news stories with RSS and ATOM
  • Universal Serial Bus (USB)
  • Will Web3 solve Web2’s problems ?
  • Photos on maps
  • Markup vs WYSIWYG [short]
  • Virtual machines and Containers
  • Immich
  • Backups
  • Fediverse … u3a.social anyone ?
  • Home automation protocols [short]
  • IPv4 & IPv6 addresses
  • Installing GNU/Linux

Please use https://u3acommunities.org/computing-feedback for any talk feedback

4 of 23

Agenda

  • Overview
  • Breakdown of an email message
  • Sending with SMTP
  • Routing across the internet with DNS
  • Receiving with POP3 and IMAP4
  • Spam filtering
  • SPF, DKIM and DMARC
  • Netiquette & good practices
  • Subaddresses and disposable addresses
  • Read receipts
  • Test tools
  • References

5 of 23

Overview

CC0-1.0 Openclipart

CC0-1.0 Openclipart

CC0-1.0 Openclipart

CC0-1.0 Openclipart

Compose Email

Send to harry@their.com

mail.my.com

mail.their.com

Route Email

Fetch Email

Compose Email

6 of 23

Breakdown of an email message

From: george@my.com

To: harry@their.com

Subject: Test

Hi Harry. All okay ?

Headers

Blank line

Message

7 of 23

Breakdown of an email message - headers

8 of 23

Breakdown of an email message - message

  • Can be plain text
  • Can be muli-part Multipurpose Internet Mail Extensions (MIME)

From: george@my.com

To: harry@their.com

Subject: Test

Content-Type: multipart/alternative;

boundary="--==_mimepart_1234"

----==_mimepart_1234

Content-Type: text/plain;

charset=UTF-8

Content-Transfer-Encoding: quoted-printable

Hi Harry. All okay ?

----==_mimepart_1234

Content-Type: text/html;

charset=UTF-8

Content-Transfer-Encoding: quoted-printable

<p>Hi Harry. All okay ?</p>

----==_mimepart_1234--

9 of 23

Overview

CC0-1.0 Openclipart

CC0-1.0 Openclipart

CC0-1.0 Openclipart

CC0-1.0 Openclipart

Compose Email

Send to harry@their.com

mail.my.com

mail.their.com

Route Email

Fetch Email

10 of 23

Sending with Simple Mail Transport Protocol (SMTP)

  • Protocol to send an email message to the server
  • Requires configuration :
    • SMTP server hostname (myemail.com)
    • SMTP port number - 25 for plain, 587 for encrypted
    • Optional username & Password
    • All will be provided by your email provider

$ telnet email.my.com 25

Trying 192.168.175.12...

Connected to arm3.

Escape character is '^]'.

220 myemail.com ESMTP Postfix

HELO my.com

250 myemail.com

MAIL FROM:<george@my.com>

250 2.1.0 Ok

RCPT TO:<harry@their.com>

250 2.1.5 Ok

DATA

354 End data with <CR><LF>.<CR><LF>

To: harry@their.com

From: george@my.com

Subject: Test

hello !

.

250 2.0.0 Ok: queued as C74086C0647

QUIT

221 2.0.0 Bye

11 of 23

Overview

CC0-1.0 Openclipart

CC0-1.0 Openclipart

CC0-1.0 Openclipart

CC0-1.0 Openclipart

Compose Email

Send to harry@their.com

mail.my.com

mail.their.com

Route Email

Fetch Email

12 of 23

Routing with Domain Name Service (DNS)

  • Firstly we need to find email server
    • Use Mail Exchange (MX) record in DNS to map email domain to server name
    • Test with dig / nslookup / https://mxtoolbox.com/
  • Then use SMTP to forward email

$ nslookup

> server 8.8.8.8

Default server: 8.8.8.8

Address: 8.8.8.8#53

> set type=mx

> their.com

Server: 8.8.8.8

Address: 8.8.8.8#53

Non-authoritative answer:

their.com mail exchanger = 10 mail.their.com.

their.com mail exchanger = 10 mail2.their.com.

13 of 23

Overview

CC0-1.0 Openclipart

CC0-1.0 Openclipart

CC0-1.0 Openclipart

CC0-1.0 Openclipart

Compose Email

Send to harry@their.com

mail.my.com

mail.their.com

Route Email

Fetch Email

14 of 23

Receiving email with POP3 / IMAP4

  • Server hostname (mail.their.com)
  • POP port number - 110 for plain, 995 for encrypted
  • IMAP port number - 143 for plain, 993 for encrypted
  • Username & Password

CC0-1.0 Openclipart

CC0-1.0 Openclipart

mail.their.com

Post Office Protocol (POP)

Message

Message

CC0-1.0 Openclipart

Internet Message Access Protocol (IMAP)

Internet Message Access Protocol (IMAP)

Message

Folders

Filters

WebMail

15 of 23

Spam filtering

  • Unwanted or unsolicited mail sent in bulk
  • Can use desktop filter
    • Eg based on bayesian machine learning
    • Requires teaching
  • Can use server filter
    • Requires less teaching
    • Applies to all devices
  • Emails moved to Spam or Junk folder, or deleted
  • Folder usually periodically trimmed
  • Often, spam filtering ignored if sender is in your address book

16 of 23

SPF, DKIM and DMARC

  • Adds “proof” the sender is who they say they are to reduce SPAM
  • SPF - Sender Policy Framework
    • Adds DNS TXT record to identify servers that can send email
    • Ie harry@my.com is sent from server mail.my.com
    • https://mxtoolbox.com/spf.aspx
  • DKIM - DomainKeys Identified Mail
    • Adds DNS TXT record public key
    • Emails are signed (with private key) before sending
    • https://mxtoolbox.com/dkim.aspx
  • DMARC - Domain-based Message Authentication Reporting & Conformance
    • Adds a DNS TXT record with policy & reporting email address
    • https://mxtoolbox.com/dmarc.aspx

17 of 23

DMARC and SPF

CC0-1.0 Openclipart

CC0-1.0 Openclipart

CC0-1.0 Openclipart

CC0-1.0 Openclipart

Compose Email

Send to harry@their.com

mail.my.com

mail.their.com

Route Email

Fetch Email

Add DKIM header

Validate DKIM

Validate SPF

Apply DMARC

Reject, Quarantine, or Pass

18 of 23

Netiquette

  • Use email the way you want others to use it.
  • Be careful when addressing email.
  • Email should have a subject heading which reflects the content of the message.
  • Be conservative in what you send and liberal in what you receive.
  • Consider the recipient’s background.
  • Wait overnight to send emotional responses to messages.
  • Be brief without being overly terse.
  • Use the inverted pyramid form of writing.
  • When in doubt, send plain text messages, not HTML.
  • Forward messages as you received them.
  • Avoid sending chain letters via email.
  • Use mixed case.
  • Use symbols for emphasis.
  • Use smileys to indicate tone of voice, but use them sparingly.
  • If you include a signature, keep it short.
  • Apply common sense “reality checks” before assuming a message is valid.
  • Consider the cost of receiving a message.
  • Know how large a message you are sending.
  • Don’t send large amounts of unsolicited information or attachments to people.
  • Beware the dreaded forwarding loop.
  • Avoid proprietary formats (like Microsoft Office)
  • https://www.ietf.org/rfc/rfc1855.txt worth a read

19 of 23

Posting style

  • Interleaved / top / bottom
  • Remember objective is to send a clear message
  • https://en.wikipedia.org/wiki/Posting_style worth a read

I have been following the discussion about the new product line. Here are my thoughts.

Joe wrote:

> Will our prices be competitive?

That may not be a problem for now, we still have a quality edge.

> We do not have enough trained people on the West Coast. We have many

> new employees but they do not know our products yet.

We can bring them here for a crash training course.

Mary wrote:

> We still do not have a clear marketing plan.

Peter, would you take charge of that? Let me know if you need help.

On the whole, I am quite optimistic. It looks like we will be shipping

the basic system before the end of this quarter.

Nancy

No problem. 6pm it is then.

Jim

-------- Original Message --------

From: Danny <danny@example.com>

Sent: Tuesday, October 16, 2007 10:01 AM

To: Jim <jim@example.com>

Subject: RE: Job

Whoa! Hold on. I have a job scheduled at 5:30 which mails out

a report to key tech staff. Could you please push it back an hour?

Danny

-------- Original Message --------

From: Jim <jim@example.com>

Sent: Tuesday, October 16, 2007 9:40 AM

To: Danny <danny@example.com>

Subject: Job

I'm going to suspend the mail service for approx. thirty

minutes tonight, starting at 5pm, to install some updates

and important fixes.

Jim

At 10.01am Wednesday, Danny wrote:

> At 9.40am Wednesday, Jim wrote:

>> I'm going to suspend the mail service for approx. thirty

>> minutes tonight, starting at 5pm, to install some updates

>> and important fixes.

> Whoa! Hold on. I have a job scheduled at 5:30 which mails out

> a report to key tech staff. Could you push it back an hour?

>

> By the way, which systems will be updated? I had some network

> problems after last week's update. Will I have to reboot?

No problems. 6pm it is then.

Basically, I will update our WWW server and firewall.

No, you won't have to reboot.

On Thursday, Jim wrote:

> The movie clearly adds a sense of menace to the story

> which is not present in the original book.

> [...claim that the darker tone weakens the movie...]

I disagree. The darker tone works well, once one understands

the two are aimed at different audiences.

Because it messes up the order in which people normally read text.

Why is top-posting such a bad thing?

Top-posting.

What is the most annoying thing in e-mail?

20 of 23

Subaddresses and disposable addresses

  • Usually emails are of the form peter@plord.co.uk
    • User “peter” on email domain “plord.co.uk”
  • But subaddresses may also be supported
    • Also known as “plus addresses”
  • Eg peter+u3a@plord.co.uk
    • User “peter”, with tag “u3a” on email domain “plord.co.uk”
  • Usually auto filtered into folder
  • Some servers also support disposable email addresses
    • Eg random sequence of letters
    • Auto forwarded to your regular account
    • Can later be deleted

21 of 23

Proof of delivery

  • No guarantees
  • Bounce message
    • Auto response indicating if message is soft rejected, hard rejected or there was an error
  • Read receipts
    • Add X-Confirm-Reading-To, Disposition-Notification-To or Return-Receipt-To header
    • Receiving email client might email you back
  • Return receipts
    • SMTP option to notify on success or failure
  • Marketing
    • Modify links in html emails, when the user clicks (or opens image)
      • Email client is first sent to marketing server to record link clicked, then
      • Marketing server re-directs to final place
    • Can also add zero-size images
    • Eg used on u3acommunities.org to record how many users opened a link (but no per-user tracking)

22 of 23

Tools

23 of 23

References