Solved

Alerting Users about the Maximum Outgoing Email Size

Posted on 2003-11-19
10
498 Views
Last Modified: 2013-12-18
Hi experts,

   I am just writing a simple code to notify users if their currently editing emails' sizes are over the maximum outgoing email size that is set in the domino server.  I put the following code in the QuerySave event of Memo, Reply, and Reply with History forms:

'disallow save if document size is over 7340032 bytes
      
If source.document.size > 7340032 Then
            Continue = False
            sorrymsg = "Sorry! The size of email exceeds the maximum limit."
            exceedinKB = (source.document.size -7340032) / 1024
            Msgbox( sorrymsg+"  It is about " + Str(Int(exceedinKB)) + "KB over the maximum limit.")
      End If

The codes works fine, but it becomes titeous if I want to change the number 7340032 to something else, then I have to change that in all Memo, Reply, and Reply with History forms in all email databases.  

  Is there a way to reference the max outgoing email size value of the domino server using LotusScripts?


thanks,
Andy
0
Comment
Question by:damrakandy
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
10 Comments
 
LVL 46

Expert Comment

by:Sjef Bosman
ID: 9777213
You could try to locate the applicable Configuration document (either secific or default configuration) in the N&A-book, get the field RouterMaxMsgSize and use it.
0
 
LVL 2

Expert Comment

by:ksi2001
ID: 9779820
you need to create a script library with a function getMaxMessageSize() As Long

declare script library in your code like

Use "scriptLibraryMentionedAbove"

If source.document.size > getMaxMessageSize() Then
 ........

inside the function you can either return your constant or use the value from configuration document as sjef suggests.  So there will be only one point where you will change you code if logic changes.
0
 
LVL 2

Expert Comment

by:ksi2001
ID: 9779836
oh and for the multiple mail databases - you can propagate your changes using template.
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 31

Expert Comment

by:qwaletee
ID: 9783984
What I would do is create a script that runs on all your server, and nightly pushes the max size setting configured for your server into the user's mal file Calendar Profile.  Once it is there, the mail file code can easily do an internal retrieve.  The design never changes... it is just a bit of data.

If you need help writing the code, let me know.
0
 

Author Comment

by:damrakandy
ID: 9815448
Hi,

  thanks all for the help.  It seems that qwaletee's suggestion would be the best.

qwaletee,

   I have never written a server script before.  where should I start?  please help.  

thanks,

andy
0
 
LVL 31

Accepted Solution

by:
qwaletee earned 50 total points
ID: 9815528
Have you written LotusScript at all?  Create a database on the server, and create a LotusScript agent that yuo will, at first, run manually (runs from Action menu).

Here's some example code that will retrieve a server's maximum message size:

Dim s as new notesSession
Dim thisDB as notesDatabase
Dim server as string
Dim directory as notesDatabase
Dim configView as notesView
Dim configDoc as notesDocument
Dim serverName as notesName
Dim maxSize as Long

Set thisDB = s.currentDatabase
server = thisDB.server

serverName = s.createName(server)
server = serverName.canonical 'make sure we have it in CN=Server/O=xyzyz format, since that's how the view stores it

Set configView = directory.getView(  "($ServerConfig)"   )
Set configDoc = configView.getDocumentByKey(server)
If doc is nothing then
  'not found; maybe server still cam back as a flat name?
  Set configDoc = configView.getDocumentByKey("CN=" & server) 'partial match here?
End if
If doc is nothing then
  'not found; maybe server still cam back as a flat name?
  Set configDoc = configView.getDocumentByKey("*" , True) 'fall back, use default config doc
End if


maxSize = configDoc.routerMaxMessageSize(0)
0
 
LVL 31

Expert Comment

by:qwaletee
ID: 9815557
We also need code that will go out to every mail file on the server...

Dim serverUsersGlobal as notesView
Dim serverUsers as notesViewEntryCollection
Dim user as notesViewEntry
Dim mailFilePath as String
Dim mailFile as notesDatabase
Dim profile as notesDOcument

Set serverUsersGlobal = directory.getView("MailUsers")
Set serverUsers = serverUsersGlobal.getAllEntriesByKey(server)
If serverUsers.count = 0 then
  'not found; maybe server still cam back as a flat name?
  Set serverUsers = serverUsersGlobal.getAllEntriesByKey("CN=" & server) 'partial match here?
End if
Set user = serverUsers.getFirstEntry
Do Until user Is Nothing
  mailFilePath = user.columnValues(4)
  Set mailFile = s.getDatabase(server,mailFIlePath)

  Set profile = mailFile.getProfileDocument ( "CalendarProfile" )

  Set user = serverUsers.getNextEntry(user)
Loop
0
 
LVL 31

Expert Comment

by:qwaletee
ID: 9815559
Once you have the calendar profile - or a profile of your own making -- you can save the max size value there.
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This is an old article, please see an updated version of this article, located here: http://www.experts-exchange.com/articles/23619/Notes-8-5x-Windows-7-Notes-info-and-tips.html
IBM Notes offer Encryption feature using which the user can secure its NSF emails or entire database easily. In this section we will discuss about the process to Encrypt Incoming and Outgoing Mails in depth.
Michael from AdRem Software explains how to view the most utilized and worst performing nodes in your network, by accessing the Top Charts view in NetCrunch network monitor (https://www.adremsoft.com/). Top Charts is a view in which you can set seve…
In this brief tutorial Pawel from AdRem Software explains how you can quickly find out which services are running on your network, or what are the IP addresses of servers responsible for each service. Software used is freeware NetCrunch Tools (https…

724 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question