Συντάκτης: Phillip Carroll Ημερομηνία: Προς: exim-users Αντικείμενο: Re: [exim] Extracting address from a From header
On 8/19/2016 5:52 AM, Mike Brudenell wrote: > I think I've got a workaround by using *sg* to look for the final <…> (if
> there is one) in the value of $h_from: and stripping off everything before
> it:
>
> ${domain:${sg {$h_from:} {^.*<([^<]*)> *\$} {\$1}}}
I agree sg is the right approach. You can't really depend on anything
being per spec.
I didn't understand the purpose of the fragment '[^<]' in your pattern.
Possibly I just haven't written enough regex for exim.
I would tend to write something like
${sg {$h_from:} {^\N(.*)?\<(.*)?\>$\N} {[D1]\$1[D2]\$2}}'
This makes use of patterned substitution strings to allow for easier
parsing of the actual case, and \N to avoid expansions.