Solved

Automatically Delete Dead Messages

Posted on 2004-04-26
3
1,319 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
Comment Utility
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
Comment Utility
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
Comment Utility
Thanks, Bozzie4 was correct but the code from madheeswar will save me a lot of time!
0

Featured Post

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

For Desktop Techs: How to retain a user's Notes configuration data when swapping out the end user's computer. (Assuming that you are not upgrading to a completely different version of Notes client) All you need to do is: 1) install Notes o…
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.
Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…
This video explains how to create simple products associated to Magento configurable product and offers fast way of their generation with Store Manager for Magento tool.

744 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

18 Experts available now in Live!

Get 1:1 Help Now