Mail Agents

MUA Mail User Agent –
Create new emails, and Read email. Ex.: Thunderbird,Evolution,Outlook,etc..

MTA Mail Transfer Agent –
Distribute the emails to other MTAs or Locally. Examples: Postfix

MDA Mail Delivery Agent or LDA Local Delivery Agent
Handles the final delivery, Store the emails in: text files,DB,etc.
Exemples: Procmail, Maildrop (needs account information to deliver)

[SOURCE] MUA -smtp-> MTA -smtp-> MTA –> MDA –> (storage) –> POP/IMAP –imap/pop-> MUA [TARGET]

Relaying

When MTA recieves an email it consider two things:

  • The target email (mail to), if its local it accepts it
  • The host who is making the request, if not local MTA will decide who it is, only selected hosts can use MTA as relay.

When using MUA, it will need to use a relay:

[SOURCE] MUA -smtp-> MTA -smtp-> MTA [TARGET]

________________________________________________________________________________________________________________

It is a MTA, does not manage POP3 or IMAP, would have to configure separate. Has its own logging.

Benefits:

  • Secure and efficiency, the author is Wietse Venema a security expert
  • Its a group of process instead of a one program like sendmail. Each process uses lowest security access
  • Its compatible with sendmail
  • Easy to setup. Very few configuration files, simple alias table

Minimal Configuration(for one domain):

  1. Correct hostname
  2. accept email from the domain.com
  3. add domain.com to the username, like root@domain.com
  4. deliver root email to another user
  5. configure some alias
  6. allow relaying for hosts in our LAN

/etc/postfix/main.cf

myhostname = mail.domain.com

mydomain = domain.com

mydestination = $mydomain

myorigin = $mydomain

mynetworks_style = class | subnet | host

mynetworks = 127.0.0.0/8, 192.168.100.0/24, 10.0.0/30

/etc/postfix/aliases , create links of email address to user accounts, as well as ditribution list

root: admin

foo.bar: fubar

Postfix overview

Postfix is a email router, accept emails and decide what application will delivery to closest neighbor

The routing tables are “mapping”, used to know where to send, also what restrictions to relay clients, targets or check owner of messages.

Postfix Damons:

POSTIFIX DELIVERY (IN) :


POSTFIX OUT:

Configuration of Postfix

/etc/postfix – config files, most importants: main.cf and master.cf

/usr/lib/postfix – Binary of each daemon

/var/spool/postfix – Queue directory

/usr/sbin – Administration commands

/etc/init.d/postfix – Start/Stop/Reload/Restart

Other config. files:

alias_maps = hash:/etc/aliases

Many BD types can be used: hash,btree – ldap – mysql – nis, nisplus – regex

alias (5 types) :

postmaster: root – one to one, email to user map

sales: user1,user2,user3 – distribution list

marketing: :include:/etc/postfix/mailist – large distribution lists, defined inside the file

registry: /var/spool/mail/registry – file where to add email

help: “|/usr/local/bin/help.sh” – email is stdin to the script

Postfix Utilities:

postfix

postalias [type:]file -alias contrsuction

postcat -q qid -qid is the ID in the queue use mailq first

postmap [type:]file -maps contruction

command | postdrop -puts an email in the IN queue, or maildrop

postqueue [-p] [-f] -(-p) queue list, (-f) flush, tries to send all emails in the queue

postsuper [options] [dir] -(-d) delete a queue msg, (-h) puts msg in hold, (-H), unhold msg

________________________________________________________________________________________________________________

Better View of Proccess:

The storage methods:

MAILDIR

MAILBOX

MAILBOX_USER

man postfix

Tags: , , , , , , , ,

2 thoughts on “Postfix Email System

  1. You have a mistake on the first line
    “MTA Mail User Agent –
    Create new emails, and Read email. Exemples: Thunderbird,Evolution,Outlook,etc..”
    Change “MTA” to read “MUA”
    also the spelling of “exemples”
    Cheers
    Andy

Leave a Reply

Your email address will not be published. Required fields are marked *