procmail
[Top] [All Lists]

X-Loop question

1998-12-27 02:43:35
On Fri, 18 Dec 1998 14:30:14 -0700, Carlos Sotero-O10006
<Carlos_Sotero-O10006(_at_)email(_dot_)mot(_dot_)com> wrote:
The recipe listed below is for replying to a forged spam
issue that is hitting out postmaster account.  The auto reply
portion is working fine in my testing.  However, I thought putting
in the X-loop option would do the following:
Check for X-Loop: user(_at_)host in the headers.  
If found no longer process the recipe
if not found put X-Loop: user(_at_)host in the reply

Unclear what you mean by "option". The condition 

    * ! ^X-Loop: 010006(_at_)mot\(_dot_)com

will stop processing there and then if the message headers contain a
string which matches the regex. I'll add a different paraphrase of
what's going on in your recipe down below, but first:

Right now a reply to the auto reply in the message results 
in another auto reply from this account.

This seems to mean: when a user +responds+ to the autoresponse they
get another autoresponse. This is probably true unless by some heavy
magic their mail program would somehow insert the X-Loop: header
you're looking for. (For the record, no MUA in the known universe
currently does this.)

A more or less standard way to avoid responses to autoreplies is to
set up the autoreply with a faux sender address which clearly says
"don't respond here" and if they try it anyway, they get a bounce.
(Personally, I'm not sure I think this is the best way to do it.)

# Auto reply testing for forged spam issue 12/18/98 CFS
:0BHD #grep  body and headers, D means case sensitivety
* .*(INTERNATIONAL DRIVER\'S LICENSE|UNIVERSITY DEGREE PROGRAMS).*$

(Tangentially, this regex is unnecessarily clumsy. You don't need the
leading or trailing wildcards. They don't hurt much, but they're
inelegant. Here's an equivalent expression:

    :0BHD
    * INTERNATIONAL DRIVER'S LICENSE|UNIVERSITY DEGREE PROGRAMS

You can keep the parens if you like them.)

Now, here's a rundown of the remainder of your recipe:

{
   :0hc
   * !^FROM_DAEMON

If the incoming message matches that complicated ^FROM_DAEMON
expression, don't continue processing this particular recipe.

   * !^X-Loop: 010006(_at_)mot(_dot_)com

Ditto if the incoming message matches this regex. This is designed to
avoid simple mail loops, such as an autoresponder which copies back
your message to you. Primarily you avoid loops within your own system
-- it is my understanding that few if any other systems than Procmail
do anything with X-Loop. (Anybody?)

   | (formail -rt -A "X-Loop: 010006(_at_)mot(_dot_)com" \
         -I "Precedence: junk" ; \
      cat $MAILDIR/forgeresponse.txt ) | $SENDMAIL $SENDMAILFLAGS -t

Here, both the unconditional adding of X-Loop and addition of the
Precedence header are important. Well-behaving MTA:s will not generate
bounces of undeliverable messages with Precedence: junk, for example.

   :0:
   postmaster-spam-complaint
}

And this part should already be obvious.

If this is still not clear, perhaps you could follow up to the list
with partial headers of a message you would have liked to not generate
an autoresponse to, and we can continue from there.

Hope this helps,

/* era */

-- 
.obBotBait: It shouldn't even matter whether    <http://www.iki.fi/~era/>
I am a resident of the state of Washington. <http://members.xoom.com/procmail/>

<Prev in Thread] Current Thread [Next in Thread>