From: Hugh Sasse Date: 2005-12-01T05:00:09+09:00 Subject: Re: Exim mail filter in ruby On Thu, 1 Dec 2005, chrisjroos@gmail.com wrote: > In exim, I create a transport that uses a pipe to send the email to my > shell script. I also create a router that sends every mail that exim > processes to my transport (providing I haven't already processed it). > > My shell script reads the email from stdin and parses it based on some > custom rules. > > If it passes the rule checks it can be sent back into exim. This is > achieved by writing to the stdin of the exim command with some > additional parameters. Once I've given the email back to exim, I want > to check for data on it's (exim command) stdout and stderr so that I > can log any problems. OK, sounds pretty std. > > The interaction with exim is straight from the exim book and all works > ok. The question I have is really about the best way to deal with > piping data to/from different processes within ruby in addition to > trying to understand what's going on better. I needed to understand where the data was flowing: that's why I asked about how it interacted with exim. > > I did use IO.popen to start with and can't now remember the problems I > had, probably just ignorance on my part.. then I think what I wrote should work. Maybe give it a spin or compare it to the version you used unless you threw it out already :-) > > Chris > Hugh