LPIC-1 108.3: Mail transfer agent basics
Local mail with Postfix: sending and reading, an alias for root, a
.forward file, and the sendmail command.
Before you start
The lab creates users alice and bob (password Lab-Pass-1). alice
stands in for you: log in as her (or sudo -iu alice) to send and read her
mail. No MTA should be installed yet; the lab refuses to start if one is.
Reset removes Postfix and the mail client again.
Tasks
- Install Postfix and choose "Local only" (Debian, Ubuntu), or install it
and start it (RHEL family), so it listens only on this machine. Install
a
mailcommand too. - As
alice, send yourself a message with the subjectHello meusingmail -s, and read it withmail. Find the mailbox file in/var/mail. - Alias
roottoalice, runnewaliases, send mail to root, and check it arrives inalice's mailbox. - Create a
~/.forwardforalicethat sends her mail tobob, and test it. Then change it to keep a copy foralicetoo, and send her another message. - Run
mailqandsendmail -bpand compare. Find the sendmail command's real program withreadlink -f /usr/sbin/sendmail, and write that path to/root/lab-answers/5.
Hints
- The mail client is
s-nailon the RHEL family andmailutilson Debian and Ubuntu.sudo dpkg-reconfigure postfixasks the questions again.postconf inet_interfaces. mail -s "Hello me" alice;mailreads,qquits (read messages may move to~/mbox)./etc/aliases,newaliases;postmap -q root lmdb:/etc/aliases(orhash:) shows what Postfix sees.\alice, bobin/home/alice/.forward, owned byalice, mode 644.