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=nbyteswhere 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=500000After 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 sendmailThen 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.