How to limit mail attachment size for Sendmail

Published September 8, 2009 by Siva

This little document is going to briefly show how to limit the size of incoming mail attachments. In order to this you are going to have to be familiar with Vi editing (see Basic Vi editing for an introduction).

First off telnet on to your mail server and log on as root or su. Next change to /etc directory. In that directory you should find a file called sendmail.cf (if you can’t find it, try typing whereis sendmail.cf, this should return a list of files with the word sendmail in it and hence you should be able to locate it that way). Prior to editing it, make a backup copy of it. Now you can type vi sendmail.cf.

Now scroll down this file until you find an entry that looks something like this:
# maximum message size
# 0 MaxMessageSize=1000000
In order to limit the size of messages simply uncomment the last line so that it reads:
0 MaxMessageSize=1000000
Furthermore you can specify the maximum message size by editing the value bit. Once done, save the changes and exit.

The final step involves stopping and restarting the server so that the changes can take effect (check your /etc/rc.d/init.d/ directory).

Advertisements

One comment on “How to limit mail attachment size for Sendmail

  • Leave a Reply

    Fill in your details below or click an icon to log in:

    WordPress.com Logo

    You are commenting using your WordPress.com account. Log Out / Change )

    Twitter picture

    You are commenting using your Twitter account. Log Out / Change )

    Facebook photo

    You are commenting using your Facebook account. Log Out / Change )

    Google+ photo

    You are commenting using your Google+ account. Log Out / Change )

    Connecting to %s

    %d bloggers like this: