[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

Procmail to ruby

Mislav Kasner

11/5/2007 2:06:00 PM

Hello,

I want to write a Procmail recipe that pipes a message to a
Ruby script as ARGV argument.
I wrote this recipe but it doesn't work.

:0
* ^TO_*
| ruby main.rb

How can I pass a message as argument to the script?
3 Answers

jh+ruby-lang

11/5/2007 5:02:00 PM

0

On Mon, 5 Nov 2007 15:05:36 +0100
Mislav Kasner <mislav_kasner_MAKNI_@yahoo.com> wrote:

> Hello,
>
> I want to write a Procmail recipe that pipes a message to a
> Ruby script as ARGV argument.
> I wrote this recipe but it doesn't work.
>
> :0
> * ^TO_*
> | ruby main.rb
>
> How can I pass a message as argument to the script?

e.g.

:0 fw
* ^X-MS-Has-Attach: yes
| ${HOME}/bin/fixup_b0rken_tnef.rb

barjunk

11/5/2007 10:51:00 PM

0

On Nov 5, 8:01 am, Jonathan Hudson <jh+ruby-l...@daria.co.uk> wrote:
> On Mon, 5 Nov 2007 15:05:36 +0100
>
> Mislav Kasner <mislav_kasner_MAK...@yahoo.com> wrote:
> > Hello,
>
> > I want to write a Procmail recipe that pipes a message to a
> > Ruby script as ARGV argument.
> > I wrote this recipe but it doesn't work.
>
> > :0
> > * ^TO_*
> > | ruby main.rb
>
> > How can I pass a message as argument to the script?
>
> e.g.
>
> :0 fw
> * ^X-MS-Has-Attach: yes
> | ${HOME}/bin/fixup_b0rken_tnef.rb

The above implies a properly formated bang line, correct?

Mike B.

jh+ruby-lang

11/6/2007 5:03:00 PM

0

On Mon, 05 Nov 2007 14:50:30 -0800
barjunk <barjunk@attglobal.net> wrote:

> On Nov 5, 8:01 am, Jonathan Hudson <jh+ruby-l...@daria.co.uk> wrote:
> > On Mon, 5 Nov 2007 15:05:36 +0100
> >
> > Mislav Kasner <mislav_kasner_MAK...@yahoo.com> wrote:
> > > Hello,
> >
> > > I want to write a Procmail recipe that pipes a message to a
> > > Ruby script as ARGV argument.
> > > I wrote this recipe but it doesn't work.
> >
> > > :0
> > > * ^TO_*
> > > | ruby main.rb
> >
> > > How can I pass a message as argument to the script?
> >
> > e.g.
> >
> > :0 fw
> > * ^X-MS-Has-Attach: yes
> > | ${HOME}/bin/fixup_b0rken_tnef.rb
>
> The above implies a properly formated bang line, correct?

As quoted yes, but the following works as well, assuming ruby in on
the PATH known to procmail.

:0 fw
* ^X-MS-Has-Attach: yes
| ruby ${HOME}/bin/fixup_b0rken_tnef.rb

-jh