[exim] rewriting + ${sg} + $h_stuff magic

Top Pagina
Delete this message
Reply to this message
Auteur: Arkadiusz Miskiewicz
Datum:  
Aan: exim-users
Onderwerp: [exim] rewriting + ${sg} + $h_stuff magic
Hi,

I'm trying to do such rewrite

http@???       "${sg{$h_HTTP-Posting-URI:}{\N([a-zA-Z0-9-.]+\N):(.+)}{\$1}}" F


but it doesn't seem to work:
echo "From: http@???
Subject: test
HTTP-Posting-URI: www.zupa.pl:80/sdfdsfsdf&dfdsfs=dsfdsf;sdfdsf:dsfsd
test" | exim -d+all -f http@??? -t some@??? 2>&1 | less

13:48:00 22992 http@??? in "http@???"? yes (matched "http@???")
13:48:00 22992 expanding: $h_HTTP-Posting-URI:
13:48:00 22992    result: www.zupa.pl:80/sdfdsfsdf&dfdsfs=dsfdsf;sdfdsf:dsfsd
13:48:00 22992 expanding: N([a-zA-Z0-9-.]+N):(.+)
13:48:00 22992    result: N([a-zA-Z0-9-.]+N):(.+)
13:48:00 22992 expanding: $1
13:48:00 22992    result:
13:48:00 22992 expanding: ${sg{$h_HTTP-Posting-URI:}{N([a-zA-Z0-9-.]+N):(.+)}{$1}}
13:48:00 22992    result: www.zupa.pl:80/sdfdsfsdf&dfdsfs=dsfdsf;sdfdsf:dsfsd
13:48:00 22992 LOG: MAIN PANIC
13:48:00 22992   Rewrite of http@??? yielded unparseable address: missing or malformed local part (expected word o
r "<") in address www.zupa.pl:80/sdfdsfsdf&dfdsfs=dsfdsf;sdfdsf:dsfsd
13:48:00 22992 rewritten sender = http@???


Now why this doesn't work?

Note that sg rule seems to be correct:
$ exim -be '${sg{www.zupa.pl:80/sdfdsfsdf&dfdsfs=dsfdsf;sdfdsf:dsfsd}{\N([a-zA-Z0-9-.]+\N):(.+)}{\$1}}'
www.zupa.pl

exim 4.54

ps. of course this rewrite doesn't make any sense at this form since result of expansion is not
an email but I'll want to add sql query and do something like

http@??? "${lookup mysql{SELECT ... WHERE something='${sg{$h_HTTP-Posting-URI:}{\N([a-zA-Z0-9-.]+\N):(.+)}{\$1}}'}}" F
-- 
Arkadiusz Miśkiewicz                    PLD/Linux Team
http://www.t17.ds.pwr.wroc.pl/~misiek/  http://ftp.pld-linux.org/