10 - Email Management

Unit 10 - Email Management

Last Update Unknown

SMTP

Email is sent between source and destination using a simple protocol.

SMTP is text-based and deals mostly with simple email without attachments, sending emails using TELNET.


MUA, MTA, and MDA

Email in Linux is controlled via three types of services:

  1. MUA - Mail User Agent
  2. MTA - Mail Transfer Agent
  3. MDA - Mail Delivery Agent

MUA

  • The email “client”.
  • Users use the Mail User Agent to read and send emails.
  • It takes email messages which have been delivered to a particular user’s mailbox and displays them to the user.
  • It takes new messages and passes these to the MTA for delivery.
  • Examples include mutt, mail, and pine.

MTA

MTA

  • The Mail Transfer Agent is the mail equivalent to an IP router.
  • It takes messages given by an MUA or another MTA, and depending on the delivery address passes them onto another MTA or to an MDA for delivery.
  • Examples include sendmail, qmail, and postfix.
  • Each MTA hop inserts its own data at the start of the email data section.

MDA

MDA

  • The MDA or Mail Delivery Agent takes email messages from the MTA and delivers it to a particular user or to a MTA.
  • Once delivered it is held until an MUA for that user reads the email.
  • Examples include mail and procmail for local delivery, and sendmail itself for network delivery.

Aliases

  • Aliases link the recipient envelope address to a local user or action.
  • In sendmail, this is /etc/aliases.
  • The file has 1 alias per line, with the alias name, then a :, then the action or user.

Examples:

Compiling alias changes

  • Sendmail does not use /etc/aliases directly.
  • Instead it uses a binary hashed version of the file.
  • This is aliases.db or aliases.dbm.
  • When you change /etc/aliases you must run newaliases to build the hashed file.

.forward

  • Only root can make changes to /etc/aliases.
  • Individual users can have simple aliases using .forward in there home directory.
  • Every line in this file is treated as an alias for the user. grussell andrew
  • In this case email for this user would go to both grussell and andrew.

Sendmail Configuration

Question 2: Aliases

Add an alias so that all email going to local user jim will instead go to local user frank.

Add an alias so that all email going to local user bob will be silently deleted.

Add an alias so that all email going to local user peter will be sent to both allan and zoe.

Question 3: virtual hosts

Arrange sendmail so that if mail arrives for [email protected], it gets sent to the local user frank.

Keeping the previous rule for frank, make sure that all email for the null.com domain which is not [email protected] gets delivered to local user adam.

Continuing on from the previous rules, now create rules so that when frank SENDS emails, then appear to come from [email protected]. Additionally, make sure that when adam sends emails, they appear to come from [email protected].

Question 4: debug

User iain has complained that he is not receiving any email, and instead he has heard that victor and victoria are receiving his email instead. Fix this issue for iain.

Question 5: spf

What would be the entry needed in the DNS information to provide an spf entry so that only the ip 10.0.0.1 was allowed to send emails for the current SOA?


Make sure the rule only contains the settings as indicated above, and make sure that the rule is set with a hard fail. Use all lower case, and only put a single space character between the elements.