Sendmail configuration uses which macro system




















This section reviews the files installed with Sendmail by default and reviews basic configuration changes, including how to stop unwanted email spam and how to extend Sendmail with the Lightweight Directory Access Protocol LDAP.

The Default Sendmail Installation. In order to use Sendmail, first ensure the sendmail package is installed on your system by running, as root :. In order to configure Sendmail, ensure the sendmail-cf package is installed on your system by running, as root :.

For more information on installing packages with Yum, see Section 8. For more information how to switch the default MTA see Section Avoid editing the sendmail. The old makemap commands are still usable. The make command is automatically used whenever you start or restart the sendmail service. The m4 macro processor is not installed by default.

More information on configuring Sendmail can be found in Section To include any changes made to these configurations in their database files, run the following command, as root :. You may also restart the sendmail service for the changes to take effect by running:. For example, to have all emails addressed to the example. To finalize the change, the virtusertable.

Fortunately, sendmail includes some support for mechanisms that can help you deal with unsolicited mail. The Real-time Blackhole List is a public facility provided to help reduce the volume of unsolicited advertising you have to contend with. Known email sources and hosts are listed in a queryable database on the Internet. Major domains sometimes find themselves on the list because of slip-ups in shutting down spam.

While some people complain about particular choices made by the maintainers of the list, it remains very popular and disagreements are usually worked out quickly. Ifyou enable this sendmail feature, it will test the source address of each incoming mail message against the Real-time Blackhole List to determine whether to accept the message.

If you run a large site with many users, this feature could save a considerable volume of disk space. This feature accepts a parameter to specify the name of the server to use. The default is the main server at rbl. To configure the Real-time Blackhole List feature, add the following macro declaration to your sendmail. The access database allows you to configure which hosts or users you will accept mail from and which you will relay mail for. Managing who you will relay mail for is important, as it is another technique commonly employed by spamming hosts to circumvent systems such as the Real-time Blackhole List just described.

Instead of sending the mail to you directly, spammers will relay the mail via some other unsuspecting host who allows it. Versions of sendmail that are 8. The general idea is simple. When a new incoming SMTP connection is received, sendmail retrieves the message header information and then consults the access database to see whether it should proceed to accept the body of the message itself. The access database is a collection of rules that describe what action should be taken for messages received from nominated hosts.

The table has a simple format. Each line of the table contains an access rule. The lefthand side of each rule is a pattern used to match the sender of an incoming mail message. It may be a complete email address, a hostname, or an IP address. The righthand side is the action to take. There are five types of action you may configure.

These are:. Accept messages from this host or user even if they are not destined for our host; that is, accept messages for relaying to other hosts from this host. This example would reject any email received from friends cybermail. The next rule would accept email from postmaster aol.

The last rule allows relaying of mail from any host in the linux. To enable the access database feature, use the following declaration in your sendmail. Internal macros are sometimes defined in the sendmail. Appendix E, "A sendmail Reference" provides a complete list of sendmail's internal macros. Refer to that list when creating a user-defined macro to avoid conflicting with an internal macro.

Macros are expanded when the sendmail. If you customize your sendmail. The macros that usually require modification define site-specific information, such as hostnames and domain names. A macro definition can contain a conditional. Here's a conditional:. It tests whether macro x has a value set. If the macro has been set, the text following the conditional is interpreted. Given this, the assignment of macro X is interpreted as follows: X is assigned the value of g ; and if x is set, X is also assigned a literal blank, a literal left parenthesis, the value of x , and a literal right parenthesis.

So if g contains chunt wrotethebook. The full syntax of the conditional is:. Two commands, C and F , define sendmail classes. A class is similar to an array of values.

Classes are used for anything with multiple values that are handled in the same way, such as multiple names for the local host or a list of uucp hostnames. Classes allow sendmail to compare against a list of values instead of against a single value. Special pattern matching symbols are used with classes. More on pattern matching later. Like macros, classes can have single-character names or long names enclosed in curly braces. User-created classes use long names that do not conflict with sendmail's internal names.

See Appendix E, "A sendmail Reference" for a complete list of the names that sendmail uses for its internal class values. Class values can be defined on a single line, on multiple lines, or loaded from a file. For example, class w is used to define all of the hostnames by which the local host is known. To assign class w the values goober and pea , you can enter the values on a single line:. You can also use the F command to load the class values from a file. The F command reads a file and stores the words found there in a class variable.

Only the name has changed; the file still contains a list of hostnames. You may need to modify a few class definitions when creating your sendmail. Frequently information relating to uucp , to alias hostnames, and to special domains for mail routing is defined in class statements. But in any case, check the class definitions carefully and make sure they apply to your configuration.

Here we grep the Linux sample configuration file for lines beginning with C or F :. This grep shows that generic-linux. Notice that values are stored in w with both a C command and an F command. Unlike a D command, which overwrites the value stored in a macro, the commands that store values in class arrays are additive. The C command and the F command at the start of this listing add values to class w.

Another example of the additive nature of C commands is class P. P holds pseudo-domains used for mail routing. The first C command affecting class P stores a dot in the array.

Class O stores operators that cannot be part of a valid username. The classes. E lists the usernames that should always be associated with the local host's fully qualified domain name, even if simplified email addresses are being used for all other users. More on simplified addresses later.

Notice that even a single character class name, in this case E, can be enclosed in curly braces. Remember that your system will be different. These same class names may be assigned other values on your system, and are only presented here as an example. Carefully read the comments in your sendmail. Many class names are reserved for internal sendmail use. All internal classes defined in sendmail version 8. Only class w, which defines all of the hostnames the system will accept as its own, is commonly modified by system administrators who directly configure the sendmail.

The option O command is used to define the sendmail environment. Use the O command to set values appropriate for your installation. The value assigned to an option is a string, an integer, a Boolean, or a time interval, as appropriate for the individual option. All options define values used directly by sendmail.

There are no user-created options. The default mail domain for this system. By default, the BRM system stores email logins as user domain. Some popper clients only pass in the user part of an email name. For most cases, this entry adds a default domain that the popper appends to the user name. The default is pin. This entry is stored in the system password file. The directory where temporary mail files are stored. The default is maildir. You can add tracing, but the output log can quickly use a large amount of memory.

If your services file doesn't contain a pop3 entry, add the following line to the file:. All connections to port of your system cause inetd to spawn a popper process to handle each connection.

When setup is complete, inetd starts the PIN Popper automatically each time a connection is made to the pop3 port on your system. To verify that the PIN Popper has started, use telnet to connect to the pop3 port on your system and verify that the popper responds. The following line indicates a successful connection:. The directory structure that sendmail uses for example configuration code are designed to use a post-V7 version M4 macro processor.

Table shows the files and subdirectories under the configuration directory of the sendmail configuration file. Configuration files. The files have. The resulting files each have a. Definitions describing a particular operating system type.

These definitions are site dependent see Table Descriptions of mailers.



0コメント

  • 1000 / 1000