Table of Content

Weight: 3

Description: Candidates should be aware of the commonly available MTA programs and be able to perform basic forward and alias configuration on a client host. Other configuration files are not covered.

Key Knowledge Areas:

  • Create e-mail aliases
  • Configure e-mail forwarding
  • Knowledge of commonly available MTA programs (postfix, sendmail, qmail, exim) (no configuration)

Terms and Utilities:

~/.forward
sendmail emulation layer commands
newaliases
mail
mailq
postfix
sendmail
exim
qmail

~/.forward
sendmail emulation layer commands
newaliases

protocol

  • Simple Mail Transfer Protocol (SMTP) – send email , also MTA
  • Post Office Protocol (POP) – receive email
  • Internet Message Access Protocol(IMAP) – receive email

/var/spool/mail/ # user email box

email sw

SMTP server
Sendmail
Postfix modular replacement for sendmail, with security but easy config
Exim simple config
qmail modular server with security

ps ax|grep send
ps ax |grep post

other client
Pull Mail Server
Fetchmail pulls mail using POP or IMAP and then injects it into a local SMTP mail queue
Mail reader

MTA

4 agents
MRA mail retrieval agent, fetch email
MDA mail delivery agent, deliver mail
MUA mail user agent on each client
MTA mail transfer agent, transport email from one computer to another

sendmail

mail forwarder
daemon, listen in background to SMTP, full client send and receive local and external email
/etc/init.d/sendmail -bd # inlcude in rc start script , and use inetd to increase security on sendmail

when change sendmail config file sendmail.cf , need to restart sendmail

/etc/init.d/sendmail -bd
/etc/init.d/sendmail stop
/etc/init.d/sendmail start
or
/etc/init.d/sendmail restart
or
/etc/init.d/sendmail reload # without interrupt service

sendmail quiz

which commands cab you use to refresh sendmail config in a single step?
V sendmail reload
X sendmail stop
X sendmail start
V sendmail restart

kill old sendmail by
kill HUP `head -1 /var/run/sendmail.pid`
sendmail -d40 # debug mode, range 0-99, 0 disable debug, default is 1 minimum level ; if not specific, using default 0-99 ??
sendmail -v #

sendmail -d0.11 ghill1@diallonics.com 

alias

/etc/aliases
# basic system alises
MAILER-DAEMON: postmaster
postmaster: root
# general redirections
bin: root
daemon: root
managers: rob, janet

# redirect to a file
root: /etc/local/root
root: :include:/etc/local/root

# redirect to a program
root: |/etc/local/admin

after changes in /etc/aliases , need to rebuild alias db by :
sendmail -bi
or newaliases
```
### alias quiz
A staff member, Ryan Sato, is on vacation, you want to redirect any mail addressed to this guy to kelly Smith, who is his assistant.

Compete entry you add to /etc/aliases from user rasto to ksmith:
rasto: ksmith

## forwarding email

will keep copy of email

~/.forward include users, files or programs

\grosetti
/home/grosetti/mail_pile # attaches a copy of your mail to file mail_pile , as backup
|/usr/sbin/systems

RH
query directory : /var/spool/mqueue

2 primary files in queue
qf header info
df body file

## retrieve email

mailq
or sendmail -bp

Q-ID
Size
Q time
Sender/Recipient

## sendmail process queue

sendmail -bd -q30m

### sendmail process quiz

you want to instruct sendmail to process mail queue after every hour and twenty mins.

sendmail -bd -q1h20m

you are running sendmail as a daemon.
what does sendmail do when it queues a message?
V split message info into separate files
X store body of message in a qf file
V attempt to resend message at a specified interval
X delete message after attempting to resend it

## mail
mail client

mail [-v] [-s subject] [-c cc-addr] [-b bcc-addr] to-addr
mail [-v] [-f [name] | -u user]

$ mail -s "Meeting reminder" -c benf@example.com sallyg@example.com
Remember the meeting at 4:00 today! Ctrl-D
Cc: benf@example.com

mail -s "Automated alert!" 

## mailq
email queue management

## newaliases
compile /etc/aliases into a binary:
# newaliases

## quiz

/etc/init.d/sendmail -bd
sendmail -v rsato@abd.com 
## redirect mail 
root: :include:/etc/local/root # redirect email from root user to users in /etc/local/root file