The main.cf File
The main.cf file is too large to list all of its options in this chapter, but we will cover the
most important options that will get your mail server up and running. Thankfully, the
configuration file is well documented and explains clearly what each option is used for.
The sample options that we discuss next are enough to help you get a basic Post-
fix mail server up and running at a minimum. The first option we will look at is the
myhostname parameter.
myhostname
This parameter is used to set the name that Postfix will be receiving e-mail for. Typi-
cal examples of mail server hostnames are mail.example.com or smtp.example.org. The
syntax is
myhostname = serverA.example.org
mydomain
This parameter is the mail domain that you will be servicing, such as example.com or
google.com. The syntax is
mydomain = example.org
myorigin
All e-mail sent from this e-mail server will look as though it came from this parameter.
You can set this to either $myhostname or $mydomain, like so:
myorigin = $mydomain
Notice that you can use the value of other parameters in the configuration file by
placing a $ sign in front of the variable name.
mydestination
This parameter lists the domains that the Postfix server will take as its final destination
for incoming e-mail. Typically, this value is set to the hostname of the server and the
domain name, but it can contain other names, as shown here:
mydestination = $myhostname, localhost.$mydomain, $mydomain, \
mail.$mydomain, www.$mydomain, ftp.$mydomain
If your server has more than one name, for example, serverA.example.org and
serverA.another-example.org, you will want to make sure you list both names here.
mail_spool_directory
You can run the Postfix server in two modes of delivery: directly to a user’s mailbox or
to a central spool directory. The typical way is to store the mail in /var/spool/mail. The
variable will look like this in the configuration file:
mail_spool_directory = /var/spool/mail
The result is that mail will be stored for each user under the /var/spool/mail
directory, with each user’s mailbox represented as a file. For example, e-mail sent to
yyang@example.org will be stored in /var/spool/mail/yyang.
mynetworks
Themynetworks variable is an important configuration option. This lets you configure
what servers can relay through your Postfix server. You will usually want to allow relay-
ing from local client machines and nothing else. Otherwise, spammers can use your mail
server to relay messages. An example value of this variable would be
mynetworks = 192.168.1.0/24, 127.0.0.0/8
If you define this parameter, it will override the mynetworks_style parameter.
The mynetworks_style parameter allows you to specify any of the keywords class,
subnet, or host. These settings tell the server to trust these networks that the server
belongs to
smtpd_banner
This variable allows you to return a custom response when a client connects to your mail
server. It is a good idea to change the banner to something that doesn’t give away what
server you are using. This just adds one more slight hurdle for hackers trying to find
faults in your specific software version.
smtpd_banner = $myhostname ESMTP
smtpd_banner
This variable allows you to return a custom response when a client connects to your mail
server. It is a good idea to change the banner to something that doesn’t give away what
server you are using. This just adds one more slight hurdle for hackers trying to find
faults in your specific software version.
smtpd_banner = $myhostname ESMTP
inet_protocol
This parameter is used to invoke the Internet Protocol Version 6 (IPv6) capabilities of the
Postfix mail server. It is used to specify the Internet protocol version that Postfix will use
when making or accepting connections. Its default value is ipv4. Setting this value to
ipv6 will make Postfix support IPv6. Example values that this parameter accepts are
inet_protocols = ipv4 (DEFAULT)
inet_protocols = ipv4, ipv6
inet_protocols = all
inet_protocols = ipv6
There are tons of other parameters in the Postfix configuration file that we did not
discuss here. You might see them commented out in the configuration file when you
set the preceding options. These other options will allow you to set security levels and
debugging levels, among other things, as required.
Now we will move on to running the Postfix mail system and maintaining your mail
server.
Tuesday, September 15, 2009
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment