Skip to main content

By clicking Submit, you agree to the developerWorks terms of use.

The first time you sign into developerWorks, a profile is created for you. Select information in your developerWorks profile is displayed to the public, but you may edit the information at any time. Your first name, last name (unless you choose to hide them), and display name will accompany the content that you post.

All information submitted is secure.

  • Close [x]

The first time you sign in to developerWorks, a profile is created for you, so you need to choose a display name. Your display name accompanies the content you post on developerworks.

Please choose a display name between 3-31 characters. Your display name must be unique in the developerWorks community and should not be your email address for privacy reasons.

By clicking Submit, you agree to the developerWorks terms of use.

All information submitted is secure.

  • Close [x]

Creating the "Mark unsigned mail with attachment" agent

Andreas Arning, Presented by Lotus Software, IBM Corporation
Andreas Arning works on WebSphere Process Choreographer.

Summary:  Don't know if the file attachment you received came from a trusted source? Now you can with the Mark unsigned mail with attachment agent. Use this Notes agent to see if you received an unsigned message with a file attachment right from your Inbox!

Date:  19 Apr 2004
Level:  Introductory
Also available in:   Japanese

Activity:  3072 views
Comments:  

The "Mark unsigned mail with attachment" agent automatically checks for unsigned mail carrying an attachment. Because more and more mail messages are sent using an unknown or even a fake user ID, this agent can add one more level of security to help your organization prevent the spreading of worms and viruses.

In your Inbox, mail messages that have one or more attachments but don't have a digital signature will look like the fourth mail message (from the top) in the following screen. (Notice the bomb icon instead of the paper clip.)


Figure 1. Mail message with attachment marked as unsigned
Mail message with attachment marked as unsigned

Note: The bomb icon in the Subject column does not necessarily indicate a virus; it only indicates that the mail message contains an attachment, but has no digital signature. The other messages shown in the previous screen may or may not be signed. The "Mark unsigned mail with attachment" agent runs only on those messages that contain attachments. You can modify this agent to run on all mail messages if you prefer.

Creating the "Mark unsigned mail with attachment" agent

  1. Open a server replica or copy of a mail database.
  2. In Notes 5, choose Create - Agent. In Notes 6 or later, choose Create - Design - Agent.
  3. In the Agent Properties box, enter a name for the agent. We use "Mark unsigned mail with attachment."
  4. In Notes 5, select the Shared Agent option. In Notes 6 or later, select the Shared option.
  5. In Notes 5, in the "When should this agent run" field, select Before New Mail Arrives. In Notes 6 or later, select the same option from the Runtime drop-down list.
  6. In the Run drop-down list of the programmer's pane, select LotusScript.
  7. In the Objects pane, click Initialize, then delete the default lines: Sub Initialize ... End Sub.
  8. Add the following code to the agent:

    Sub Initialize
    	Dim icon As Integer
    	icon = 91
    	Dim session As New NotesSession
    	Dim doc As NotesDocument
    	Dim it  As NotesItem
    	Set doc = session.documentcontext
    	If doc.HasEmbedded Then
    		If  Not doc.IsSigned Then
    			Set it = doc.GetFirstItem("$ContentIcon")
    			Call doc.ReplaceItemValue("$ContentIcon", icon)
    			Call doc.Save(True, False)
    		End If			
    	End If
    End Sub
    

  9. Save and close the agent.

If you have the Mark incoming mail agent...

If you have already installed an agent for distinguishing incoming mail by To: and cc: (see the tip, "Mark incoming mail" for more information), add the following code rather than the code shown in the previous section:

