procmail
[Top] [All Lists]

Help with forwarding, and x-loop

2009-07-28 14:15:53
One of my recipe files (I like to keep seperate rc. files for separate tasks) is for forwarding copies of messages to a few other destinations. Obviously I've had to add an X-Loop: header to prevent mail loops, but I don't really like what I've written but don't know how to rearrange (if indeed I need to do so).

Here's an abridged version of what I have so far:

===========================================
# Avoid mail loops
:0 c
* !     ^X-Loop: ryb
{
        # Add X-Loop: header
        :0 fwh
        | formail -A"X-Loop: ryb"

        # Forward a copy to work
        :0 c
        ! my(_at_)work(_dot_)address

        # Forward a copy to my bestest friends
        :0 c
        ! friend1 \
          friend2

        # Ditch the unneeded extra copy
        :0
        /dev/null
}
===========================================

I use the first 'c' flag because I still want the message delivered locally if it has an X-Loop: header (I just don't want to forward again).

I use the other 'c' flags inside the action {} because I need to forward to various addresses (depending on different conditions that I haven't included here).

Please go easy with me, I've got a feeling my recipe is far from perfect, and I'm almost too embarrassed to ask for help, but any help would be most appreciated and I will learn from it.

Many thanks,
Steve
____________________________________________________________
procmail mailing list   Procmail homepage: http://www.procmail.org/
procmail(_at_)lists(_dot_)RWTH-Aachen(_dot_)de
http://mailman.rwth-aachen.de/mailman/listinfo/procmail

<Prev in Thread] Current Thread [Next in Thread>
  • Help with forwarding, and x-loop, Stephen Allen <=