procmail
[Top] [All Lists]

Re: Procmail help needed, please

1996-12-25 10:29:20
On Friday 20 December 96, at 14 h 59, the keyboard of Online Corruption 
<hugo(_at_)ionsys(_dot_)com> wrote:

 Hullo. I am very very new to UNIX and I need some step by step help in
setting up Procmail and a recipe. I've looked at several references, but

You have a lot of examples in the procmailex manual page. Use them for a start.
Then, when you'll modify them, you'll probably have trouble to debug. Some 
tricks:

- do not debug with the real ".procmailrc" if mail can arrive at the same time.
You risk losing it. Modify a separate procmail recipe file.
- do not debug with high-level mail agents such as Eudora. The trial-and-error
cycle is typically too long. Use the Unix command-line tools.

Example :

# Display the file we're debugging
% cat mytest.procmailrc
# Make procmail output the process
VERBOSE=on

:0
* ^From: foobar
/tmp/tests

# Display the test message we composed with a text editor:
% cat message
From: foobar
To: bidon
Subject: Ouais

Stupid message...

# Call procmail with the above recipe file and the above message
% procmail tmp/mytest.procmailrc < message
procmail: [17756] Wed Dec 25 18:14:17 1996
procmail: Match on "^From: foobar"
procmail: Assigning "LASTFOLDER=/tmp/tests"
procmail: Opening "/tmp/tests"
procmail: [17756] Wed Dec 25 18:14:18 1996
procmail: Acquiring kernel-lock
 Subject: Ouais
  Folder: /tmp/tests                                                         73

If it fails, read the messages above and correct the recipe file. When it's
ready, put the recipe(s) in the real ".procmailrc" and test with a real mail
message:

% date | Mail -s test -v yourself
yourself... Connecting to local...
procmail: [15823] Wed Dec 25 18:21:03 1996
procmail: Locking "/usr/spool/mail/yourself.lock"
...
From bortz(_at_)pasteur(_dot_)fr  Wed Dec 25 18:21:02 1996
 Subject: test
  Folder: /usr/spool/mail/bortz                                             406





<Prev in Thread] Current Thread [Next in Thread>
  • Re: Procmail help needed, please, Stephane Bortzmeyer <=