Ignore me, it was right in the first place... Damn this caffeine!

-t 

-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On
Behalf Of Tim Aranki
Sent: Wednesday, June 02, 2004 2:08 PM
To: [EMAIL PROTECTED]
Subject: [xmail] Re: Mailbox size

Er, change the line:
MaxMbSize = MaxMbSize * 1024 * 1024
.....to...
MaxMbSize = MaxMbSize / 1024 / 1024

Doh! I had been converting the file and folder sizes to Mb, but wanted to
compare on the byte level for better resolution, so changed what I was
converting...the ever so popular copy/paste bug ;)

Thanks to Achim for pointing this out...

-tim

-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On
Behalf Of Tim Aranki
Sent: Wednesday, June 02, 2004 12:57 PM
To: [EMAIL PROTECTED]
Subject: [xmail] Re: Mailbox size

This is quick an dirty, and I have not tested it, but couldn't you just use
something like:
(this is in vbs, so windows only.  I leave the perl conversion as an
exercise for the reader :)

'///-----------------------------------------------///
Dim MAILROOT, MsgFilePath, Rrcpt, Domain, Username, AtPos, FullMbPath

'/// Set the mailroot path
MAILROOT = "c:\mailroot\"

'/// Get the msg path & rrcpt
MsgFilePath = WScript.Arguments(0)
Rrcpt = WScript.Arguments(1)
MaxMbSize = WScript.Arguments(2)

'/// convert to bytes from Mb
MaxMbSize = MaxMbSize * 1024 * 1024

'/// pull the domain out of the address
AtPos = Instr(1, Rrcpt, "@", 1)
Domain = Right(Rrcpt, Len(Rrcpt)-AtPos)

'/// pull the username out of the address Username = Left(Rrcpt, AtPos-1)

'/// build the path to the mailbox
FullMbPath = MAILROOT & "domains\" & Domain & "\" & Username & "\mailbox"

Dim Fso, FolderMb, tsMsg
set Fso = CreateObject("Scripting.FileSystemObject")
set FolderMb = Fso.GetFolder(FullMbPath) set tsMsg =
Fso.GetFile(MsgFilePath)


'/// test to see if we have exceeded the max mailbx size if(tsMsg.Size +
FolderMb.Size) > MaxMbSize then
        '/// this would put us over the limit, 
        '/// reject, and notify the sender
        WScript.Quit(6)
end if

set Fso = Nothing
'///-----------------------------------------------///

Note, I am expecting @@FILE @@RRCPT "Max mailbox size in Mb".  

Example:
"cscript.exe"[tab]"VerifyMailboxSize.vbs"[tab]@@File[tab]@@RRCPT[tab]"20"

This would verify that the mailbox would be less than 20Mb after delivery,
or bounce the msg.

Enjoy,
-tim
 

-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On
Behalf Of Davide Libenzi
Sent: Wednesday, June 02, 2004 12:00 PM
To: [EMAIL PROTECTED]
Subject: [xmail] Re: Mailbox size

On Wed, 2 Jun 2004, Shiloh Jennings wrote:

> That makes sense.  Mabye we could address this issue from a different 
> = angle.
> Would it be possible to extend the functionality of the MaxMessageSize 
> = to automatically block messages that were larger than the mailbox 
> quota?  = You already have a server level MaxMessageSize, but end 
> users also expect a = per user MaxMessageSize setting equal to their 
> mailbox quota.  Since the = mailbox quota varies from mailbox to 
> mailbox, the server level setting is only useful for setting the 
> MaxMessageSize for the largest mailbox.

Nope. There could be many recipients in a single SMTP transaction. The only
way to handle this correctly is rejecting the message at mailbox delivery
time.



- Davide

-
To unsubscribe from this list: send the line "unsubscribe xmail" in the body
of a message to [EMAIL PROTECTED] For general help: send the line
"help" in the body of a message to [EMAIL PROTECTED]

-
To unsubscribe from this list: send the line "unsubscribe xmail" in the body
of a message to [EMAIL PROTECTED] For general help: send the line
"help" in the body of a message to [EMAIL PROTECTED]

-
To unsubscribe from this list: send the line "unsubscribe xmail" in the body
of a message to [EMAIL PROTECTED] For general help: send the line
"help" in the body of a message to [EMAIL PROTECTED]

-
To unsubscribe from this list: send the line "unsubscribe xmail" in
the body of a message to [EMAIL PROTECTED]
For general help: send the line "help" in the body of a message to
[EMAIL PROTECTED]

Reply via email to