procmail
[Top] [All Lists]

Re: log urls

2000-08-09 09:59:31
Leonid Mamtchenkov wrote,

|   It would be fantastic to get all URLs which are mentioned in my incoming
| messages to be saved in a separate file.  I have made a perl script that
| does that, but what should I write in my .procmailrc?  Of course I want
| all my messages to be delivered into separate folders like it is now...
| 
|   I have tried:
|   :0: bh
|   | /path/to/my/script.pl
| 
|   URLs are logged, but messages disappear :(

Well, yes, they would.  Delivery to a pipe (as contrasted to filtering
through a pipe) is delivery, after all.  What you need to do is deliver
a *copy* of the message to the perl script:

   :0c:perlscriptlog$LOCKEXT # change to name of URL logfile+$LOCKEXT
   | /path/to/my/script.pl

I gather thought that the `bh' would make the script read both body and head,
but (1) to the right of the second colon like that, procmail sees it as the
name of the local lockfile, not as flags, and (2) if you had them between the
colons as flags `bh' (or the equivalent `hb') is the default [the man pages
are very unclear about that] and you don't need to state it.

Since the recipe writes to the log file where perl stores the URLs, it should
have a local lock; since no name for it can be inferred from the action line,
you need to name it.  So you do need something to the right of the second
colon, but it should relate the the name of the file being modified.


_______________________________________________
procmail mailing list
procmail(_at_)lists(_dot_)RWTH-Aachen(_dot_)DE
http://MailMan.RWTH-Aachen.DE/mailman/listinfo/procmail

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