Home > Domino Tips > Developer > Application for queueing non-delivery reports on hub mail server
Domino Tips:
EMAIL THIS
 TIPS & NEWSLETTERS TOPICS 

AGENT

Application for queueing non-delivery reports on hub mail server


Pavol Polacek
11.04.2005
Rating: --- (out of 5)


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


E-mails with one or more attachments delivered to addresses reaching their size limit threshold usually generate non-delivery reports (NDRs), and the attachment is then sent back to sender. In our Notes environment, this often creates "dead mails," because these mails canot be delivered back to sender and remain in the "mail.box" router database. Even these messages can cause the sender to exceed their mail quota threshold (particularly during mass mailings). They also consume the server's disk space and can impact mail routing between servers.

There is no way to set up an option such as "do not attach the attachment to NDR" in Domino. (Nor can you do this in Exchange, without modifying parameters in the OS register.)

To create a procedure for doing this and eliminating this "unwanted feature," I developed an application called NDR queue -- "NDRqueue.nsf" on our hub mail server. The application was created from the standard mail router mailbox template and is stored in the root of this server. I also created rules on this server (tab "Rules" in "Servers-Configurations-Configuration" document). This rule was defined thusly: "When message contains "NonDelivery Report" form and it contains more than 0 attachment then move this message to "NDRqueue.nsf" database."

I also created a triggered agent named "Manage NDR" which is launched automatically after creating or modifying a document in these databases. By our server settings, the agent runs every 30 minutes, but it could be less. This agent searches for unprocessed documents and deletes all embedded objects from them and moves them back to the mail router. The final NDR message sent to mail sender (during my tests) was only 1.7 KB instead of the original message's 3.7 MB.

This scenario could be used also for several hub servers in cluster. Each server needs to have this one application (NDR Queue). This application could be created as replicas of each other too. I am able to provide a template of this application.

The ACL was set up to manager access for all members of "Notes Admin" group and to manager access to local server. Default access is depositor.

Any comments or suggested improvements are appreciated.

Sub Initialize 
        Dim session As New notessession 
        Dim db As notesdatabase 
        Dim spam As notesDocumentCollection 
        Dim spamDoc As notesdocument 
        Dim rtitem As Variant 
        Dim object As NotesEmbeddedObject 
        Dim richStyle As NotesRichTextStyle 
        Set richStyle = session.CreateRichTextStyle 
        
        
        Set db=session.currentDatabase 
        Dim mailboxDb As New NotesDatabase
( db.Server, "mail.box" ) ' if you have more than 
one mail.box it is better to use 'mail1.box' 
        
        Set spam=db.UnprocessedDocuments 
        Set spamDoc=spam.getFirstDocument 
        While Not spamDoc Is Nothing 
                Set rtitem = 
spamDoc.GetFirstItem( "Body" ) 
                If ( rtitem.Type = RICHTEXT ) Then 
                        If Not Isempty
(rtitem.EmbeddedObjects) Then 
                                Forall o In rtitem.EmbeddedObjects 
                                        If (( o.Type = EMBED_ATTACHMENT )
 Or ( o.Type = EMBED_OBJECTLINK ) 
Or ( o.Type = EMBED_OBJECT )) Then 
Call rtitem.AddNewLine( 2 ) 
richStyle.NotesColor = COLOR_RED 
richStyle.FontSize = 10 
richStyle.Bold = True 
Call rtitem.AppendStyle(richStyle) 
Call rtitem.AppendText( "Attached file 
(object) '" & o.Source & "' has been deleted...") 
Call o.Remove 
End If 
  End Forall 
  End If 
                        
If spamDoc.HasEmbedded Then 
 Forall i In spamDoc.Items 
  If i.Type = ATTACHMENT Then 
Set Object = spamDoc.GetAttachment( i.Values(0) ) 
  Call Object.Remove 
 End If 
 End Forall 
 End If 
                        
 spamDoc.FailureReason = 
spamDoc.FailureReason(0) & 
"!" 'Mark processed record 
spamDoc.Processed = "1" 
  Call spamDoc.Save( True, True ) 

 Call spamDoc.CopyToDatabase( mailboxDb ) 
' copy only if there is NDR with attachments 
                End If 
                
                Call session.UpdateProcessedDoc( spamDoc ) 
                Set spamDoc=spam.getNextDocument(spamDoc) 
        Wend 
        
        Set spam=db.unprocessedSearch
({@Contains(Processed;"1")},Nothing,0) 
        If spam.Count > 0 Then 
                Call spam.removeAll(True) 
        End If 
        
End Sub

Do you have comments on this tip? Let us know.

This tip was submitted to the SearchDomino.com tip exchange by member Pavol Polacek. Please let others know how useful it is via the rating scale below. Do you have a useful Notes/Domino tip or code to share? Submit it to our bimonthly tip contest and you could win a prize and a spot in our Hall of Fame.

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.


Submit a Tip




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


RELATED CONTENT
E-mail
Exploring Lotus Notes Domino 8.0.1 and beyond
LotusScript agent moves tagged spam email to junk mail folder
Send SMS text messages between Lotus Notes 7 and mobile devices
Update to Exchange Server 2003 Connector for Lotus Notes
Two fast and easy Domino Web Access performance tips
Can I encrypt an email sender's name?
How to modify a Lotus Notes signature file using LotusScript
Putting a stop to incoming spam on Lotus Notes 6.5
Lotus Notes replication snafu: Accidentally deleted archived email
Exporting email from Lotus Notes to .EML messages

Server
Move a Lotus Domino server to a new certifier without a reinstall
Securely connect Lotus Domino servers on different domains
Track and record Lotus Notes user logins to Domino Server
Use SMTP outbound authentication to relay hosts in Lotus Notes Domino 8
Log off idle Lotus Notes users for better Domino Server performance
Copy Lotus Notes databases from the Domino Server console command line
How to perform an in-place upgrade of Lotus Domino server hardware
Daylight Saving Time 2007 -- seven helpful tips for Lotus Notes administrators
FileZilla
How and why to change replica IDs during a Lotus Notes Domino upgrade

Agent
Verify scheduled agent status with Domino Extensible Language (DXL)
How to export data from a Lotus Notes database to a CSV file
Enable or disable scheduled agents without opening the Lotus Notes database design
Creating custom views in Lotus Notes databases
Editing fields in a Lotus Notes view with Ajax
How to automatically create a backup copy of your Domino Directory
Export Lotus Notes documents to Microsoft Word via Internet Explorer
A bevy of Notes/Domino development tips
Best practices for using the Lotus Notes WebQuerySave agent
A flexible data export agent for Lotus Notes

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.

HomeNewsTopicsITKnowledge ExchangeTipsAsk the ExpertsMultimediaWhite PapersDomino IT Downloads
About Us  |  Contact Us  |  For Advertisers  |  For Business Partners  |  Site Index  |  RSS
SEARCH 
TechTarget provides enterprise IT professionals with the information they need to perform their jobs - from developing strategy, to making cost-effective IT purchase decisions and managing their organizations' IT projects - with its network of technology-specific Web sites, events and magazines.

TechTarget Corporate Web Site  |  Media Kits  |  Reprints  |  Site Map




All Rights Reserved, Copyright 1999 - 2008, TechTarget | Read our Privacy Policy
  TechTarget - The IT Media ROI Experts