Solved

Automatically Delete Dead Messages

Posted on 2004-04-26
3
1,336 Views
Last Modified: 2013-12-18
How do I set Domino to automatically delete dead messages caused by the return address being invalid--hence no NDR can be sent? A typical situation is a spam/worm generated email to some generic name like john@domain.com and Domino accepts the mail because there is a John in the address book, but doesn't deliver because the name is not unique. Domino then tries to send an NDR to the sender's return address which of course fails. With most other email servers I've used this was just a configuration option (i.e. "Delete undeliverable mail with a bad return address"), but I can't find any such setting in Domino.

Note that I would accept an answer that explains how to automatically delete ALL dead messages regardless of reason.
0
Comment
Question by:glebn
3 Comments
 
LVL 15

Assisted Solution

by:Bozzie4
Bozzie4 earned 50 total points
ID: 10922885
Create an agent that runs on all dead mails in mail.box.  Note that you must put the agent in another database, to be able to schedule it and let it run automatically.

cheers,

tom
0
 
LVL 19

Accepted Solution

by:
madheeswar earned 200 total points
ID: 10924816
Code:
Option Public
Sub Initialize '=============================================================================================== 'Created by Pablo Herman(1stopdomino) on 8-27-2002 '=============================================================================================== 'This agent will loop through the mail boxes on the server and remove dead mail based on a 'specified selection formula I built this selection formula by first creating a view in the 'mail.box database and putting in the specified formula. Once satisfied I moved this formula 'into my script code to use as a search string. You can schedule this agent to run as often 'as you would like and it should automatically keep your mail boxes clean. You will need to 'put it in a normal(.nsf) database and not the mail.box database otherwise the scheduler will 'not recognize it. '===============================================================================================
 Dim s As New NotesSession
 Dim mbox As NotesDatabase
 Dim dc As NotesDocumentCollection
 
 '>>Establish the database list to process
 Redim dbarray(2) As String
 dbarray(0) = "mail1.box"
 dbarray(1) = "mail2.box"
 dbarray(2) = "mail3.box"
 
 '>>If you only have one mail.box then remark the above 4 lines and unremark the next 2 lines
 'Redim dbarray(0) As String
 'dbarray(0) = "mail.box"
 
 '>>Define search fomula
 sstring$ = "SELECT FORM = ""NonDelivery Report"" & @Contains(@UpperCase(FailureReason); " & _
 """USER ACCOUNT INACTIVE"" : ""NO SUCH USER"" : ""NOT LISTED IN PUBLIC"")"
 '>>Loop through all databases and remove documents based on the search formula
 Forall d In dbarray
 '>>This can only run on the same server it is scheduled on therefore use we can only use ""
 Set mbox = s.GetDatabase("", Cstr(d))
 If mbox.isopen Then
 Set dc = mbox.Search(sstring$, Nothing, 0)
 Print "Found " & dc.count & " documents to delete in " & mbox.filename
 Call dc.RemoveAll(True)
 Else
 Print "Unable to open database " & Cstr(d)
 End If
 End Forall
 
End Sub

paste this code in another database and schedule it.

Best of luck
0
 
LVL 4

Author Comment

by:glebn
ID: 10929978
Thanks, Bozzie4 was correct but the code from madheeswar will save me a lot of time!
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

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.
Along with being a a promotional video for my three-day Annielytics Dashboard Seminor, this Micro Tutorial is an intro to Google Analytics API data.
Migrating to Microsoft Office 365 is becoming increasingly popular for organizations both large and small. If you have made the leap to Microsoft’s cloud platform, you know that you will need to create a corporate email signature for your Office 365…

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

16 Experts available now in Live!

Get 1:1 Help Now