procmail
[Top] [All Lists]

problems with single quote characters

2000-03-28 09:28:20
with the following recipe, i can insert all incoming mail to my list in a
database but when messages contain a single quote character, nothing is
saved in the database..

here is what i use

FROM=`formail -zxFrom:`
TO=`formail -zxTo:`
CC=`formail -zxCc:`
DATE=`formail -zxDate:`
ID=`formail -zxMessage-ID:`
BODY=`formail -I ""`
SUBJECT=`formail -zxSubject`

:0
| mysql -h localhost -u user mailarchive -e "insert into mail (mail_from,
mail_to, mail_cc, mail_date, mail_message_id, mail_body, mail_subject)
values ('$FROM', '$TO', '$CC', '$DATE', '$ID', '$BODY', '$SUBJECT');"

is it possible to convert all single quote characters to something that is
safe to use?

thanks for your time

Harald

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