Home > Domino Tips > Administrator > Mail > Informing the users of their mail size and quotas via the standard MailFS frameset
Domino Tips:
EMAIL THIS
 TIPS & NEWSLETTERS TOPICS 

MAIL

Informing the users of their mail size and quotas via the standard MailFS frameset


Steven Gatehouse
04.23.2001
Rating: -4.06- (out of 5) Hall of fame tip of the month winner


Digg This!    StumbleUpon Toolbar StumbleUpon    Bookmark with Delicious Del.icio.us   


You Can View User Feedback To This Tip

Upgrading to R5 mail quotas have started to be used more and more. I wanted a way to tell how much space I had left in my mail file so that I would not receive that horrid, "...would exceed it on disk quota..." message. The solution I came up with was a small piece of LotusScript that checks the mail file size and displays a "status bar" graphic. It includes the size of file along with a percentage reading and current size. By placing this information in the top left frame of the mail file frameset, users can see when their database is getting too close to its maximum file size.

The solution involves three steps:
1. Create a new form with four fields
2. Add the LotusScript to the PostOpen event of the form
3. Modify the MailFS Frameset to include the form


Code

Code: 1) First, create a form and create four "Computed For Display" fields as follows:

SaveOptions with a value of "0"
DisplayBar with value DisplayBar (make it native OS style with a size of 0.700")
MailDisplay with value MailDisplay
FileSize with value FileSize
Make all the fields of type text, font Default Sans Serif size 8 and plain (apart from DisplayBar which should be bold)

Place the SaveOptions field at the top of your form

Then add a fixed width 1x2 table (Column One fixed at 0.75", Column Two fixed at 1.25") and place the DisplayBar field in column One and MailDisplay and FileSize in column two but on separate lines.

2)
Once you have added the fields, add the following script to the PostOpen event of your new form then save and close the form.

'Script begins
Sub Postopen(Source As Notesuidocument)
    Dim session As New notessession
    Dim db As notesdatabase
    Dim doc As notesdocument
    Set db = session.currentdatabase
    Set doc = source.document
    dbsize = (db.size)/1000
    dbmax = db.sizequota
    percent = (dbsize/dbmax)

    For i = 0 To (percent*100)
    bars = bars & "|"
    ' Each bar represents 5%
    i = i + 5
    Next

    message = "Database at " & Cint(percent*100) & "%"

    doc.FileSize = Format((dbsize/1000) , "Fixed") & "Mb"
    doc.MailDisplay = message
    doc.DisplayBar = bars
End Sub
'Script ends

3)
Now all that remains is to update the frameset design so that the top left frame does not to include the "Mail Title" page but your new form.

USER FEEDBACK TO THIS TIP

  • I liked the example of the Frameset notice of the quota but it has a minor bug -- the FOR LOOP includes "i = i + 5" but does not take into consideration that the FOR also increments the counter. Thus, the counter is being incrementing by six rather than five. I also adapted it to my own preferences with a few twists.

         Dim session As New notessession
         Dim db As notesdatabase
         Set db = session.currentdatabase
         Const MB_OK = 0                 ' OK button only
         Const MB_IconInformation = 64   ' Information message
    
         dbsize = (db.size)/1000
         dbmax = db.sizequota
         percent% = Cint( dbsize/dbmax*100 )
         Bars$ = "  |"
         For i = 0 To 100
              If i <= Percent% Then
                   bars$ = bars$ & "="
              Else
                   bars$ = bars$ & " -"
              End If
              i = i + 4   ' Each bar represents 5%
         Next
         bars$ = bars$ & "|  "
         Print "Mail database at " & Percent% & "% of quota" & Bars$ & _
         "Size: " & Format((dbsize/1024) , "Fixed") & "Mb  Max: " & Format
    ((DBMax/1024) , "Fixed") & "Mb"
         If Percent% > 90 Then ' provide a stronger warning at 90%
              Msgbox "Mail database at " & Percent% & "% of quota" & Chr(10) &
    Chr(10) & _
              Bars$ & Chr(10) & Chr(10) & _
              "Size: " & Format((dbsize/1024) , "Fixed") & "Mb   Max: " &
    Format((DBMax/1024) , "Fixed") & "Mb", _
              MB_IconInformation + MB_OK, "Warning: Mailbox approaching maximum
    size"
         End If
    
    —Doug Jamieson


Rate this Tip
To rate tips, you must be a member of SearchDomino.com.
Register now to start rating these tips. Log in if you are already a member.


Submit a Tip




Digg This!    StumbleUpon Toolbar StumbleUpon    Bookmark with Delicious Del.icio.us   



RELATED CONTENT
Mail
Run or restart Notes/Domino agents via text messages
How to create mail files using a LotusScript agent
How to turn off the message recall feature in Lotus Notes 8
Domino server setting and email policy tricks admins must know
Top 10 Lotus Notes/Domino administration tips of 2008
Understanding a Lotus Notes Smart Upgrade rollout
Bringing MailRule documents back into view
Use SMTP outbound authentication to relay hosts in Lotus Notes Domino 8
Notes/Domino 6 version of 'Discover Folder'
Five tips to improve email performance

RELATED RESOURCES
2020software.com, trial software downloads for accounting software, ERP software, CRM software and business software systems
Search Bitpipe.com for the latest white papers and business webcasts
Whatis.com, the online computer dictionary

DISCLAIMER: Our Tips Exchange is a forum for you to share technical advice and expertise with your peers and to learn from other enterprise IT professionals. TechTarget provides the infrastructure to facilitate this sharing of information. However, we cannot guarantee the accuracy or validity of the material submitted. You agree that your use of the Ask The Expert services and your reliance on any questions, answers, information or other materials received through this Web site is at your own risk.



Domino & Lotus Notes Security Solutions: Authentication, Antispam, Encryption and Antivirus
HomeTopicsITKnowledge ExchangeTipsAsk the ExpertsMultimediaWhite PapersDomino IT Downloads
About Us  |  Contact Us  |  For Advertisers  |  For Business Partners  |  Site Index  |  RSS
SEARCH 
TechTarget provides technology professionals with the information they need to perform their jobs - from developing strategy, to making cost-effective purchase decisions and managing their organizations' technology projects - with its network of technology-specific websites, events and online magazines.

TechTarget Corporate Web Site  |  Media Kits  |  Site Map




All Rights Reserved, Copyright 1999 - 2009, TechTarget | Read our Privacy Policy
  TechTarget - The IT Media ROI Experts