By Kyle D. Dent
Book Price: $34.95 USD
£24.95 GBP
PDF Price: $27.99
Cover | Table of Contents | Colophon
http://www.postfix.org/). The
site contains the source code, documentation, links to add-on
software, articles, and additional information about Postfix. There
is also information about joining an active mailing list that
discusses all aspects of Postfix.bin
and daemon are common ones. Generally, these
accounts prevent logins by using an invalid password and nonexistent
home directories and login shells. For Postfix administration, you
need at least one pseudo-account for Postfix processes to run under.
You may need additional ones for other functions, such as
mailing-list programs and filters.http://www.ietf.org/.|
Agent
|
Name
|
Purpose
|
|---|---|---|
|
MUA
|
Mail User
Agent
|
master
daemon is started first, and it invokes
most other processes, as needed. Postfix daemons that are invoked by
the master daemon process their assigned tasks and
terminate. They might also terminate after a configured amount of
time or after handling a maximum number of requests. The master
daemon is resident at all times, and gets its
configuration
information at startup from both main.cf and
master.cf. See Chapter 4 for
more information on Postfix configuration files.master
daemon is started first, and it invokes
most other processes, as needed. Postfix daemons that are invoked by
the master daemon process their assigned tasks and
terminate. They might also terminate after a configured amount of
time or after handling a maximum number of requests. The master
daemon is resident at all times, and gets its
configuration
information at startup from both main.cf and
master.cf. See Chapter 4 for
more information on Postfix configuration files.
pickup
daemon reads the message from the queue
and feeds it to the cleanup daemon. Some messages
arrive without all of the required information for a valid email
message. So in addition to sanity checks on the message, the
cleanup daemon, in conjunction with the
trivial-rewrite
daemon inserts missing
message headers,
converts addresses to the user@domain.tld format expected by other
Postfix programs, and possibly translates addresses based on the
canonical or virtual lookup tables (see Chapter 4
for more information on lookup tables).cleanup
daemon, which notifies the queue manager
when it has placed a new message into the incoming mail queue. Once
the queue manager has a new message, it uses
trivial-rewrite
to determine the
routing information: the transport method
to use, the next host for delivery, and the
recipient's address.bounce and defer daemons to
generate delivery status reports for problem messages to be sent back
to the sender, or possibly the system administrator, or both. In
addition to the message queue directories, the Postfix spool
directory contains bounce and
defer directories. These directories contain
status information about why a particular message is
delayed or
undeliverable. The
bounce and defer daemons use
the information stored in these directories to generate their
notifications. See Chapter 5 for more detailed
information on how the queue manager works.local
, virtual alias,
virtual mailbox, and relay.
Destination addresses that do not fall into one of these classes are
delivered over the network by the SMTP client (assuming it was
received by an authorized client). Depending on the address class,
the queue manager calls the appropriate delivery agent to handle the
message.local delivery agent
handles mail for users with a shell account on the system where
Postfix is running. Domain names for local delivery are
listed in the
mydestination
parameter. Messages sent to a user at
any of the mydestination domains are delivered to
the individual shell account for the user. In the simple case, the
local delivery agent deposits an email message into the local message
store. It also checks
aliases and
users'
.forward files to see if local messages should
be delivered elsewhere. See Chapter 7 for more
information on local delivery.virtual_alias_domains parameter.
Every domain has its own set of users that do not have to be unique
across domains. Users and their real addresses are listed in
lookup tables specified in the
pickup
daemon then retrieves the message,
performs its sanity checks, and feeds the message to the
cleanup
daemon, which performs the final
processing on the new message. If Helene's email
client did not include a From: address, or did not
use a fully-qualified hostname in the address,
cleanup makes the necessary fixes to the message.
cleanup places the message into the
incoming queue and notifies the queue manager that
a new message is ready to be delivered. If the queue manager is ready
to process new messages, it moves the message into the active queue.
Because this message is destined for a user on an outside system, the
queue manager has to alert the
smtp
agent to handle
the delivery of the message.smtp agent uses DNS (see Chapter 6) to get a list of email systems that can
accept mail for the domain postfix.org. The smtp
delivery agent selects the most preferred MX host from the list and
contacts it to deliver Helene's message.postfix.org also
running Postfix, although the system could be using any other
standards-compliant MTA. The Postfix myhostname
,
which must
be set to the fully qualified hostname of the system Postfix is
running on. Once Postfix knows the fully qualified hostname, it can
use that hostname to set default values for other important
parameters, such as mydomain. If the parameter
myhostname is not set, Postfix defaults to the
hostname reported by the system itself. There is a complete
discussion of myhostname later in the chapter. You
can see what name your system reports with the
Unix hostname
command:$ hostname
mail.example.com
$ hostname
mail
myhostname parameter. You can
do this quite easily with the
postconf
Postfix command. The
postconf command is a Postfix utility that
provides an easy way to get a variety of information about your
Postfix system. One of its functions is to display or change a
specific configuration parameter. You can use it to set the
myhostname parameter:# postconf -e myhostname=mail.example.com
-e option tells postconf to
edit the configuration with the parameters and values specified. If
your system is configured with its fully qualified hostname, you
don't have to do anything to the Postfix
configuration.root user. They should be readable by everyone.
Whenever you make changes to these files, you have to reload Postfix
for your changes to go into effect:
# postfix reload
sample_directory parameter, which is usually the
same directory as your main.cf file. Both the
main.cf file and the sample files that come with
the Postfix distribution contain comments that explain each of the
parameters.myhostname, mydomain,
myorigin, and mydestination.myhostname
parameter earlier in this chapter. If
myhostname is not specified, Postfix uses the
function
gethostname
to determine what your
system's hostname is. If your system correctly
reports the fully qualified hostname, you can leave
myhostname unspecified in the configuration file.
Some systems may not be configured correctly or may not report the
fully qualified version of the hostname. In these cases, you can set
either myhostname to the fully qualified hostname
or mydomain
to your system's
domain. If mydomain is explicitly set, Postfix
automatically sets myhostname to the domain name
specified and the local hostname reported by
gethostname to create the fully qualified
hostname.myhostname to the
system's fully qualified hostname but omit
mydomain, Postfix uses the value of
myhostname, minus the first component of the fully
qualified hostname, to automatically set mydomain.
A value of mail.example.com for
myhostname causes mydomain to
be example.com unless you
explicitly set it to something else. Similarly, a hostname of
mail.ny.example.com causes the
value to be ny.example.com. If
your system does not report its fully qualified name, and you have
not set either the mydomain or
myhostname parameters, Postfix reports the problem
in your log file. See Section 4.4.1
later in this chapter.# postfix check
syslogd) receives messages from various system
processes and writes them to their final destination (often a file).
syslogd organizes messages according to their
importance and the application or facility that generated the
message. The file /etc/syslog.conf tells
syslogd where to write each type of message. The
logging facility used by Postfix is
mail
. If you don't know where
to find messages logged by Postfix, the file
/etc/syslog.conf should point you in the right
direction. Some operating systems, by convention, log nearly
everything to a single file, such as
# character at
the beginning of a line. Comments and blank lines are ignored. Long
lines can continue onto subsequent lines by starting the carry-over
lines with whitespace.#= = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
# service type private unpriv chroot wakeup maxproc command + args
# name (yes) (yes) (yes) (never) (100)
#= = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
smtp inet n - y - - smtpd
pickup fifo n - n 60 1 pickup
cleanup unix n - n - 0 cleanup
qmgr fifo n - n 300 1 qmgr
rewrite unix - - n - - trivial-rewrite
bounce unix - - n - 0 bounce
defer unix - - n - 0 bounce
flush unix n - n 1000? 0 flush
proxymap unix - - n - - proxymap
smtp unix - - y - - smtp
relay unix - - y - - smtp
-o smtp_helo_timeout=5 -o smtp_connect_timeout=5
showq unix n - n - - showq
error unix - - n - - error
local unix - n n - - local
virtual unix - n n - - virtual
lmtp unix - - n - - lmtp
maildrop unix - n n - - pipe
flags=DRhu user=vmail argv=/usr/local/bin/maildrop -d ${recipient}
cyrus unix - n n - - pipe
user=cyrus argv=/cyrus/bin/deliver -e -r ${sender}
-m ${extension} ${user}
uucp unix - n n - - pipe
flags=Fqhu user=uucp argv=uux -r -n -z -a$sender -
$nexthop!rmail ($recipient)smtpd_recipient_limit parameter. The default
is 1,000 recipients, and it should be adequate for normal operation.message_size_limit
parameter limits the size of any
message your system will accept. The default is 10 MB. If you have
limited disk space or memory, you might want to lower the value. On
the other hand, if your users commonly receive large attachments, you
may have to increase it.smtpd_error_sleep_time
with a default of one second. After
the number of errors exceeds the value set for
smtpd_soft_error_limit
, Postfix increases the delay by one
second for every error, so that with each error, there is a slightly
longer delay. Finally, when the error count hits the value set in
smtpd_hard_error_limit
, Postfix gives up on the client and
disconnects.myorigin
to a local name that has no domain
part. Postfix also appends the value of mydomain
to addresses that include only the host portion without the domain
name. This fixes addresses that look like kdent@host so they become kdent@host.example.com.queue_directory
parameter, which is normally
/var/spool/postfix. When a process runs
chrooted, the directory /var/spool/postfix/pid,
for example, becomes /pid to that process, and
the process cannot access any files other than those below its new
root.y. The chroot option is possible with all
components except the pipe,
virtual, local, and
proxymap services. In Example 4-1, chroot is enabled for the SMTP clients and
server.