From: Victor Duchovni on
On Wed, Jun 23, 2010 at 12:40:30PM -0400, Phil Howard wrote:

> >> How would I do this for smtpd_recipient_restrictions?
> >
> >
> > That question makes no sense. ?Rephrase.
>
> I was looking for a general solution. I picked an example. But I
> apparently picked a bad example because the solution seems to be
> example specific. I guess I better not pick examples, anymore.
>
> How do I get contents inserted into the main.cf file from another
> file, IN GENERAL, without having to rebuild main.cf and do a reload
> every time?

To update the main.cf file, update the main.cf file. Its contents
are cached, so to effect changes in parameters used by long-running
services, you must reload. Most Postfix services (i.e. delivery
agents and inet services) restart automatically after processing
a ~100 requests, and reloads are not generally needed for parameters
that touch these services.

The only dynamic component of Postfix configuration is lookup tables,
for rewriting, and domain lists, ...

--
Viktor.

From: Phil Howard on
On Wed, Jun 23, 2010 at 12:44, Noel Jones <njones(a)megan.vbhcs.org> wrote:

> There is no "include" syntax for main.cf itself.
>
> You can use a Makefile to build a main.cf from proto files, or use "postconf
> -e ..."  for program-controlled editing of main.cf.

You'd still have to make it reload for rebuilding the whole file. I
was hoping there was something that it would understand as dynamic.
But I guess lookup maps are the only way to do that. At least that's
all I see so far in the docs.

From: Phil Howard on
On Wed, Jun 23, 2010 at 12:46, Victor Duchovni
<Victor.Duchovni(a)morganstanley.com> wrote:

> Most Postfix services (i.e. delivery
> agents and inet services) restart automatically after processing
> a ~100 requests, and reloads are not generally needed for parameters
> that touch these services.

Hmmm. Maybe that explains some odd behaviour I've seen in the past
and not been able to reproduce. I have moved new versions of main.cf
and/or master.cf into place in preparation of reload or restart or
reboot, but didn't do that for an hour or so (to let users know).
Maybe parts of Postfix did that, and there was some inconsistency
between different parts.

From: Ralf Hildebrandt on
* Phil Howard <ttiphil(a)gmail.com>:

> Been trying to figure that out. I'm wanting to use CDB. But it
> wasn'tfile.out taking it. I guess what I need to do is give each domain a
> dummy value.

awk '{printf("%s OK\n",$1)}' file > file.out
postmap file.out

--
Ralf Hildebrandt
Geschäftsbereich IT | Abteilung Netzwerk
Charité - Universitätsmedizin Berlin
Campus Benjamin Franklin
Hindenburgdamm 30 | D-12203 Berlin
Tel. +49 30 450 570 155 | Fax: +49 30 450 570 962
ralf.hildebrandt(a)charite.de | http://www.charite.de