These classnotes are depreciated. As of 2005, I no longer teach the classes. Notes will remain online for legacy purposes

UNIX02/Postfix Configuration

Classnotes | UNIX02 | RecentChanges | Preferences

No diff available--this is the first major revision. (no other diffs)
Postfix has a number of configuration files under /etc/postfix. Most are very well documented, but we will touch upon a few of them.

main.cf

main.cf is the main Postfix configuration file. It's is in an "option=value" format.

 # LOCAL PATHNAME INFORMATION
 #
 # The queue_directory specifies the location of the Postfix queue.
 # This is also the root directory of Postfix daemons that run chrooted.
 # See the files in examples/chroot-setup for setting up Postfix chroot
 # environments on different UNIX systems.
 #
 queue_directory = /var/spool/postfix

 # QUEUE AND PROCESS OWNERSHIP
 #
 # The mail_owner parameter specifies the owner of the Postfix queue
 # and of most Postfix daemon processes.  Specify the name of a user
 # account THAT DOES NOT SHARE ITS USER OR GROUP ID WITH OTHER
 # ACCOUNTS
 # AND THAT OWNS NO OTHER FILES OR PROCESSES ON THE SYSTEM.  In
 # particular, don't specify nobody or daemon. PLEASE USE A DEDICATED
 # USER.
 #
 mail_owner = postfix

 # INTERNET HOST AND DOMAIN NAMES
 #
 # The myhostname parameter specifies the internet hostname of this
 # mail system. The default is to use the fully-qualified domain name
 # from gethostname(). $myhostname is used as a default value for many
 # other configuration parameters.
 #
 #myhostname = host.domain.name
 #myhostname = virtual.domain.name

 # The mydomain parameter specifies the local internet domain name.
 # The default is to use $myhostname minus the first component.
 # $mydomain is used as a default value for many other configuration
 # parameters.
 #
 #mydomain = domain.name

 # SENDING MAIL
 #
 # The myorigin parameter specifies the domain that locally-posted
 # mail appears to come from. The default is to append $myhostname,
 # which is fine for small sites.  If you run a domain with multiple
 # machines, you should (1) change this to $mydomain and (2) set up
 # a domain-wide alias database that aliases each user to
 # user@that.users.mailhost.
 #
 #myorigin = $myhostname
 #myorigin = $mydomain

 # The relay_domains parameter restricts what clients this mail system
 # will relay mail from, or what destinations this system will relay
 # mail to.  See the smtpd_recipient_restrictions restriction in the
 # file sample-smtpd.cf for detailed information.
 #relay_domains = $mydestination

 # ALIAS DATABASE
 #
 # The alias_maps parameter specifies the list of alias databases used
 # by the local delivery agent. The default list is system dependent.
 # On systems with NIS, the default is to search the local alias
 # database, then the NIS alias database. See aliases(5) for syntax
 # details.
 #
 # If you change the alias database, run "postalias /etc/aliases" (or
 # wherever your system stores the mail alias file), or simply run
 # "newaliases" to build the necessary DBM or DB file.
 #
 # It will take a minute or so before changes become visible.  Use
 # "postfix reload" to eliminate the delay.
 #
 alias_maps = hash:/etc/postfix/aliases

access

The access file grants or deny access to the system based upon various e-mail header and content lookups. The comments at the begining of this file do a pretty good job explaining how to use it, so we wont go much into it here. However, by way of an example, here is a formula for rejecting a certain virus which was recently circling among MS Outlook users:
 #
 # REJECTS
 big@boss.com REJECT

aliases

The aliases file contains mail aliases. Using it you can map non-user email addresses to real user email addresses. The basic format for the file is:
 alias_address:   real_user

So, if we wanted to alias a user 'bob' with the email 'marketting' such that all 'marketting@mydomain.com' was directed to 'bob@mydomain.com' we would use the following entry

 marketting:   bob

master.cf

Postfix master process configuration file. Each line describes how a mailer component program should be run. The fields that make up each line are described below. A "-" field value requests that a default value be used for that field.

Do not modify this unless you know what you are doing and have a real reason to do so. Modifying this file will be covered in UNIX03.



Classnotes | UNIX02 | RecentChanges | Preferences
This page is read-only | View other revisions
Last edited April 26, 2003 12:32 pm (diff)
Search:
(C) Copyright 2003 Samuel Hart
Creative Commons License
This work is licensed under a Creative Commons License.