procmail
[Top] [All Lists]

Re: Procmail will not use a VAR as filename for mailbox

2003-01-16 00:42:16
Hi!

The thing i want procmail to do is as follows:

Scan subject filed for match "crontab*"
Then use the Subjectfield, as a filename for that mail.  (field will be 
unique everytime because it is a text+time field and 1 mail will/can 
arrive at that time)
A lot of files can be generated in a week so, I need the complete 
information in the Subject field as a filename. 

brgds.

/Lars Andersen





dman(_at_)nomotek(_dot_)com
14-01-03 14:32

 
        To:     laa(_at_)dmdata(_dot_)dk, 
procmail(_at_)Lists(_dot_)RWTH-Aachen(_dot_)DE
        cc:     dman(_at_)nomotek(_dot_)com
        Subject:        Re: Procmail will not use a VAR as filename for mailbox

Lars Andersen <laa(_at_)dmdata(_dot_)dk> schrieb:


The "revised" setup look like this now :

# environment
SHELL=/bin/sh
DEFAULT=$HOME/mail/maildefault

Btw, normally you'll just want to compile in the right DEFAULT
and then let it ride -- until you have a reason to change it
at a particular point in the rc.


# insert info text here

:0 $flags:
* ^Subject:.crontab.*
SUCCESS=| formail -xSubject:
TESTING=${SUCCESS}
/home/probind/status/${TESTING}

An rc-file can contain recipes, assignment statements,
and comments.  Your last line above seems to be an attempt
to run a command.  That won't work on a line by itself.
That's why your log shows:

procmail: Skipped "/home/rapport/status/${SUCCESS}"

Also, your recipe (beginning with `:0' and continuing through
the `SUCCESS=| . . .' action line) is not a "delivering" recipe
(for which, see the man pages); so it does not need a lockfile.
That is, remove the trailing colon on the first line of the recipe.

The extraneous lockfile is the reason your log shos:

procmail: Couldn't determine implicit lockfile from "formail"



Have you defined $flags anywhere?  If not, take it out.

What, exactly, is it you are trying to do?

I see no real point in setting SUCCESS to something and
then immediately also setting TESTING to the same thing, but . . .
whatever.  It does no harm.  However, if the Subject: has
unuasual whitespace, you will lose that, because you're not
using quotation marks in your assignment.

If that thing in status/ is a program or script, well,

                 :0 c
                 | /path/to/program

is one way to run it.



Does some have other ideas?  Or is a specific procmail version needed?

It would help if we knew what you wanted, exactly.

-- 
dman





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