Lesson 16: Email

Email: System Components

Note

MUA:
  • lets users read & compose mail
  • Thunderbird, mutt, etc
MTA:
  • routes messages to other machines
  • sendmail, postfix, exim, qmail
MDA:
  • places messages in local store
  • mail.local, procmail
MAA:

access to mail store (i.e IMAP, POP)

Email: System Components

_images/email_routing.jpg

Note

The most confusing part about email is understanding the routing. Knowing the different components is important to fully grasping it.

Transport Agents

Accept mail form user agent

Postfix:More common, easier to configure & use
Sendmail:Highly configurable, steep learning curve
Exim:Similar to Postfix
Qmail:Logging is horrid, but some people like it

Note

Postfix is the easiest to learn and understand, but queue management is a “black box”

Sendmail & qmail is great for high volume sites, but postfix/exim still perform great.

Sendmail has great options for queue management

Features to look out for:
  • SASL (authenticated SMTP)
  • Queue Management

Delivery Agents & Message Stores

Note

Consider scaling issues for the mailstore.

Generally maildir is the best & most compatible option

Anatomy of a Mail Message

Note

Headers:
  • Know how to identify and track queue id's
  • Originator starts at the bottom
  • Headers can be forged
  • X- Headers non-RFC headers
  • Message ID is always unique

MTA Log Files

Note

Being able to read log files is important.

Configuring Postfix

Note

relayhost: [smtp.osuosl.org] vs. osuosl.org
  • [smtp.osuosl.org] goes directly to smtp.osuosl.org
  • 'osuosl.org' does DNS lookup and uses MX

Make sure you run “newaliases” after updating /etc/aliases

Reloading postfix is ideal too

To test email:
echo “this is a test” | mail root@localhost

Sendmail

Note

Config files in /etc/mail usually Primary file to edit should be sendmail.mc

Email: Viruses & Spam

Note

Make sure you have enough CPU & RAM for Spam checking Neglecting abuse emails may get you blacklisted For larger infrastructures, have dedicated machines to process spam Important to keep these updated

Email: Infrastructure Implementation

Note

Consider resources, redundancy, & scalability. MDA is hardest to scale.

  • Look at Cyrus Murder for large scalability
  • dovecot is another option

Email: Security

Note

Always test new configurations to ensure spammers can't relay mail through your server Having dedicate outbound servers will ensure they always catch spam/viruses/etc