hsb957170(_at_)rccvax(_dot_)ait(_dot_)ac(_dot_)th writes:
...
Now when I use this recipe (as given in the man pages of procmailex) for
retrieving a file, I get an error and only a plain reply a returned to the
sender. The file is not returned.
I use this recipe
:0
* !^From +YOUR_USERNAME
* !^Subject:.*Re:
* !^FROM_DAEMON
* ^Subject:.*resume
| (formail -r ; cat resume.txt) | $SENDMAIL -oi -t
and I get this in the log file (only the last few lines are here)
procmail: Match on "^Subject:.*resume"
procmail: Assigning "LASTFOLDER= (formail -r ; cat resume.txt) | $SENDMAIL -oi
-t"
From hsb957170(_at_)rccvax(_dot_)ait(_dot_)ac(_dot_)th Wed Mar 19 00:47:54
1997
Subject: resume
Folder: (formail -r ; cat resume.txt) | $SENDMAIL -oi -t 518
procmail: Notified comsat: "rajesh@: (formail -r ; cat resume.txt) | $SENDMAIL
-oi -t"
procmail: Executing " (formail -r ; cat resume.txt) | $SENDMAIL -oi -t"
stty: tcgetattr: Not a typewriter
Not a terminal
Cannot find terminal.
cat: cannot open resume.txt
I don't understand the last few lines of this log. What I need to do to
correct this problem. I am no expert on UNIX and just know the basics. BTW I
am using procmail on DEC Alpha Workstation (runnning OSF1).
It appears that you are running "stty" and possibly other terminal
dependent commands from your .cshrc or .tcshrc. This is a no no: all
commands that expect to be connected to a terminal should only be run
from your .login.
You should also place the following at the top of your .procmailrc:
SHELL = /bin/sh
Either of the above will get rid of the "stty" error message, but doing
both will take care of problems that may crop up in the long term.
As for the "cat: cannot open resume.txt" error and the empty response,
this is because your resume isn't located in "resume.txt" *in
procmail's working directory*. cat is running from the directory
$MAILDIR (whatever you assigned that to be in your .procmailrc) and is
therefore looking for the file "resume.txt" in that directory. You can
either change where cat is looking for it, or move it to that
directory. The former can be done by changing the action line of the
recipe from:
| (formail -r ; cat resume.txt) | $SENDMAIL -oi -t
to something like:
| (formail -r ; cat $HOME/resume.txt) | $SENDMAIL -oi -t
That would tell cat to look for resume.txt in your home directory.
Philip Guenther