Linux Magazine UK 003

Page 92

102answergirl.qxd

23.10.2000

16:04 Uhr

Seite 107

TROUBLESHOOTING

Envelope address. The content of this From line (the one without a colon) is checked by some mail servers to see if it really exists, since spam usually appears to originate from an address which cannot be looked up in the DNS and this is one way of rejecting it. With an unresolvable address we have got ourselves a great deal of trouble. It isn’t just that we can’t deliver

BEGINNERS

mail to many mail servers. Some send the error message intended to inform us that the mail was refused to the address which doesn’t really exist, so that we never receive it. When addressees repeatedly, obstinately insist that they haven’t received mails, while the sender cannot remember any messages being returned as undeliverable, this is often what has happened.

Now just configure — the main parameters from main.cf Fortunately almost all the parameters in Postfix’s main configuration file are set to sensible default values. Also, they are mostly documented very thoroughly. Nevertheless you ought to run through the configuration to at least try to understand it and modify it if necessary before starting the server. As usual, in this file a # serves as a comment symbol, which prevents Postfix from treating the rest of the line as an instruction. A $ with a variable name after it means that Postfix replaces this combined symbol by the value stored in the variable. • If you are using an rpm or deb package made for your distribution, the various directories (queue_directory for the mail queue and command_directory for the Postfix help or daemon_directory for the necessary servers) are set to the right values. If something doesn’t work, check if these directories are present and the last two are filled with the appropriate programs. If, however, you note settings which are clearly wrong at this point, and which are not the result of changes you have made, save yourself what may be a great deal of aggravation by trying a new installation using a new package. • mail_owner, the owner of the mail queue and most Postfix processes should never, ever be attributed to root. Instead, use a special user (such as the very boring postfix). Look in /etc/passwd to check that this user is also there. If not, you must create it and if necessary give it access rights to the Mail spool and the various Postfix programs. • For many processes Postfix needs no specific special rights (as possessed by mail_owner or even root), nor should it have them. Therefore default_privs should be attributed to a user with the lowest possible level of rights such as the user nobody which is preconfigured on most systems. • When myhostname contains the FQDN of the computer you no longer need to worry about mydomain (which by default contains only the domain component of myhostname) and myorigin (normally the same as myhostname). You can find out the standard value using the command hostname –fqdn. If this value doesn’t match your default settings, change the variables. And when you do, don’t forget to remove the comment symbol. • You may have noticed that every mail includes a header named Message-ID:. This marking consists of a unique sequence of symbols generated by your mail server, an @ and the value of myorigin. This ID is supposed to be unique for that message. But since mailservers know nothing about any ID strings that may have been generated by others, myorigin should also be unique to your computer, so that no duplicates occur. For this reason, don’t make myorigin equal to the domain name of your provider or to localhost. • If you only use your mail server for sending mail out and for local mail, but not for receiving mail from the Net, you should restrict inet_interfaces to $myhostname, localhost. • The last stop (mydestination) for incoming mail is your mail server for mails which may be addressed to localhost, $myhostname. • In the file aliases you can define who receives the post which goes to specified local users. It’s important that you attribute mail addressed to root to a user who actually reads mail and is responsible for the system (e.g. yourself). A reasonable default value is:

alias_maps = hash:/etc/postfix/aliases You should then modify /etc/postfix/aliases so that the line with root: on the left side has on the right, next to it, either your local username or one of your valid mail addresses. Example (for modification, not to be mindlessly copied!): root:

pjung<\@>linux-user.de

If you have gone to a lot of trouble with your old /etc/aliases stemming from the days of sendmail you can of course reuse this in alias_maps. But don’t forget to convert the file using the postalias command into the required hash format. Traditionally /var/spool/mail has been the mail_spool_directory under Linux. With home_mailbox, though, you can also keep local mail in a file in each user’s home directory. This is sensible if they are using programs such as Netscape or Kmail. You can also accommodate people who, instead of a folder-file, like to store each mail as an individual file with home_mailbox. Do experiment a bit here by sending mails to a local test user (and please note that Postfix has to be restarted after each alteration to its configuration.)

3 · 2000 LINUX MAGAZINE 107


Issuu converts static files into: digital portfolios, online yearbooks, online catalogs, digital photo albums and more. Sign up and create your flipbook.