Skip to main content link. Accesskey S
  • HCL Logo
  • HCL Notes and Domino wiki
  • THIS WIKI IS READ-ONLY. Individual names altered for privacy purposes.
  • HCL Forums and Blogs
  • Home
  • Product Documentation
  • Community Articles
  • Learning Center
  • API Documentation
Search
Community Articles > Lotus Domino > Domino admin > Customizing IBM Lotus Domino V8.5.x to auto-zip mail attachments
  • Share Show Menu▼
  • Subscribe Show Menu▼

Recent articles by this author

IBM Lotus Notes 8.5.3 Traveler Upgrade Pack 1 in High-Availability configuration performance

This article reports the performance test results of a IBM Lotus Notes Traveler 8.5.3 Upgrade Pack 1 in High Availability (HA) configuration on Microsoft Windows 64-bit with both IBM DB2 in HA Disaster Recovery configuration and Microsoft SQL database with mirroring.

Configuring Microsoft Windows single sign-on for Web clients in an existing IBM Lotus Domino environment

This article is a simplified guide of the steps to configure Microsoft Windows Single Sign-on with IBM Lotus Domino. Using this guide, you can get your environment running in just a few minutes, even if you do not have in-depth knowledge of either the Trust Association Interceptor operation mode ...

Generating LTPA tokens using a Java servlet

This article describes the detailed steps to generate a Lightweight Third-Party Authentication (LTPA) token, using a JavaTM client running in an application server other than IBM® WebSphere® Portal.

Configuring SSL encryption for IBM Lotus Domino 8.5.1

This article provides the detailed steps on how to configure Secure Sockets Layer (SSL) encryption for IBM® Lotus® Domino® 8.5.1.

Comparing IBM Lotus Notes widgets with other widget types

This article introduces the often-confused concepts of widgets, Web widgets, Google Gadgets, iWidgets, and IBM® Lotus® Notes® widgets. Using some practical examples, we compare the differences and relationships among these five concepts, demonstrating the convenience offered by Notes ...
Community articleCustomizing IBM Lotus Domino V8.5.x to auto-zip mail attachments
Added by ~Fred Cistumipulings | Edited by ~Fred Cistumipulings on December 16, 2010 | Version 8
  • Actions Show Menu▼
expanded Abstract
collapsed Abstract
This article explains how you can customize an IBM® Lotus® Domino®-based mail file to auto-zip all attachments without using any third-party tool. This feature can be implemented for both client- and Web-based users and does not require any other utility to be installed on your system.
ShowTable of Contents
HideTable of Contents
  • 1 Introduction
  • 2 Setting up the environment
  • 3 Customizing the mail template for Notes client users
  • 4 Changing the forms
  • 5 Changing the Shared Actions
  • 6 Changing the CoreEmailClasses script library
  • 7 Customizing the mail template for iNotes users
    • 7.1 Changing Forms85.nsf for releases earlier than 8.5.2
    • 7.2 Changing Forms85.nsf for release 8.5.2
    • 7.3 Changing Forms85_x.nsf
    • 7.4 Changing the mail template
    • 7.5 Other changes
  • 8 Additional recommendations/considerations
  • 9 Conclusion
  • 10 Resources
  • 11 About the author

Introduction


Lotus Domino is a robust and scalable platform that can be used for the mail messaging requirements of an enterprise. A Domino administrator has different options to choose from when assigning a mail client to the end user; for example, the following types of clients are configurable with the Domino mail server:
  • IBM Lotus Notes® clients
  • IMAP clients, such as Microsoft® Outlook Express
  • POP3 clients
  • Lotus iNotes®
  • IBM Lotus Domino Access for Microsoft Outlook clients (last release was 8.0.2)
The default mail template supplied with Lotus Domino can be customized by use of Lotus Domino Designer per the requirements of an organization. This article builds upon this facility, explaining how you can customize the underlying code and design elements to automatically zip attachments, on the fly, in an outbound mail message.

The template used here is version 8.5.1, but the same code will also work on earlier versions, including V7 and V8, though there will be a difference in the line numbers in the script library. This article addresses only the following use cases:
  • Lotus Notes clients
  • Lotus iNotes

Setting up the environment


This section explains the development and server environments necessary to deploy the solution.

Server component
Table 1 shows the server-side component used.

Table 1. Server components
Component / Server name
Purpose
Lotus Domino 8.5.1
Used for authentication, authorization, and mail messaging service

Development tools
Table 2 shows the development tools used.

