si-riesal schreef:
:0
* ^Subject: getresult stuid \/[^ ]+
{ STUID = "$MATCH" \
ID = "$STUID" \
MATCH = ''}
:0
* ^Subject: getresult stuid [^ ]+ pass \/[^ ]+
{ PASS = "$MATCH" \
PW = "$MATCH" \
MATCH = "$PASS" }
I would make that more like:
:0
* ^Subject: getresult stuid \/[^ ]+
{ ID = "$MATCH" }
:0
*$ ^Subject: getresult stuid $\ID pass \/[^ ]+
{ PW = "$MATCH" }
:0 # add a c-flag if you still want
# to receive the original message
* ID ?? .
* PW ?? .
{
SQL = "SELECT * \
FROM login \
WHERE student_id = '$ID' \
AND passwd = '$PW'"
:0 bf wi # replace the body of the message
# by the output of the mysql command
| ./mysql "KHS" -w -e "$SQL"
:0 hf wi # create auto-reply header
| formail -r
:0 # call sendmail
! -t
}
--
Groet, Ruud
____________________________________________________________
procmail mailing list Procmail homepage: http://www.procmail.org/
procmail(_at_)lists(_dot_)RWTH-Aachen(_dot_)DE
http://MailMan.RWTH-Aachen.DE/mailman/listinfo/procmail