Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

change max message size for single domain?

58 views
Skip to first unread message

Jason Kinkade

unread,
Nov 25, 2004, 4:12:55 PM11/25/04
to
I use MaxMessageSize=6000000 in my sendmail.cf, all is good. But this
is server wide. Can I remove this limit or change it for one domain
only, and leave it for the other domains?

Sendmail 8.13.1
Linux 2.4.28

Thanks.

Rob Robin

unread,
Nov 27, 2004, 7:55:31 PM11/27/04
to

1) You can certainly write a custom milter to handle that..

2) In sendmail 8.12 (most likely in 8.13 as well), you can also add some
lines in check_compat (or perhaps some other place) to check for the
message size and a bdb database to store per-domain limit...

let's call the database msgsize:

msgsize's format:
To:domain.com 1000

(where 1000 is the size allowed) then makemap hash /etc/mail/msgsize <
/etc/mail/msgsize. domains not listed have unlimited size allowed.. The
'MAILER-DAEMON' line is to handle the case of sender sending to
him/herself and exceeds the limit. Without it, the sender might not get
bounce-back error messages if the bounce-back error message generated
exceeds the limit (email goes to blackhole)... If the original message
is contained within the bounce-back, any mails coming from and going to
the same address can bypass this resitriction. If you really wanted to
enforce the limit and don't mind losing an email for the case where the
sender and recipient are the same, you can remove the MAILER-DAEMON line..

The additions to the mc file goes sth. along the line of the following
(you may need to alter it):

LOCAL_CONFIG
Kmsgsize hash /etc/mail/msgsize.db

LOCAL_RULESETS
Scheck_compat
RMAILER-DAEMON $| $* $@ OK
R$*$|$* $: $>3 $2
R$*<@$+.>$* $: $(msgsize To:$2 $:UNLIMITED $)
RUNLIMITED $@ OK
R$* $: $(arith l $@ $&{msg_size} $@ $1 $)
RFALSE $#error $@ 5.7.1 $: "MSG TOO BIG"

--------

milter, I guess, offers a cleaner solution by removing offending
recipients from the mail and then generate a clean and short bounce-back
message to the sender.....

There are certainly many other solutions which may be cleaner...

Rob Robin
rro...@greenapple.com
Green Apple, Inc.

0 new messages