Solved

Alerting Users about the Maximum Outgoing Email Size

Posted on 2003-11-19
10
494 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
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
 
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
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Saving email w/ attachments using lotus notes 7 283
Lotus Notes 41 184
Switching from Lotus Notes to Outlook 4 46
Unable to change external email address in Lotus Notes Mailbox 11 63
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
Notes Document Link used by IBM Notes is a link file which aids in the sharing of links to documents in email and webpages. The posts describe the importance and steps to create a Lotus Notes NDL file in brief.
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
With the power of JIRA, there's an unlimited number of ways you can customize it, use it and benefit from it. With that in mind, there's bound to be things that I wasn't able to cover in this course. With this summary we'll look at some places to go…

920 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

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now