Solved

Automatically Delete Dead Messages

Posted on 2004-04-26
3
1,350 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

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Problem "Can you help me recover my changes?  I double-clicked the attachment, made changes, and then hit Save before closing it.  But when I try to re-open it, my changes are missing!"    Solution This solution opens the Outlook Secure Temp Fold…
Article by: Rob
Notes 8.5 Archiving Steps and Tips This article covers setting up a Notes archive, and helps understand some of the menu choices making setting up and maintaining a Notes archive file easier.
This Micro Tutorial will teach you how to censor certain areas of your screen. The example in this video will show a little boy's face being blurred. This will be demonstrated using Adobe Premiere Pro CS6.
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

825 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