Limiting Maximum Message Size For Selected Users

There are three places that sendmail checks for a max message size. There is the global sendmail option MaxMessageSize which affects all message. Each mailer can also have an option mailer specific max message size. It is set with the M=some_number_of_bytes field in the mailer definition. This is checked for both the sender and the recipient mailers. The key is that the lowest max size wins. This means that even if the MaxMessageSize option is set to 100 Mb, if the sender or the recipient mailers has a lower max message size this becomes the max message size.

Now to get to your problem. If you wanted to set a max message size for speicific users (addresses) going through an SMTP relay you could make a new smtp (or esmtp) mailer that has a specfic max message size. In m4:

	Msmall-esmtp,	P=[IPC], F=mDFMuXa, S=11/31, R=21/31, E=\r\n, L=990,
>>>>			M=1000000,
			A=IPC $h

you could then create a class of addresses that would be limited to 1 Mb messages. Defining the class from a file would make sense. Again in m4:

	F{SmallUsers} /etc/mail/SmallUsers

This file would contain a list of complete, exact addresses:

Finally you would add a custom rule to ruleset S0 to deliver these addresses to the smallesmtp mailer. In m4

	# put address in a look-up focus without sendmail focus or traling dot
	# we do this so we can match the user@domain address in class
	#	$={SmallUsers}
	R$+ <@ $+ . >				$: <$1@$2> $1 <@ $2 . >
	# test if user address in the lookup focus is in class $={SmallUsers}
	# if so deliver with smallesmtp mailer
	R$lt; $={SmallUsers} > $+ <@ $+ . >	$#smallesmtp $@$3 $:$2 <@ $3 .>
	# otherwise strip the trash lookup focus leaving the original address
	R< $+ > $+ <@ $+ >			$2 <@ $3 >

If you are trying to do this for local users on the local system then you would create a new local mailer with a max message size and then change the rules in ruleset S0 to test for local users. I leave this as an excersize for the reader (Hint: you don't need a lookup focus and the rule would be put between the smarthost/default delivery rules and the local deliver rules in ruleset Parse1, the bottom half of ruleset S0)

Kind of kludgy, but it should work.
Just another "Harker's Helpful Hints"