Dominic Raferd: > On Thu, 16 Jan 2020 at 14:34, Wietse Venema <wie...@porcupine.org> wrote: > > > Dominic Raferd: > > > Thanks Christian that was very helpful. I have it working now for > > > postscreen and I think (but am waiting for an incoming instance) for > > > smtpd. Weird > > > that they have such different approaches (postscreen_dnsbl_reply_map and > > > rbl_reply_maps). And I could not find a way to use pcre with > > rbl_reply_maps > > > because it throws a warning if I reference any variables such as > > $rbl_code > > > - but such variables do seem to work in a hash file. > > > > Use $$name instead of $name. > > > > As documented: > > > > TEXT SUBSTITUTION > > Substitution of substrings (text that matches patterns inside > > "()") > > from the matched expression into the result string is requested > > with > > $1, $2, etc.; specify $$ to produce a $ character as output. > > The > > macros in the result string may need to be written as ${n} or > > $(n) if > > they aren't followed by whitespace. > > > > Thanks Wietse. I had read that but I interpreted the text 'specify $$ to > produce a $ character as output' as meaning that $$ would produce a > hard-coded dollar sign, not a sign that could then be re-interpreted as the > start of a variable. Perhaps the text could clarify this?
Oh ye of little faith. You can test my suggestion with the postmap command. postmap -q 'search strinng here' pcre:/path/to/file Wietse