Warning: unused parameter

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

Warning: unused parameter

Michael Tokarev
These warnings started showing up after an upgrade
of our servers to version 2.9+.

We've several smtpd instances in master.cf, each
with its own set of restrictions.  In order to
simplify managing of these, we split the them into
a set of separate restrictions, using this technique:

master.cf:

 intaddr:smtp ... smtpd -o smtpd_role=int
 extaddr:smtp ... smtpd -o smtpd_role=ext
 ...

master.cf:

 smtpd_recipient_restrictions = smtpd_${smtpd_role}_recipient_restrictions
 smtpd_int_recipient_restrictions = ...
 smtpd_ext_recipient_restrictions = ...

and so on.

Now, after upgrading to postfix 2.9, every postfix
tool issue this warning:

 postconf: warning: /etc/postfix/master.cf: unused parameter: smtpd_role=ext

which spams both logs and stderr output.

We've a few more "instances" of this technique,
which has been discussed/suggested in early 2000s
or even late 1990s on this list.

Is there maybe some parameter which lists all
such "unused" parameters, just to shut up this
warning coming from everywhere?

Thank you!

/mjt
Reply | Threaded
Open this post in threaded view
|

Re: Warning: unused parameter

Wietse Venema
Michael Tokarev:
[ Charset ISO-8859-1 unsupported, converting... ]

> These warnings started showing up after an upgrade
> of our servers to version 2.9+.
>
> We've several smtpd instances in master.cf, each
> with its own set of restrictions.  In order to
> simplify managing of these, we split the them into
> a set of separate restrictions, using this technique:
>
> master.cf:
>
>  intaddr:smtp ... smtpd -o smtpd_role=int
>  extaddr:smtp ... smtpd -o smtpd_role=ext
>  ...
>
> master.cf:
>
>  smtpd_recipient_restrictions = smtpd_${smtpd_role}_recipient_restrictions
>  smtpd_int_recipient_restrictions = ...
>  smtpd_ext_recipient_restrictions = ...
>
> and so on.
>
> Now, after upgrading to postfix 2.9, every postfix
> tool issue this warning:
>
>  postconf: warning: /etc/postfix/master.cf: unused parameter: smtpd_role=ext

This *will* complain if -o smtpd_role=int is not used in main.cf,
or if it is not used in the same master.cf line that defines
smtpd_role.

        Wietse

> which spams both logs and stderr output.
>
> We've a few more "instances" of this technique,
> which has been discussed/suggested in early 2000s
> or even late 1990s on this list.
>
> Is there maybe some parameter which lists all
> such "unused" parameters, just to shut up this
> warning coming from everywhere?
>
> Thank you!
>
> /mjt
>
Reply | Threaded
Open this post in threaded view
|

Re: Warning: unused parameter

Michael Tokarev
On 26.04.2012 14:59, Wietse Venema wrote:
> Michael Tokarev:

>> master.cf:
>>
>>  extaddr:smtp ... smtpd -o smtpd_role=ext
>>
>> master.cf:
>>
>>  smtpd_recipient_restrictions = smtpd_${smtpd_role}_recipient_restrictions
>>  smtpd_ext_recipient_restrictions = ...
>>
>>  postconf: warning: /etc/postfix/master.cf: unused parameter: smtpd_role=ext
>
> This *will* complain if -o smtpd_role=int is not used in main.cf,

or =ext.

> or if it is not used in the same master.cf line that defines
> smtpd_role.

Yes.  But it *is* used in main.cf:

  smtpd_recipient_restrictions = smtpd_${smtpd_role}_recipient_restrictions

Well.  I can set this parameter in main.cf explicitly:

  smtpd_role =

it will be overwritten by master.cf setting for a specific smtpd
instance, so all should be fine...  Is it what you mean?

> Wietse

Thanks,

/mjt
Reply | Threaded
Open this post in threaded view
|

Re: Warning: unused parameter

Wietse Venema
Michael Tokarev:
[ Charset ISO-8859-1 unsupported, converting... ]

> On 26.04.2012 14:59, Wietse Venema wrote:
> > Michael Tokarev:
>
> >> master.cf:
> >>
> >>  extaddr:smtp ... smtpd -o smtpd_role=ext
> >>
> >> master.cf:
> >>
> >>  smtpd_recipient_restrictions = smtpd_${smtpd_role}_recipient_restrictions
> >>  smtpd_ext_recipient_restrictions = ...
> >>
> >>  postconf: warning: /etc/postfix/master.cf: unused parameter: smtpd_role=ext
> >
> > This *will* complain if -o smtpd_role=int is not used in main.cf,
>
> or =ext.
>
> > or if it is not used in the same master.cf line that defines
> > smtpd_role.
>
> Yes.  But it *is* used in main.cf:
>
>   smtpd_recipient_restrictions = smtpd_${smtpd_role}_recipient_restrictions

Amazingly, defining a parameter in master.cf then using it in main.cf
was not covered by the 30 regression tests in the Makefile.

> Well.  I can set this parameter in main.cf explicitly:
>
>   smtpd_role =
>
> it will be overwritten by master.cf setting for a specific smtpd
> instance, so all should be fine...  Is it what you mean?

I'll add a regression test and fix.

        Wietse
Reply | Threaded
Open this post in threaded view
|

PATCH: Warning: unused parameter

Wietse Venema
Wietse Venema:

> Amazingly, defining a parameter in master.cf then using it in main.cf
> was not covered by the 30 regression tests in the Makefile.
>
> > Well.  I can set this parameter in main.cf explicitly:
> >
> >   smtpd_role =
> >
> > it will be overwritten by master.cf setting for a specific smtpd
> > instance, so all should be fine...  Is it what you mean?
>
> I'll add a regression test and fix.

The fix for Postfix 2.9 and 2.10 is at:

ftp://ftp.porcupine.org/mirrors/postfix-release/experimental/feature-patches/20120426-postconf-patch

My PGP signature is at:

ftp://ftp.porcupine.org/mirrors/postfix-release/experimental/feature-patches/20120426-postconf-patch.sig

        Wietse
Reply | Threaded
Open this post in threaded view
|

Re: PATCH: Warning: unused parameter

Wietse Venema
Wietse Venema:

> Wietse Venema:
> > Amazingly, defining a parameter in master.cf then using it in main.cf
> > was not covered by the 30 regression tests in the Makefile.
> >
> > > Well.  I can set this parameter in main.cf explicitly:
> > >
> > >   smtpd_role =
> > >
> > > it will be overwritten by master.cf setting for a specific smtpd
> > > instance, so all should be fine...  Is it what you mean?
> >
> > I'll add a regression test and fix.
>
> The fix for Postfix 2.9 and 2.10 is at:

Hang on, I need to some some further checking.

        Wietse
Reply | Threaded
Open this post in threaded view
|

Re: PATCH: Warning: unused parameter

Wietse Venema
Wietse Venema:
> Amazingly, defining a parameter in master.cf then using it in main.cf
> was not covered by the 30 regression tests in the Makefile.
...
> I'll add a regression test and fix.

Wietse:
> The fix for Postfix 2.9 and 2.10 is at:

Wietse:
> Hang on, I need to some some further checking.

It's ready. The fix for Postfix 2.9 and 2.10 is at:

ftp://ftp.porcupine.org/mirrors/postfix-release/experimental/feature-patches/20120426-postconf-patch

My PGP signature is at:

ftp://ftp.porcupine.org/mirrors/postfix-release/experimental/feature-patches/20120426-postconf-patch.sig

        Wietse