procmail
[Top] [All Lists]

Re: Procmail forward 22 times the same email

2002-03-15 12:20:25
At 09:11 2002-03-14 +0000, Christian Roy did say:
I have created a procmailrc in the folder /ect.

/ect, really?

Procmail does forward the email but it forward it 22 times at admin(_at_)bbb(_dot_)bb(_dot_) Why does he do that for.Is there a configuration problem

No, just bad logic in your script.

Naughty script.  No bone.

:0Hc
*^.*[Tt]o: christian(_at_)bbb(_dot_)bb
! admin(_at_)bbb(_dot_)bb

        1. This looks an awful lot like spying on a user.  Be wary where you
tread. I realize the address being spied upon here is the same as your
        given name, but there's no way to tell if this is just a rewrite for
        posting to the list, or what.

        2. As per the documentation, procmail is case-insensitive by default.
        So, no need to use [Tt].  Also, H is a default flag (you need only
        specify it if you were specifying B for body *AND* wanted to egrep
        the header as well).  In either case, your use of these constructs is
        benign - it doesn't adversely affect anything, but they aren't
        necessary.

        3. What gives with the .* BEFORE the header?  In this context, you
        probably mean to use:

                * ^TO_christian(_at_)bbb(_dot_)bb

        (see the manpages for the macro expansion of ^TO_ )


        4. When you forward to another account on the same system, don't you
        figure the message is going to be handled again at this GLOBAL filter?
        When it does, what do you figure the To: field will STILL be?  You
        get one guess at what you're telling procmail to do here (hint: I'm
        surprised it stopped at 22, because this is what we call a MAIL LOOP).
        If you used VERBOSE logging and examined the file, this should have
        been very, very clear.

        5. Procmail IS NOT AN MTA.  What you're trying to do is more
        appropriatley accomplished by using the aliasing facilities available
        in your MTA (yes, an alias can deliver a message to more than one
        user - it can even deliver them to remote users).

        6. Perhaps you should try using $LOGNAME in the /etc/procmailrc
        script to determine who the intended recipient is.  Assuming that
        admin is actually user admin (versus root, or roy, or whatever),
        your recipe would look like:

                :0c
                * LOGNAME ?? christian
                ! admin(_at_)bbb(_dot_)bb

        This says "if the recipient is christian (whether he appears as a
        plaintext recipient or not), then forward a copy of the message to
        the admin user (presumed not to be another alias for christian)."
        When the message arrives for admin, $LOGNAME will be the admin's
        logname, not christian's, so this recipe won't be re-invoked on
        that copy.

---
 Sean B. Straw / Professional Software Engineering

 Procmail disclaimer: <http://www.professional.org/procmail/disclaimer.html>
 Please DO NOT carbon me on list replies.  I'll get my copy from the list.

_______________________________________________
procmail mailing list
procmail(_at_)lists(_dot_)RWTH-Aachen(_dot_)DE
http://MailMan.RWTH-Aachen.DE/mailman/listinfo/procmail

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