Home > Domino Tips > Administrator > Mail > Create an Outlook Express style "Block Sender" button for your inbox
Domino Tips:
EMAIL THIS
 TIPS & NEWSLETTERS TOPICS 

MAIL

Create an Outlook Express style "Block Sender" button for your inbox


Jessica Stratton
11.13.2001
Rating: -4.14- (out of 5)


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


This will block senders on a user-by-user basis rather than using the server configuration document. It consists of five parts:

1. A modified Inbox folder to include a "Block Sender" button.

2. An "Add to blocked senders" agent that will add the sender to your list.

3. A view containing all your blocked senders (giving you the ability to easily remove an entry from the list).

4. A form that contains the blocked sender entry.

5. A Before Mail Arrives agent to query each incoming mail message to see if the user is on your blocked senders list.

Code

Inbox Folder "Block Sender(s)" button:

1. In the Inbox folder, create a new action titled "Block Sender".

2. Set it as a Simple Action, @Function Formula, Select document when run.

3. The formula is @Command([ToolsRunMacro];"(BlockSender)")
***********************
Creating the BlockSender agent:

1. Title the agent BlockSender, and set it to run Manually from Agent List. It should run on Selected Documents.

2. These are your LotusScript declarations:
Dim db As NotesDatabase
Dim doc As NotesDocument
Dim col As NotesDocumentCollection
Dim blockdoc As NotesDocument
Dim view As NotesView
Dim existBlockdoc As NotesDocument

3. This is the code for the agent itself:

Sub Initialize
Dim session As New NotesSession	
Set db = session.CurrentDatabase
Set view = db.GetView("Blocked Senders")
Set col = db.unprocesseddocuments
Set doc = col.GetFirstDocument

While Not doc Is Nothing Set existBlockdoc = view.GetDocumentByKey(doc.From(0))
If existBlockdoc Is Nothing Then Set blockdoc = New NotesDocument(db) blockdoc.Form = "Blocked Sender" blockdoc.BlockedSender = doc.From(0) Call blockdoc.Save(False, False) Else Msgbox (doc.From(0) +" is already in your Blocked Senders list.") End If Set doc = col.GetNextDocument(doc) Wend
If col.Count > 1 Then Msgbox "All senders have been successfully added to your Blocked Senders list
unless already added." Else Set doc = col.GetLastDocument Msgbox (doc.From(0) + " has been successfully added to your Blocked Senders
list unless already added.") End If End Sub
***********************
Creating your form for each Blocked Sender entry:
1. Create a form titled "Blocked Sender".
2. Include one field titled BlockedSender, text, editable.
**********************
Create a view for each Blocked Sender entry:

1. Create a view titled "Blocked Senders".
2. It needs a view selection formula of By Form Used->Blocked Sender.
3. It needs one column only, with the field value of BlockedSender.
4. Make sure the column is sorted!
*********************
Creating the agent to query the messages:

1. Create an agent called DeleteBlockedSenders.
2. Set the agent to run Before New Mail Arrives.
3. These are your LotusScript declarations:
Dim db As NotesDatabase Dim doc As NotesDocument Dim view As Notesview Dim blockdoc As NotesDocument
4. This is the code for the agent itself:
Sub Initialize Dim session As New NotesSession Set session = New NotesSession Set db = session.CurrentDatabase Set view = db.GetView("Blocked Senders") Set doc = session.documentcontext Set blockdoc = view.GetDocumentByKey(doc.From(0)) If blockdoc Is Nothing Then Exit Sub Else Call doc.Remove(True) End If End Sub

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.




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



RELATED CONTENT
Lotus Notes Domino Interoperability
Display SharePoint data in a Lotus Notes Web application with Ajax
Search Microsoft Active Directory with LotusScript
Open a Lotus Notes database from Microsoft SharePoint 2007
Top 10 Lotus Notes/Domino administration tips of 2008
Can Lotus Notes/Domino and Microsoft SharePoint play nice together?
IBM Lotus Notes versus Microsoft SharePoint: The rest of the story
Fix Lotus Notes 8.0 issues when launching Microsoft Office applications
A batch file for Lotus Notes Domino maintenance on Windows Server 2003
Lotus Notes and Microsoft SharePoint integration
Running Lotus Notes Domino on Linux

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