Table 2. Development tools
Component name
Purpose
Domino Administrator
Used to administer and configure Lotus Domino
Domino Designer
Used to customize the Domino mail template

Client tools
Table 3 shows the client components used:

Table 3. Client tools
Component Name
Purpose
Lotus Notes
Used to access client-based mail template
Web Browser
Used to access browse- based mail template

Server component setup
Refer to the Lotus Domino and Notes Information Center for the steps to install Lotus Domino Enterprise Server 8.5.1.

Development environment setup

For releases earlier than 8.5.2

Perform the following steps to set up the Domino environment:
  • Download the files from the Attachments section of this article.
  • Sign the databases using the ID of the Domino Administrator of your Domino server.
  • Copy the zipmail85.ntf file to the Data directory of your Domino server.
  • Copy the Forms85.nsf file to Data/iNotes directory of your Domino server (keep a copy of the original file in this directory).

For release 8.5.2

Perform the following steps to set up the Domino environment:
  • Download the files from the Attachments section of this article.
  • Sign the databases using the ID of the Domino Administrator of your Domino server.
  • Copy the zipmail85.ntf file to the Data directory of your Domino server.
  • Copy the Forms85.nsf file to Data/iNotes directory of your Domino server (keep a copy of the original file in this directory).
  • Copy the Forms85_x.nsf file to Data/iNotes directory of your Domino server (keep a copy of the original file in this directory).

Customizing the mail template for Notes client users


The design of the Domino mail template is stored in Mail85.ntf, which can be found in the Data directory of the Domino server.

Modified design elements
For our solution we modify the following design elements of this template:
  • Memo, Reply, and Reply with History form
  • CoreEmailClasses script library
  • Send, Send and File, Save as Draft shared actions

New design elements
We also modify the following design elements of this template:
  • ZipDir script library
  • (AttachDrafts) view
  • Exit shared action

Changing the forms


Make the following changes in the Memo, Reply, and Reply with History forms:

Mail Send dialog box. Disable the “Present mail send dialog” option in the Defaults tab for On Close in all three forms mentioned above (see figure 1).

Figure 1. Disable “Present mail send dialog”


New fields. Add these three new fields: SaveOptions, EscCheck, and HasDraft.

Queryclose event. Add the code in listing 1 at the second line in the Queryclose event of the above-mentioned forms.

Listing 1. Code to add to Queryclose event



This code is added to override the default functionality whereby users can close the form using the Esc button or the File > Close option.

Postopen action. Add the code in listing 2 at the third line in the Postopen event of the forms.

Listing 2. Code to add to Postopen event



New shared action. Add the new action, “Exit,” to the three forms, to enable users to close the document.

Changing the Shared Actions


Save as Draft. Add the code in listing 3 to this shared action.

Listing 3. Code to add to Save as Draft action


Send. Add the code in listing 4 to this shared action.

Listing 4. Code to add to Send action



Send and File. Add the code in listing 5 to this shared action.

Listing 5. Code to add to Send and File action



All the changes in the shared actions are made to cater to the new fields that have been added. In the case of the Send and the Send and File actions, additional code is added to simulate the default functionality that's been overridden as a result of changes made in the script.

Changing the CoreEmailClasses script library


The changes described in this section are at the core of the solution.

Options section. Add the following code to this section:



Declarations section. Add the code in listing 6 to this section.

Listing 6. Code to add to Declarations section



New Function. Add the new function, “detachattachment,” to the script library. This function contains the code that detaches the attachments from the mail in a folder, zips the folder, reattaches the zip file, and then removes the temporary files from the user's machine.


  • This function uses the new ZipDir script library to zip the files and is called at three places just before the existing Mail Send function is called. The line numbers in the modified library in the attached template where this function is called are 609, 648, 687.
  • ZipDir script library. This new script library is a Java library containing the code to zip the attachment folder and is called by the detachattachment function.
  • AttachDrafts view. This view is used by the new detachattachment function code.

Exit shared action. This new action is included in the forms and enables users to exit the current document (see listing 7).

Listing 7. Code for Exit shared action


The UI for iNotes users is generated from the database Forms85.nsf, located in the Data/iNotes directory of the Domino server.

Customizing the mail template for iNotes users



Changing Forms85.nsf for releases earlier than 8.5.2


Modification to s_MailMemoDictionary Subform. Add the following code as the first line of the subform, inside the new set of tags:

<NOTESVAR NAME={$$QuerySaveAgent} VALUE={"(WebZipFiles)"}>

