procmail
[Top] [All Lists]

Q on procmail piped to perl

1999-03-28 11:34:42
( This is sent to both the procmail and the perl list, incase someone on
either side has done this before.)


OK, update time...

I tried both of these receipts...

        :0
        * ^TO()perl(_at_)tscinternet(_dot_)com
        * HB ?? ? $HOME/vmail/perl/test.pl
        | true

        :0
        * ^TO()perl(_at_)tscinternet\(_dot_)com
        | $HOME/vmail/perl/test.pl

The procmail.log file says...

^@

That's it.

Each time, each receipt, nothing else.

I know the Perl works, because...
   - it creates the .out from the prompt
   - it creates the .out file with: cat my.txt | test.pl

At least, I think that it means the script works, and is executable.
   -rwxrwxr-x   1 walter        393 Mar 25 22:07 test.pl

(The scripts are below)

I even have a shell script that will work...

        :0
        * ^TO()demo(_at_)tscinternet(_dot_)com
        * HB ?? ? $HOME/vmail/perl/demo "`date`"
        | true

This works just fine. The shell script creates a .out file containing the
past message.

Anyone have any ideas?

Walter

The scripts...

==========================
#! /usr/local/bin/perl5 -w


$/ = undef;                             # undefine line terminator
        my $message = <STDIN>;              # slurp the whole file
$/ = "\n";                              # redefine line terminator


open(LOG, ">>./test.out") or die "$0: Unable to open test.out: $!";
        print LOG '===============================', "\n";
        print LOG $message, "\n\n";
close LOG;


# eof

============================
#!/bin/sh

        nl='
'

        { cat; [ -n "$@" ] && echo "$(_at_)$nl";} >>$0.out

# EOF

============================

<Prev in Thread] Current Thread [Next in Thread>