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?
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
How can I pass a message as argument to the script?
I wrote this recipe but it doesn’t work.
:0
- ^TO_*
| ruby main.rbHow can I pass a message as argument to the script?
the pipe in the procmail recipe acts much like shell piping.
There are several ways to get standard input in Ruby, here’s one using
the
‘magic’ variable ARGF:
$ cat test.text
this is just a test line
$ cat test.rb
ARGF.each_line do |line|
puts line
end
$ cat test.text | ruby test.rb
this is just a test line
$
HTH,
Felix
On Mon, 5 Nov 2007 15:05:36 +0100
Mislav K. [email protected] wrote:
How can I pass a message as argument to the script?
e.g.
:0 fw
On Mon, 05 Nov 2007 14:50:30 -0800
barjunk [email protected] wrote:
:0
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
-jh
On Nov 5, 8:01 am, Jonathan H. [email protected] wrote:
- ^TO_*
| ruby main.rbHow 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.
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.
Sponsor our Newsletter | Privacy Policy | Terms of Service | Remote Ruby Jobs