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
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
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
Thank you for a very cogent and helpful response.
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