Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Queue group for outgoing bounces/MAILER-DAEMON sender/DSN

1 view
Skip to first unread message

Alan Schwartz

unread,
May 22, 2003, 5:05:38 PM5/22/03
to

I've got a system that ends up queuing a lot of outgoing bounce messages
(replies to spammers, basically, where the spamming machine isn't
accepting incoming mail). This system is a fallback MX, so it keeps
its queue around for a long time. This is annoying.

What I'd like to do is have outgoing bounce messages put in their
own queue group so I can time them out separately with their
own queue runners. I have a queue group called 'bounces' and
the following ruleset under sendmail 8.12.9:

LOCAL_RULESETS
Squeuegroup
R$* $: $&f $| $1 sender $| recipient
R$| $* $# bounces empty sender
Rlist-bounces @ $* $| $* $# bounces mailman bounce
R$* $| $* $: $2 recipient
R$* $# mqueue

This ruleset is based on one that I think Claus posted here (that I
found on google). The ruleset correctly assigns outgoing mailman list
messages from 'list-bounces' to the bounces queue, but does not do the
same for messages with sender of <>; they wind up in the usual queue.
However, if I test the rule, it seems to be right:

# /usr/sbin/sendmail -bt -d24.1 -oMf''
ADDRESS TEST MODE (ruleset 3 NOT automatically invoked)
Enter <ruleset> <address>
> queuegroup f...@bar.baz
queuegroup input: foo @ bar . baz
queuegroup returns: $# bounces

When I look at the sendmail logs, I note that these bounces are
being handled by sendmail via DSN, and I wonder if that code
is short-circuiting the queue group selection.

Has anyone else solved this or got an idea on what I might be doing
wrong?

(P.S., I see the _FFR_DSN_QUEUERETURN stuff, which would also solve
this problem, but I'd like to avoid using FFR features if I can.)

Thanks in advance,

Alan

-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
Alan Schwartz | Disclaimer: I represent no one
<ala...@uic.edu> |
Asst. Prof. of Clinical Decision Making| Life is what happens to you while
University of Illinois at Chicago | you're busy making other plans
Department of Medical Education | - J. Lennon
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-

Andrzej Filip

unread,
May 23, 2003, 1:37:39 AM5/23/03
to

As I can see sendmail sets $f in DSN message after new queue is already
selected. During selection process $f is set to $f of the original message.
[ sendmail 8.12.9, file sendmail/savemail.c, function returntosender ]

creates new envelope, $f is copied from message that caused the bounce
543 ee = newenvelope(&errenvelope, e, sm_rpool_new_x(NULL));
queue is selected
577 if (!setnewqueue(ee)
$f is set
691 macdefine(&ee->e_macro, A_PERM, 'f', "\201n");

Suggested fix [untested]:
define special DSN macro before queue is selected and use it in the rule set
+548 macdefine(&ee->e_macro, A_PERM, "{DSN}, "local");

AFAIR the problem has been already discussed in the group
[with no remedies suggested]

> (P.S., I see the _FFR_DSN_QUEUERETURN stuff, which would also solve
> this problem, but I'd like to avoid using FFR features if I can.)

--
Andrzej [pl>en: Andrew] Adam Filip http://www.polbox.com/a/anfi/
*Random epigram* :
You know you are getting old when you think you should drive the speed limit.
-- E.A. Gilliam

Alan Schwartz

unread,
May 24, 2003, 12:01:03 PM5/24/03
to
Andrzej Filip <an...@Box43.pl> writes:

>Alan Schwartz wrote:
>> Has anyone else solved this or got an idea on what I might be doing
>> wrong?
>
>As I can see sendmail sets $f in DSN message after new queue is already
>selected. During selection process $f is set to $f of the original message.
>[ sendmail 8.12.9, file sendmail/savemail.c, function returntosender ]
[snip]

>AFAIR the problem has been already discussed in the group
>[with no remedies suggested]

Thank you for a very cogent and helpful response.

Alan Schwartz

unread,
May 29, 2003, 11:07:50 AM5/29/03
to

A follow-up to this question.

A fairly satisfactory solution has presented itself to the problem.
It looks like this:

Squeuegroup
dnl workspace: recipient
R$* @ $* $: $2 get domain
R$=w $# mqueue local host
R$* $: $>D <$1> <OK> <! To> <$1>
dnl workspace: <result> <recipient>
R<RELAY> $* $# mqueue
R$* $: $&f sender
dnl workspace: sender
R$* @ $* $: $2 get domain
R$=w $# mqueue local host
R$* $: $>D <$1> <OK> <! To> <$1>
dnl workspace: <result> <sender>
R<RELAY> $* $# mqueue
R$* $# bounces


The net effect is to put any mail destined or originating from one of
our local-host-names into the usual mail queue, along with any mail
in which either the sender or recipient is a host that we relay for
(e.g. for which we're a backup MX). Anything else ends up in the
'bounces' queue (and this captures bounces to spammers pretty well).

Cheers.

- Alan

0 new messages