Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!think.com!spool.mu.edu!uunet!lotus!lotus!johnr From: johnr@lotus.lotus.com (John Rouillard) Newsgroups: comp.mail.elm Subject: Re: Filter question Keywords: Filter Message-ID: <1991May24.002324.3138@lotus.com> Date: 24 May 91 00:23:24 GMT Article-I.D.: lotus.1991May24.002324.3138 References: <225835.4481@timbuk.cray.com> Sender: news@lotus.com Reply-To: johnr@lotus.lotus.com (John Rouillard) Organization: Lotus Development Corp. Lines: 70 In article <225835.4481@timbuk.cray.com>, anoosh@cray.com (Anoosh Mostaghimi) writes: |> |> I need a set of filter rule(s) or a clever "execute" to be able |> to based on a given "To:" field of a mailing list to *bounce* a |> copy of that email to several other folks and still keep a copy |> of that email in my /usr/spool/mail. This won't *bounce* the message, filter only handles forwarding as far as I can tell, but if forwarding is good enough - try something along the following lines: RULE 1: if ( To = "FTest" and from = "johnr") then save "/usr/spool/mail/fooble" RULE 2: if ( To = "FTest" ) then forward "frisbele@einstein myself@einstein others@anywhere.usa.com" The first time through, the message isn't from you, so rule 2 is invoked sending the mail to the interested parties, including yourself. The next time through, you did send (forward) the message so rule 1 is invoked, and the message is saved. This works OK unless you originated the message, in which case it only gets saved not forwarded. Rule 1 MUST come before rule 2 otherwise, you will never save the message, and will create an inifinite loop of forwarded messages. I don't acutally use the configuration above, I use the subject line instead of the to line, and save it in a file that isn't my spool file. Obviously, this won't work if the message is bounced, since rule 1 wouldn't be executed. If you had a reflector that would bounce the message, then a simple shell script that has: cat - > /tmp/$$ as its first line to capture the message, and then proceeds with: cat /tmp/$$ >> /usr/spool/mail/fooble boing azzy, bazzy, grumpy@any < /tmp/$$ where boing is your mail bouncer. I am not sure if you could write a script for elm and submit it by redirecting stdin, but that may work, to create a mail bouncer. Just invoke elm as "elm -f /tmp/$$" and the input script would be along the lines of: by On more or less the same note, does anybody have patches that allow multiple actions to be tagged to the same pattern. Then this would be a simple case of if (subject = "Forward Test" ) then do save "/usr/spool/mail/fooble" forward "frisbee@einstein others@anywhere.usa.com" execute boing to@these.people etc@you.get.the.idea done or something like this. It is really useful to be able to save a message and run it through a program as well. Ideally a bounce primative would work well. On a completely different note: Why does filter not like strings with "_"'s in them. It seems to use '_' as a delimiter of some sort. I fixed this in my filter by using ^A instead of '_' as a delimeter, but I don't think that is a good solution. -- John