Next Previous Contents

13. Setting up Email sub system

13.1 Preparing system for Email sub system

Creating extra groups and user

We need to add a few groups and a user which will be used by the email utilities.

Creating directories

There are two directories used by the email sub system, thus we need to create them and give them the proper permissions.

13.2 Installing Procmail

13.3 Installing Sendmail

Installing Sendmail

Configuring Sendmail

Configuring Sendmail isn't as easily said as done. There are a lot of things you need to consider while configuring Sendmail and I can't take everything into account. That's why at this time we'll create a very basic and standard setup. If you want to tweak Sendmail to your own liking, go right ahead, but this is not the right article. You could always use your existing /etc/sendmail.cf (or /etc/mail/sendmail.cf) file if you need to use certain features.

OSTYPE(LFS)
FEATURE(nouucp)
define(`LOCAL_MAILER_PATH', /usr/bin/procmail)
MAILER(local)
MAILER(smtp)

13.4 Installing Mailx

Ignore possible 'comparison between pointer and integer' and 'assignments makes integer from pointer without a cast' warnings. You'll probably get quite a few of these. Though, the program seems to work just fine nevertheless.

13.5 Creating /etc/init.d/sendmail bootscript

#!/bin/sh
# Begin /etc/init.d/sendmail
 
check_status()
{
  if [ $? = 0 ]
  then
    echo "OK"
  else
    echo "FAILED"
  fi
}
 
case "$1" in
  start)
    echo -n "Starting Sendmail..."
    start-stop-daemon -S -q -p /var/run/sendmail.pid \
        -x /usr/sbin/sendmail -- -bd
    check_status
    ;;
 
  stop)
    echo -n "Stopping Sendmail..."
    start-stop-daemon -K -q -p /var/run/sendmail.pid
    check_status
    ;;
 
  reload)
    echo -n "Reloading Sendmail configuration file..."
    start-stop-daemon -K -q -s 1 -p /var/run/sendmail.pid
    check_status
    ;;
 
  restart)
    echo -n "Stopping Sendmail..."
    start-stop-daemon -K -q -p /var/run/sendmail.pid
    check_status
 
    sleep 1
 
    echo -n "Starting Sendmail..."
    start-stop-daemon -S -q -p /var/run/sendmail.pid \
        -x /usr/sbin/sendmail -- -bd
    check_status
    ;;
 
  *)
    echo "Usage: $0 {start|stop|reload|restart}"
    exit 1
    ;;
 
esac
 
# End /etc/init.d/sendmail

13.6 Setting up permissions and symlinks

cd /etc/init.d/rc2.d; ln -s ../init.d/sendmail S20sendmail
cd ../rc0.d; ln -s ../init.d/sendmail K20sendmail
cd ../rc6.d; ln -s ../init.d/sendmail K20sendmail

13.7 Installing Mutt

My favorite email client is Mutt, so that's why we're installing this one. Feel free to skip the installation of Mutt and install your own favorite client. After all, this is going to be your system. Not mine.

If your favorite client is an X Window client (such as Netscape Mail) then you'll have to sit tight a little while till we've installed X.

13.8 Installing Fetchmail

13.9 Testing the Email sub system

It's time to test the email system now.

If this all worked just fine, you have a working email system for local email. It's not necessarily ready for Internet yet. You can remove the testuser by running userdel -r testuser


Next Previous Contents