David F. Skoll said: > I assume you want to clean out messages *from* your mail server *to* > recipients that have that code. Because Sendmail won't keep a 5xx-failed > message in the queue. > > I'd recommend an alternate strategy: Check the sender of the message; > if it is "<>"; you might as well nuke it after it's been in the queue for > a day or two, because it's a bounce notification that won't be going > anywhere.
Big D, In regards to your advice, There is the possiblity that a connection timed out on a connect out to another mail server, in which case you would have the sender as <> but the message could still potentially be deliverable. Am I understanding you correctly on this? Therefore I want to explicity only dump messages that have been rejected by another mail server with a 5xx error codes. These are items that have been migrated to the slowest queue, because they have been undeliverable for 24+ hours. So here is an example of what I have in my queue. Munged to protect the non existent recipients. Diagnostic-Code SMTP; 554 5.7.1 Sender address rejected by MX servers for domain Diagnostic-Code SMTP; 550 5.1.1 <icsu0081_cs.montana.edu>... User unknown Diagnostic-Code SMTP; 554 5.7.1 Sender address rejected by MX servers for domain Diagnostic-Code SMTP; 554 5.7.1 Sender address rejected by MX servers for domain Diagnostic-Code SMTP; 554 5.7.1 Sender address rejected by MX servers for domain Diagnostic-Code SMTP; 554 5.7.1 Message rejected because it is spam Diagnostic-Code SMTP; 550 5.1.1 <nisbet_cs.montana.edu>... User unknown Diagnostic-Code SMTP; 550 5.1.1 <nisbet_cs.montana.edu>... User unknown Diagnostic-Code SMTP; 550 5.1.1 <pacella_cs.montana.edu>... User unknown Diagnostic-Code SMTP; 554 5.7.1 Message rejected because it is spam Diagnostic-Code SMTP; 550 5.1.1 <solarcar_cs.montana.edu>... User unknown Diagnostic-Code SMTP; 554 5.7.1 Message rejected because it is spam Diagnostic-Code SMTP; 550 5.1.1 <pacella_cs.montana.edu>... User unknown Diagnostic-Code SMTP; 550 5.1.1 <mcdonald_cs.montana.edu>... User unknown Diagnostic-Code SMTP; 550 5.1.1 <joris_cs.montana.edu>... User unknown Diagnostic-Code SMTP; 550 5.1.1 <jwood_cs.montana.edu>... User unknown Diagnostic-Code SMTP; 550 5.1.1 <arobinso_cs.montana.edu>... User unknown Diagnostic-Code SMTP; 550 5.1.1 <icsg0038_cs.montana.edu>... User unknown Diagnostic-Code SMTP; 550 5.1.1 <icsrb_cs.montana.edu>... User unknown Diagnostic-Code SMTP; 550 5.1.1 <icsu8209_cs.montana.edu>... User unknown Diagnostic-Code SMTP; 554 5.7.1 Message rejected because it is spam Diagnostic-Code SMTP; 550 5.1.1 <NISBET_CS.MONTANA.EDU>... User unknown Diagnostic-Code SMTP; 554 5.7.1 Message rejected because it is spam Diagnostic-Code SMTP; 550 5.1.1 <PACELLA_cs.montana.edu>... User unknown Diagnostic-Code SMTP; 550 5.1.1 <hutch_cs.montana.edu>... User unknown Diagnostic-Code SMTP; 550 5.1.1 <winzer_cs.montana.edu>... User unknown Diagnostic-Code SMTP; 550 5.1.1 <bowler_cs.montana.edu>... User unknown Diagnostic-Code SMTP; 550 5.1.1 <claudia_cs.montana.edu>... User unknown Diagnostic-Code SMTP; 554 5.7.1 Message rejected because it is spam Diagnostic-Code SMTP; 550 5.1.1 <icsg0100_cs.montana.edu>... User unknown Diagnostic-Code SMTP; 550 5.1.1 <icsu0080_cs.montana.edu>... User unknown Diagnostic-Code SMTP; 550 5.1.1 <icsq0087_cs.montana.edu>... User unknown Diagnostic-Code SMTP; 550 5.1.1 <icsu0237_cs.montana.edu>... User unknown -- Luke Computer Science System Administrator Security Administrator,College of Engineering Montana State University-Bozeman,Montana _______________________________________________ Visit http://www.mimedefang.org and http://www.canit.ca MIMEDefang mailing list [EMAIL PROTECTED] http://lists.roaringpenguin.com/mailman/listinfo/mimedefang

