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

limiting each users mail sending size

22 views
Skip to first unread message

DukeNM

unread,
Jul 7, 2004, 2:42:03 PM7/7/04
to
How can i limit each users mail sending size ??

is this possible ?

i know there is a maxMAILSIZE but that applies globbaly to all users.

but what about for each individual user.

say i want user X to be able to send 5 MB max
while user Y be able to send 1MB max

i am running sendmail and fetchmail.

Matej Vela

unread,
Jul 7, 2004, 4:47:51 PM7/7/04
to
On 2004-07-07, DukeNM <tride...@softhome.net> wrote:
> How can i limit each users mail sending size ??
>
> is this possible ?
>
> i know there is a maxMAILSIZE but that applies globbaly to all users.
>
> but what about for each individual user.
>
> say i want user X to be able to send 5 MB max
> while user Y be able to send 1MB max

* Make sure confMAX_MESSAGE_SIZE is undefined to avoid advertising a
maximum size before receiving sender information.

* Put a list of users whose maximum is 5 MB in /etc/mail/big-users, one
per line. If you need additional classes of users, duplicate each
{BigUsers} line below with a different class name, e.g. {HugeUsers}.

* Add the following to sendmail.mc. It assumes users are honest about
their return addresses; if not, you'll need to implement authentication
and check $&{auth_authen}.

LOCAL_CONFIG
F{BigUsers}/etc/mail/big-users
Kstorage macro

LOCAL_RULESETS
SLocal_check_mail
R$* $: <?> $>canonify $1
R<?> $={BigUsers} < @ $=w . > $: 5000000 privileged max size
R<?> $* $: 1000000 default max size
R$+ $: $1 $(storage {MaxMsgSize} $@ $1 $)
R$+ $: $(arith l $@ $&{msg_size} $@ $1 $)
RFALSE $#error $@ 5.2.3 $: "552 Message size exceeds " $&{MaxMsgSize}

Scheck_compat
R$* $: $(arith l $@ $&{msg_size} $@ $&{MaxMsgSize} $)
RFALSE $#error $@ 5.2.3 $: "552 Message size exceeds " $&{MaxMsgSize}

Per Hedeland

unread,
Jul 9, 2004, 5:04:06 AM7/9/04
to
In article <slrnceoobk...@home.irb.hr> Matej Vela <mv...@irb.hr>
writes:

>
>* Add the following to sendmail.mc. It assumes users are honest about
> their return addresses; if not, you'll need to implement authentication
> and check $&{auth_authen}.

It also assumes that "they" (i.e. the SMTP clients that send their mail)
use the SMTP SIZE extension (and are honest about the value given).

--Per Hedeland
p...@hedeland.org

Matej Vela

unread,
Jul 11, 2004, 6:16:15 PM7/11/04
to

No, the second check sees the actual message size (as noted in op.txt):

>>Scheck_compat
>>R$* $: $(arith l $@ $&{msg_size} $@ $&{MaxMsgSize} $)
>>RFALSE $#error $@ 5.2.3 $: "552 Message size exceeds " $&{MaxMsgSize}

However, now that I've tested it again, I found {MaxMsgSize} gets
mysteriously unset between check_mail and check_compat, so *all*
messages bounce. :-( The following does work:

LOCAL_CONFIG
F{BigUsers}/etc/mail/big-users
Kstorage macro

LOCAL_RULESETS
SLocal_check_mail
R$* $: <?> $>canonify $1
R<?> $={BigUsers} < @ $=w . > $: 5000000 privileged max size
R<?> $* $: 1000000 default max size

R$+ $: $1 $| $(arith l $@ $&{msg_size} $@ $1 $)
R$+ $| FALSE $#error $@ 5.2.3 $: "552 Message size exceeds " $1

Scheck_compat
R$* $| $* $@ $>Local_check_mail $1

Per Hedeland

unread,
Jul 11, 2004, 7:49:29 PM7/11/04
to
In article <slrncf3f1c...@home.irb.hr> Matej Vela <mv...@irb.hr> writes:
>On 2004-07-09, Per Hedeland <p...@hedeland.org> wrote:
>> In article <slrnceoobk...@home.irb.hr> Matej Vela <mv...@irb.hr>
>> writes:
>>>* Add the following to sendmail.mc. It assumes users are honest about
>>> their return addresses; if not, you'll need to implement authentication
>>> and check $&{auth_authen}.
>>
>> It also assumes that "they" (i.e. the SMTP clients that send their mail)
>> use the SMTP SIZE extension (and are honest about the value given).
>
>No, the second check sees the actual message size (as noted in op.txt):

Sorry, missed that...

--Per Hedeland
p...@hedeland.org

0 new messages