HPlogo Installing and Administering Internet Services: HP 9000 Networking > Chapter 4 Installing and Administering sendmail

Modifying the Default sendmail Configuration File

» 

Technical documentation

Complete book in PDF

 » Table of Contents

 » Index

The sendmail configuration file that is supplied with HP-UX will work correctly for most sendmail configurations, so you probably do not need to modify it. However, certain modifications to the file are supported. This section describes examples of modifications that you may want to make. The configuration file itself also contains instructions for making the supported modifications.

This section contains the following subsections:

CAUTION: Hewlett-Packard supports the default configuration file and all the modifications described in it. If you make any changes other than the ones described in the default configuration file, Hewlett-Packard cannot support your configuration.

The sendmail Configuration File

The default configuration file is located in /usr/newconfig/etc/mail/sendmail.cf and is installed in /etc/mail/sendmail.cf. We recommend that you leave the copy in /usr/newconfig unmodified, in case you need to reinstall the default configuration.

The sendmail configuration file performs the following functions:

  • Defines certain names and formats, such as the name of the sender for error messages (MAILER-DAEMON), the banner displayed by the SMTP server on startup, and the default header field formats.

  • Sets values of operational parameters, such as timeout values and logging level.

  • Specifies how mail will be routed. In other words, it specifies how recipient addresses are to be interpreted.

  • Defines the delivery agents (mailers) to be used for delivering the mail.

  • Specifies how sendmail should rewrite addresses in the header, if necessary, so that the message address can be understood by the receiving host. The address rewriting process is controlled by sets of address rewriting rules called "rulesets."

Restarting sendmail

  • Issue the following commands, on a standalone system or on the mail server, to restart sendmail:

    /sbin/init.d/sendmail stop
    /sbin/init.d/sendmail start

You must restart sendmail if changes are made to any of the following:

  • The sendmail configuration file, /etc/mail/sendmail.cf.

  • The UUCP configuration, as reflected in the output of the uuname command.

Forwarding Non-Domain Mail to a Gateway

Mail that is being sent to a domain other than the sender's domain can be forwarded to a mail gateway. To have non-domain mail forwarded to a mail gateway, edit the DS line in the /etc/mail/sendmail.cf file to specify the host name of the mail gateway:

DSmailgw.cup.hp.com

Configuration Options

The sendmail configuration options to set mail header lengths and limit message recipients have been added or enhanced.

Setting Mail Header Lengths

You can set a limit for the mail header. The maximum header length by default is 32768. To change the mail header length:

  • Open the sendmail.cf file, then set the value of the option MaxHeadersLength=n, where n is the maximum number of lines allowed in the mail header

If a mail header exceeds the maximum value, an error message will be displayed for the user who sent the message, which reads:
552 Headers too larger #MaxHeadersLength
.

Limiting Message Recipients

By default, the maximum number of recipients is 100. You can limit the number of users allowed to receive a single mail message. This helps discourage the flow of spam on the mail server.

  • In the sendmail.cf file, set the value of MaxRecipientsPerMessage=n, where n is the maximum number of recipients allowed for a single mail message.

After a message has been sent to the maximum number of recipients allowed, sendmail sends the error message "452 Too many recipients" to the sender of the message.

Note that this will work only when all the recipients of the mail message have their mailboxes on the same machine.

© 2000 Hewlett-Packard Development Company, L.P.