procmail
[Top] [All Lists]

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

2003-01-14 01:58:00
Hi Dman!

I have some findings! ;)

The "revised" setup look like this now :

# environment
SHELL=/bin/sh
DEFAULT=$HOME/mail/maildefault
MAILDIR=$HOME/ProcMail/mbox
SENDMAIL=$HOME/mail/sendmail/sendbox
LOGFILE=$HOME/mail/procmail.log
STATUS=$HOME/status/
LOG="--- Writing ${LOGFILE} for ${LOGNAME}, "
VERBOSE=ON

# insert info text here

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

# put the rest in default mailbox
:0:
${MAILDIR}

And logfile shows:

--- Writing /home/rapport/mail/procmail.log for rapport, procmail: [17955] 
Tue Jan 14 09:06:05 2003
procmail: Match on "^Subject:.crontab.*"
procmail: Couldn't determine implicit lockfile from "formail"
procmail: Locking ".lock"
procmail: Assigning "SUCCESS="
procmail: Executing "formail,-xSubject:"
procmail: Unlocking ".lock"
procmail: Skipped "/home/rapport/status/${SUCCESS}"
procmail: Locking "/home/rapport/ProcMail/mbox.lock"
procmail: Assigning "LASTFOLDER=/home/probind/ProcMail/mbox"
procmail: Opening "/home/rapport/ProcMail/mbox"
procmail: Acquiring kernel-lock
procmail: Unlocking "/home/rapport/ProcMail/mbox.lock"
From root(_at_)host(_dot_)local  Tue Jan 14 09:06:05 2003
 Subject: crontab yada yada
  Folder: /home/rapport/ProcMail/mbox  460
procmail: Notified comsat: "rapport(_at_)4488:/home/rapport/ProcMail/mbox"
--- Writing /home/rapport/mail/procmail.log for rapport, procmail: [17976] 
Tue Jan 14 09:07:49 2003
procmail: Match on "^Subject:.crontab.*"
procmail: Couldn't determine implicit lockfile from "formail"
procmail: Locking ".lock"
procmail: Assigning "SUCCESS="
procmail: Executing "formail,-xSubject:"
procmail: Unlocking ".lock"
procmail: Assigning "TESTING= crontab eat var2"
procmail: Skipped "/home/rapport/status/${TESTING}"
procmail: Locking "/home/rapport/ProcMail/mbox.lock"
procmail: Assigning "LASTFOLDER=/home/rapport/ProcMail/mbox"
procmail: Opening "/home/rapport/ProcMail/mbox"
procmail: Acquiring kernel-lock
procmail: Unlocking "/home/rapport/ProcMail/mbox.lock"
From root(_at_)host(_dot_)local  Tue Jan 14 09:07:49 2003
 Subject: crontab eat var2
  Folder: /home/rapport/ProcMail/mbox  448
procmail: Notified comsat: "rapport(_at_)4948:/home/rapport/ProcMail/mbox"

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

Brgds.

/Lars Andersen





dman(_at_)nomotek(_dot_)com
13-01-03 12:56

 
        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:

:0 flags:
* ^Subject:.[Cr][Rr][Oo][Nn][Tt][Aa][Bb].*
SUCCESS=| formail -xSubject:
/home/rapport/status/${SUCCESS}

The procmail log showes this:

procmail: Skipped "lags:"

You maybe want a `$' in front of $flags.  You've
unintentionally created a filtering recipe, with the `f',
btw.  But that's an aside, and it was rejected by procmail,
anyway, per your log.  (Have you *read* your log?)

Now logfile shows it can't determine logfilename, and uses .lock instead 
;)
(one down there, more to go)



procmail: Match on "^Subject:.[Cc][Rr][Oo][Nn][Tt][Aa][Bb].*"

Procmail is case-insensitive by default.  You really don't
need that syntax at all, unless you're using the `D' flag
to invoke case-sensitivity.

You are right ;)


procmail: Extraneous filter-flag ignored

That was your `f'.

procmail: Assigning "SUCCESS="
procmail: Executing "formail,-xSubject:"
procmail: Skipped "/home/rapport/status/${SUCCESS}"
"Skipped," because a recipe cannot hav two action lines.
That is your main problem.


Why will Procmail not write a mailboxfile with VAR ${SUCCESS} as name?

Btw, some builds of procmail have trouble with the

               var|= expression

syntax due to a bug.  I don't know whether that's biting you too,
but if SUCCESS really is empty for you, then that's why.  In that
case, switch to

               SUCCESS = `formail -xSubject:`

Have tried this but i then get mailfiles as text string specified ;(
I have tried:

SUCCESS=| formail -xSubject:
TESTING=${SUCCESS}
/home/rapport/status/${TESTING}

And correct characters which is in the VAR "Subject:" is listed in the 
log. (so it is not empty))
But "/home/rapport/status/${TESTING} is also skipped


as an assignment statement (not as action in a recipe).

-- 
dman

I don't have any ideas anymore, i tried to keep it as simple as possible
and understand why it can't work?
Thx for the help anyway! ;)

Brgds.

/Lars Andersen


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