Sub Initialize
	Dim icon As Integer
	icon = 91
	Dim session As New NotesSession
	Dim doc As NotesDocument
	Dim it  As NotesItem
	Set doc = session.documentcontext
	If doc.HasEmbedded Then
		If  Not doc.IsSigned Then
			Set it = doc.GetFirstItem("$ContentIcon")
			Call doc.ReplaceItemValue("$ContentIcon", icon)
			Call doc.Save(True, False)
		End If			
	End If
	Const macro$ = "TO1:=3;TO2:=4;CC1:=22;CC2:=21;BCC:=163;DISTR:=70;" +_
	"userName:=@ProperCase(@DbTitle);tmpvar:=@If(_ViewIcon!=""""&" +_
	"_ViewIcon!=0;0;@IsDocTruncated;0;@ProperCase(@Name([CN];SendTo))=userName;" +_
	"@If(@Elements(SendTo)=1;TO1;TO2);@ProperCase(@Name([CN];CopyTo))=userName;" +_
	"@If(@Elements(CopyTo)=1;CC1;CC2);BlindCopyTo!="""";BCC;SendTo!="""";DISTR;0);" +_
	"@Return(tmpvar)"
	Dim result As Variant
	result = Evaluate( macro$, doc)
	If Not result(0) = 0 Then
		Set it = doc.GetFirstItem("_ViewIcon")
		Call doc.ReplaceItemValue("_ViewIcon", result(0))
		Call doc.Save(True, False)
	End If	
End Sub

Customization

If you prefer another icon to the bomb, use a number other than 91 in the second line of the preceding code:

icon = 91

For example, if you use 92 instead, you will get a stop sign icon as shown in figure 2. See the topic, "Displaying an icon in a column" in the Domino Designer help for a list of column icons that you can use.


Figure 2. Stop sign icon
Stop sign icon

For more information about Notes mail, see the following:


About the author

Andreas Arning works on WebSphere Process Choreographer.

Report abuse help

Report abuse

Thank you. This entry has been flagged for moderator attention.


Report abuse help

Report abuse

Report abuse submission failed. Please try again later.


developerWorks: Sign in


Need an IBM ID?
Forgot your IBM ID?


Forgot your password?
Change your password

By clicking Submit, you agree to the developerWorks terms of use.

 


The first time you sign into developerWorks, a profile is created for you. Select information in your developerWorks profile is displayed to the public, but you may edit the information at any time. Your first name, last name (unless you choose to hide them), and display name will accompany the content that you post.

Choose your display name

The first time you sign in to developerWorks, a profile is created for you, so you need to choose a display name. Your display name accompanies the content you post on developerWorks.

Please choose a display name between 3-31 characters. Your display name must be unique in the developerWorks community and should not be your email address for privacy reasons.

(Must be between 3 – 31 characters.)

By clicking Submit, you agree to the developerWorks terms of use.

 


Rate this article

Comments

Help: Update or add to My dW interests

What's this?

This little timesaver lets you update your My developerWorks profile with just one click! The general subject of this content (AIX and UNIX, Information Management, Lotus, Rational, Tivoli, WebSphere, Java, Linux, Open source, SOA and Web services, Web development, or XML) will be added to the interests section of your profile, if it's not there already. You only need to be logged in to My developerWorks.

And what's the point of adding your interests to your profile? That's how you find other users with the same interests as yours, and see what they're reading and contributing to the community. Your interests also help us recommend relevant developerWorks content to you.

View your My developerWorks profile

Return from help

Help: Remove from My dW interests

What's this?

Removing this interest does not alter your profile, but rather removes this piece of content from a list of all content for which you've indicated interest. In a future enhancement to My developerWorks, you'll be able to see a record of that content.

View your My developerWorks profile

Return from help

static.content.url=http://www.ibm.com/developerworks/js/artrating/
SITE_ID=1
Zone=Lotus
ArticleID=12891
ArticleTitle=Creating the "Mark unsigned mail with attachment" agent
publish-date=04192004
author1-email=
author1-email-cc=

Table of contents

Tags

Help
Use the search field to find all types of content in My developerWorks with that tag.

Use the slider bar to see more or fewer tags.

For articles in technology zones (such as Java technology, Linux, Open source, XML), Popular tags shows the top tags for all technology zones. For articles in product zones (such as Info Mgmt, Rational, WebSphere), Popular tags shows the top tags for just that product zone.

For articles in technology zones (such as Java technology, Linux, Open source, XML), My tags shows your tags for all technology zones. For articles in product zones (such as Info Mgmt, Rational, WebSphere), My tags shows your tags for just that product zone.

Use the search field to find all types of content in My developerWorks with that tag. Popular tags shows the top tags for this particular content zone (for example, Java technology, Linux, WebSphere). My tags shows your tags for this particular content zone (for example, Java technology, Linux, WebSphere).

Try IBM PureSystems. No charge.

Special offers