procmail
[Top] [All Lists]

Re: assign a unique ID to each incoming email?

1999-04-07 23:09:16
Mathias Koerber <mathias(_at_)staff(_dot_)singnet(_dot_)com(_dot_)sg> writes:
I tried that, but still have problems with it. I am trying to assign
a new ticket number when the incoming mail did not already contain
a ticket-number in its Subject header n the form [S-ABUSE-xxxx]:

Here is the part of my recipe:
...
LOCKFILE=serial.rc$LOCKEXT                                              ## set 
global lock
INCLUDERC=$MAILDIR/serial.rc                                            ## 
read current value (whether we us it or not)
:0 Ec                                                                   ## 
increment
* $ $SERIAL^0                                                           ##  
value just read
*       1^0                                                             ##  by 
1
...
However, this is what happens (from my procmaillog, verbose):

--cut here---
[...]
procmail: Assigning "PREFIX=S-ABUSE"
procmail: No match on "^Subject:.*\[${PREFIX}-\/[0-9][^]]+.*"
procmail: Assigning "LOCKFILE=serial.rc.lock"
procmail: Locking "serial.rc.lock"
procmail: Assigning "INCLUDERC=/home/abuse/mail/serial.rc"
procmail: Assigning "SERIAL=1"
procmail: Score:       0       0 "##  value just read"
procmail: Score:       0       0 "##  by 1"

Comments are not allowed at the end of condition lines: they'll be
interpreted as part of the condition, usually as part of the regexp.
If you want to put comments near the conditions, put them on separate
lines:

        :0 Ec
        # increment value just read by 1
        * $ $SERIAL^0
        *         1^0
        ...


Philip Guenther