This enables the required QuerySave agent to be called.

Modification to l_MailMemoEdit Subform. Add the following code as the first line of the subform:

<input type="hidden" name="$$QuerySaveAgent" value="(WebZipFiles)">


Changing Forms85.nsf for release 8.5.2


No change is required in this database.

Changing Forms85_x.nsf


Create a new database on the server Forms85_x.nsf in the iNotes directory, using the Lotus iNotes Extension Forms template.

Modification to Custom_MailMemoDictionary_Lite Subform. Add the following code in the subform:

		<NotesDictionary>
			<NOTESVAR NAME={$$QuerySaveAgent} VALUE={"(WebZipFiles)"}> 
		</NotesDictionary>

NOTE: Remember to take care of the commented code inside the subform. You can remove it or leave it as is.

Changing the mail template


For release 8.5.2, in the (WebZipFiles) agent inside the mail template, replace these lines of code at the end of the agent:

	Print |<script>|	
	Print |window.close();|
	Print |parent.CwX();|			
	Print |</script>|	

with these:

	Print |<script>|
	Print |try{var DhU=window.frameElement.DhU; setTimeout(DhU.DlJ.EHq(DhU), 0);} catch (e){}|	
	Print |parent.CwX();|			
	Print |</script>|	

Other changes


iNotes_WA_QueryAgents=1. Add this parameter to the server's Notes.ini file so that the WebQuerySave agents will run for iNotes users.

Additional recommendations/considerations


Implement a Desktop Policy setting for all users with the new template to have their Sent mails save option set to “Always.” This is to keep in synch with the new code, which always saves the mail to the Sent folder.

Pros and cons of the solution
Following are the benefits provided by this solution:
  • Disk space savings
  • Less data flow through the server
  • Less frequent mailbox capping
Following are the trade-offs of the solution:
  • Each Web user will have an agent running on the server, so the administrator must take care of the additional load on the server.
  • Also, there will be a couple of changes in the user experience; for example, users won't be able to use the 'Esc' button or the File > Close option, to close a mail document.

Conclusion


This article has explained how you can customize Lotus Domino, for either Notes client users or iNotes users, to auto-zip all mail attachments. Using the solution described here, users can save large amounts of disk space and can minimize the risk of exceeding the mail quotas.

Resources


Learn
Refer to the Lotus Domino Info center:
http://publib.boulder.ibm.com/infocenter/domhelp/v8r0/index.jsp

Refer to the Lotus Domino documentation:
http://www.ibm.com/developerworks/lotus/documentation/domino/80x.html?S_TACT=105AGX28&S_CMP=DLMAIN

Lotus Domino wiki:
http://www-10.lotus.com/ldd/dominowiki.nsf

Get products and technologies
Try Lotus Domino:
http://www-01.ibm.com/software/in/lotus/try-it-center/index.html?wm=700001f2671&cm_sp=CT601-_-SWB40-_-2671

Discuss
Participate in the discussion forum:
http://www.ibm.com/developerworks/forums/forum.jspa?forumID=782

About the author


Abhishek Jain has worked with IBM India Software Labs since 2004 and has been in the industry for more than eight years. He currently works as an IT Specialist with Lotus Lab Services and is skilled in various Lotus technologies, namely, Domino, Sametime, Quickr, and Connections. He has considerable experience in, and is certified on, both Lotus and Java/J2EE technologies. You can reach Abhishek at abhi.jain@in.ibm.com.

  • Actions Show Menu▼


expanded Attachments (3)
collapsed Attachments (3)
Edit the article to add or modify attachments.
File TypeSizeFile NameCreated OnDelete file
application/x-zip 5,570 KB zipmail85.zip 12/15/10, 6:13 AM
application/x-zip 9,349 KB Forms85.zip 12/15/10, 6:14 AM
application/x-zip 59 KB Forms85_x.zip 12/15/10, 6:13 AM
expanded Versions (1)
collapsed Versions (1)
Version Comparison     
VersionDateChanged by              Summary of changes
This version (8)Dec 16, 2010, 6:18:15 PM~Fred Cistumipulings  
expanded Comments (0)
collapsed Comments (0)
Copy and paste this wiki markup to link to this article from another article in this wiki.
Go ElsewhereStay ConnectedAbout
  • HCL Software
  • HCL Digital Solutions community
  • HCL Software support
  • BlogsDigital Solutions blog
  • Community LinkHCL Software forums and blogs
  • About HCL Software
  • Privacy
  • Accessibility