Site Feed

Friday, April 27, 2007

RHCE Study Notes - SMTP

Study notes for any exam are difficult enough to find, but RHCE material seems even more scarce. This article tells how to prepare for one of the objectives, which is configuration of an SMTP server.

RHCE Study Notes
I wrote up some study notes as I was preparing for the RCHE exam. Here are some quick notes based on the official RedHat objectives, labs, and possible questions I thought might be reasonable requests.

SMTP Related Questions
install sendmail, sendmail-cf, sendmail-doc (optional)

Q: Configure mail server to accept internet email
A: modify /etc/mail/sendmail.mc
1) cd /etc/mail
2) vi /etc/mail/sendmail.mc
search for 127.0, put dnl at the front of the line
3) make
or m4 sendmail.mc > sendmail.cf
service sendmail restart
Q: Mail alias
A: modify /etc/aliases, run newaliases
Q: Receive mail for DomainX.example.com
A: modify sendmail mc as above, and add domain to /etc/mail/local-host-names
domainx.example.com
Debugging:
mail -v root
mailq, mailq -Ac
sendmail -q
tail -f /var/log/maillog

Configure Sendmail as a Server for Other Clients

A little more detail...

    as root, or sudo
  1. backup your /etc/mail/sendmail.mc and sendmail.cf files
  2. vi /etc/mail/sendmail.mc

  3. Search for a line with 127, and comment the line by placing "dnl #" at the beginning
    Change this line
    DAEMON_OPTIONS(`Port=smtp,Addr=127.0.0.1, Name=MTA')
    to this
    dnl # DAEMON_OPTIONS(`Port=smtp,Addr=127.0.0.1, Name=MTA')dnl
  4. m4 /etc/mail/sendmail.mc > /etc/mail/sendmail.cf

  5. /sbin/service sendmail restart

  6. /sbin/chkconfig sendmail on

Debugging:
mail -v root
mailq, mailq -Ac
sendmail -q
tail -f /var/log/maillog

Links
For more details, see the Red Hat Reference Guide
https://www.redhat.com/docs/manuals/enterprise/RHEL-4-Manual/ref-guide/s1-email-mta.html

And LinuxSelfHelp
http://www.linuxselfhelp.com/quick/sendmail.html

2 comments:

maki said...

hi. im also actually preparing for rhce on rhel5, and im currently collaborating info from the net regarding the exam contents (tips,etc), and other people's study notes, and im going to publish my own tidbits of study notes as well. Ive already taken rhel4 last time unfortunately I flunked it coz i cant make the stupid mouse work, which is part of the RHCT portion, and that blew it. up to this day i still dont know the answer.

Anyway, youre site is a nice find. Hoping to see more rhce notes from you esp. with xen and selinux since those are the major additions to the list.

cheers,
maki

scottm said...

Thanks for your comment.

I do have some SELinux info under the SELinux label, here:

http://systemnotesorg.blogspot.com/search/label/SELinux

You can also look in for http info, since it is a good example of where SELinux is used.
http://systemnotesorg.blogspot.com/search/label/httpd

Another useful tag is RHCE, where I plan to keep RHCE related topics and study notes.
http://systemnotesorg.blogspot.com/search/label/RHCE