On Thu, Dec 20, 2012 at 01:39:07PM -0500, Simon Brereton wrote:

> >> >         To check that the result of the expansion of the user via
> >> >         $virtual_alias_maps.
> >>
> >> Here I ran into problems.
> >> mail:/etc/postfix# postmap -fq newu...@example.org $maps
> >> postmap: fatal: usage: postmap [-Nfinoprsvw] [-c config_dir] [-d key]
> >> [-q key] [map_type:]file...
> >>  postfix/postmap[31144]: fatal: usage: postmap [-Nfinoprsvw] [-c
> >> config_dir] [-d key] [-q key] [map_type:]file...
> >
> > I'm disappointed you could not then figure it out by reading the manpage,
> > or parsing the "usage:" message.
> >
> >         postmap -q key map [optionally more maps]
> 
> That disappointment is hard to bear, but not unexpected sadly.  I've
> had another look and I still don't get it.  Except that $maps can't be
> expanded by the shell.  

Of course it can be expanded by the shell, it is a shell variable
after all.

        $ maps="...."
        $ postmap -fq key $maps

If it were not for the possibility of unexpanded "${parameter}" values
in "postconf -h" output you could write:

        $ maps=$(postconf -h virtual_alias_maps)
        $ postmap -fq key $maps

I've not looked too closely at what it would take for "postconf"
to be able to perform fully recursive parameter expansion. It is
apparently a bit tricky (from past conversations with Wietse). It
would be useful however.

-- 
        Viktor.

Reply via email to