Technical article 109664

How can I set the maximum message size limit in sendmail?

OpenServer 5.0.4OpenServer 5.0.5UnixWare 7.0.0UnixWare 7.0.1

Written · Last revised

Problem

I need to limit the size of messages sent to and/or through my mail server.

- OR -

I am trying to limit the size of messages sent to and/or through my mail server using the M= equate in the mailer definition, and it does not seem to be working.

Cause

Some mail programs (such as Netscape) do not report the error
generated by sendmail when a message has exceeded the M= equate,
as it is set in the sender's sendmail.cf file, or the sendmail.cf
file on the sender's Smarthost.  The mail does not get delivered,
but the sender does not receive an error message or a bounced
mail message.
NOTE:     This is not true for versions of sendmail earlier than 8.8.5

Solution

Edit the /usr/lib/sendmail.cf (/etc/sendmail.cf for UnixWare 7) as follows:

Search for the string "options".

Add the following entry to the options section:

O MaxMessageSize=nbytes

where nbytes is the maximum file size in bytes. For example, if you wanted to limit message size to 500KB, your entry would look like:

O MaxMessageSize=500000

After making the changes, save and exit the sendmail.cf file, and restart the sendmail daemon by finding the sendmail process ID with:

# ps -ef | grep sendmail
Then restart the process by typing:
# kill -1 <PID>

where <PID> is the process ID of the sendmail process.

NOTES:    This size limit will apply to all Mail Delivery Agents.

See also

Bryan Costales with Eric Allman, "sendmail", O'Reilly & Associates, Inc., page 721.

From the Xinuos technical article database, record 109664. Reproduced with permission. The original is at www.sco.com/ta/109664, which is reachable but blocked from search engines. Xinuos marks this article against a retired product line. That refers to the product’s lifecycle, not to whether the advice still works — plenty of it still applies to running systems.

Next step

Need this fixed rather than explained?

Tell us the release, what the system runs and what it is doing. We will reply by email with what we would do next.

  • You deal with the people who do the work
  • No obligation, and no upgrade required before we will help
  • We tell you plainly if something is not worth doing

Send an enquiry

We reply by email. If a server is down, say so in the first line. You can also write to help@scoexpert.com.