Linux Mail
This page is not complete yet!
Linux Sendmail
Sendmail is the most used mail daemon with Linux and is probably already installed on your system. Its configuration file is "/etc/sendmail.cf". Also /etc/sendmail.hf, /etc/aliases, /etc/aliases.db are useful files with sendmail. Sendmail provides full SMTP support. Many server systems may use sendmail, however clients normally use POP or IMAP protocols and the supporting software to get mail from the mailbox server.
Compiling Sendmail
The sendmail program can be found at http://www.Sendmail.org/ and the current version is 8.10.1.
- Download the sendmail_8_10_1.tar.gz file into the /usr/local directory.
- Unpack it with the command "tar xvzf sendmail_8_10_1.tar.gz".
- Change directories to sendmail-8.10.1
- Read the INSTALL file for further installation instructions which are something like.
- Type "sh Build"
- Type "cd cf/cf".
- cp generic-linux.mc config.mc
- cd ..
- less README
- cd cf
- emacs config.mc
- sh Build config.cf
- Back up your /etc/sendmail.cf file and current sendmail binary file.
- Install config.cf as /etc/mail/sendmail.cf and copy the sendmail binary to /usr/sbin. The compiled binary is in obj.Linux2.2.14.i686/sendmail/.
Sendmail configuration files
- /etc/aliases
- /etc/sendmail.cf or /etc/mail/sendmail.cf
|
|
The aliases file
This is where mail aliases are defined. There are two mandatory aliases that must be present listed below:
MAILER-DAEMON: postmaster
postmaster: root
There are 5 optional types:
- conversion of mail name to unix user name. EX: "george_jones: george"
- expand a name into a list of names EX: "friendlybunch: tom, george, fred, mike". EX: "staff: melissa, tom, george, mark"
- mailing list, Sendmail will read a file and use the names in the file as a list of addressees. EX: "filebunch: :include: /usr/local/manyonteam"
- Alias a name to a file. EX: "nobody" /dev/null"
- replace a name by a program Ex "myhelp: |/usr/local/bin/helpme"
Here is a typical alias file from Redhat 6.1:
# @(#)aliases 8.2 (Berkeley) 3/5/94
#
# Aliases in this file will NOT be expanded in the header from
# Mail, but WILL be visible over networks or from /bin/mail.
#
# ********** The program "newaliases" must be run after
# ** NOTE ** this file is updated for any changes to
# ********** show through to sendmail.
#
# Basic system aliases -- these MUST be present.
MAILER-DAEMON: postmaster
postmaster: root
# General redirections for pseudo accounts.
bin: root
daemon: root
games: root
ingres: root
nobody: root
system: root
toor: root
uucp: root
# Well-known aliases.
manager: root
dumper: root
operator: root
# trap decode to catch security attacks
decode: root
# Person who should get root's mail
root: mark
#User aliases
mark.zehner: mark
george.jones: george
After modifying the alias file you can rebuild it with the command
newaliases
or
sendmail -bi
The /etc/sendmail.cf configuration file
Seven sections of this file:
- Local information - Configuration for the local host.
- Options - Sendmail environment options
- Message Precedence - Specifies
- Trusted Users - Specifies which users are allowed to change the sender addresses when sending mail.
- Header Format - Specifies the headers that are inserted into the mail.
- Rule Rewriting - The commands that re-write e-mail addresses into a form that can be read by the program that delivers the mail.
- Mailer Definitions - Specifies the programs that deliver the mail.
|