RE: [exim] data_acl and spool file

Kezdőlap
Üzenet törlése
Válasz az üzenetre
Szerző: Philip Hazel
Dátum:  
Címzett: jori.hamalainen
CC: exim-users
Tárgy: RE: [exim] data_acl and spool file
On Mon, 18 Oct 2004 jori.hamalainen@??? wrote:

> Well, example doesn't work. I'd use extract with keyword because I don't know which 'record' boundary is in Content-Type-header.
>
> > ${extract{boundary}{Content-type: multipart/mixed; type="1"; boundary="frontier"}{$value}{null}}
> null
> > ${extract{boundary}{Content-type: multipart/mixed; boundary="frontier";}{$value}{null}}
> frontier
> > ${extract{boundary}{Content-type: multipart/mixed; boundary="frontier"; type="1";}{$value}{null}}
> frontier
>
> But if $header_Content-Type doesn't return header name:
> > ${extract{boundary}{multipart/mixed; type="1"; boundary="frontier"}{$value}{null}}
> frontier
> > ${extract{type}{multipart/mixed; type="1"; boundary="frontier"}{$value}{null}}
> null
>
> So extract-function cannot be trusted. It's a shame, but regexp works well.


I think I take just a little exception to "cannot be trusted". It does
exactly what it is specified to do. Take this example of yours:

${extract{boundary}{Content-type: multipart/mixed; type="1"; boundary="frontier"}{$value}{null}}

The specification says that the data for extract consists of key/value
pairs, separated by = or whitespace, and with the data optionally
quoted. That data is split up into the following items:

  Content-type:           key
  multipart/mixed;        data
  type                    key
  "1"                     data
  ;                       key     <========== this is the problem
  boundary="frontier"     data


-- 
Philip Hazel            University of Cambridge Computing Service,
ph10@???      Cambridge, England. Phone: +44 1223 334714.
Get the Exim 4 book:    http://www.uit.co.uk/exim-book