procmail
[Top] [All Lists]

RE: Q on procmail piped to perl

1999-03-28 16:22:19
-----Original Message-----
From: Stan Ryckman [mailto:stanr(_at_)sunspot(_dot_)tiac(_dot_)net]
Sent: Sunday, March 28, 1999 3:53 PM
To: walter(_at_)tscinternet(_dot_)com
Cc: procmail(_at_)informatik(_dot_)rwth-aachen(_dot_)de
Subject: Re: Q on procmail piped to perl


At 01:20 PM 3/28/99 -0500, Walter wrote:
( 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...

Ugh, please, they're "recipes" not "receipts".

yes, well, so much for my spelling.



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

What are you trying to do with "HB ?? ?" ?

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

The procmail.log file says...

^@

That's it.

That looks suspiciously like the control-carat representation of
a NUL byte... what does "od -c" on your logfile show you?

Also, what's in the rest of your .procmailrc?

Several other *recipes*, filters and forwards.


Do you set VERBOSE on?

No, didn't think of that.

I just did, sent a test message. See bottom of this note for results of log
file.


If not, do so (at the top of it, right after SHELL=/bin/sh -- you do
have that, right?) until things work.

# Important to make recipe shell commands work right
SHELL=/bin/sh


And of course, you have LOGFILE=$MAILDIR/procmail.log
and aren't just assuming that name?

# Set log file name and placement
LOGFILE=$HOME/mail/procmail.log


Each time, each recipe, 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.

Works fine how?

When I send a note to 'demo(_at_)tscinternet(_dot_)com' the shell script copies 
the
send note to an 'demo.out' file with a timestamp on it.


Command line invocation of procmail or by sending mail?

sending mail via pine.


I notice you're ALSO using TO()demo instead of TO()perl here, so you have
more differences than just using a shell script;

Yes, one recipe is to run the perl and the other to is run the shell script.
The shell was done first to test the theory, and then the idea was to create
a perl script to mimic the results.


does the perl@ account have .forward set up to run procmail correctly?

All going to the same account 'tscinternet.com', my .procmailrc file sorts
inbound notes and sends them to the proper place, thus the enclosed recipes
above to illustrate what I was doing.


You can usually check if *something* reads your .procmailrc by
doing "ls -lu"
on it; then send yourself mail, and see if the timestamp updates.
(Not valid on certain filesystems where the read time is "turned off"
for performance reasons.)

Correct, my ISP has this turned off.


Anyone have any ideas?

Note that in many configurations, mailed is delivered by a different
machine than you'd be testing from the command line on.

Correct, it is a different machine.


Is /usr/local/bin/perl5 on your mail delivery machine?

Don't know, will have to ask the ISP admin that.


Does your mail delivery machine understand "#! /usr/local/bin/perl5 -w"
syntax?

That's all I can think of.  If it's a perl problem, or might be,
I can't help... try gawk  :-)

In theory, the perl works fine. any little app I pipe data from to the test
script fires off the script fine.


 But you should be seeing text
in your logfile (at least with verbose), so I would chase that first.

Yes, see results below.



Cheers,
Stan

Thank you sir for your insights on this.

Walter


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

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
procmail: No match on
"(^((Original-)?(Resent-)?(To|Cc|Bcc)|(X-Envelope|Apparently(-Resent)?)-To):
(.*[^a-zA-Z])?)()files([-+][^      ]*)?(_at_)tscinternet\(_dot_)com\>"
procmail: Executing "formail"
procmail: Executing "/export/home/walter/bin/reformpm"
procmail: Executing "formail,-zxx-envelope-to"
procmail: Assigning "env_rcpt=perl(_at_)tscinternet(_dot_)com"
procmail: Executing "/export/home/walter/bin/insertrcvd,--by,tscinternet.com
(205.181.128.2),--for,perl(_at_)tscinternet(_dot_)com"
procmail: [249] Sun Mar 28 17:50:55 1999
procmail: Executing " egrep -iv '^X-Loop: *Infoboard$'"
procmail: [249] Sun Mar 28 17:50:55 1999
procmail: Match on
"(^((Original-)?(Resent-)?(To|Cc|Bcc)|(X-Envelope|Apparently(-Resent)?)-To):
(.*[^a-zA-Z])?)()perl(_at_)tscinternet\(_dot_)com"
procmail: Assigning "LASTFOLDER=/export/home/walter/vmail/perl/test.pl"
procmail: Unlocking "/export/home/walter/.procmailrc.lock"
procmail: Executing "/export/home/walter/vmail/perl/test.pl"
procmail: [298] Sun Mar 28 17:51:20 1999
procmail: Assigning "LOGABSTRACT=0"
procmail: Assigning "LOCKFILE=/export/home/walter/.procmailrc.lock"
procmail: Locking "/export/home/walter/.procmailrc.lock"
procmail: Assigning
"LOG=++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
"
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

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