Discussion:
spaces when using "-o" in master.cf
(too old to reply)
Tomas Macek
2012-12-03 13:42:54 UTC
Permalink
I have line like this

smtpd_client_restrictions = check_policy_service inet:127.0.0.1:24575, ...

in my main.cf

I would like the $smtpd_client_restrictions to override in master.cf,
something like:

submission inet n - n - - smtpd
-o smtpd_client_restrictions=check_policy_service
inet:127.0.0.1:24575

but the space between "check_policy_service" and "inet" is a problem.

How can I write this (if it's possible generally)? I know, that the doc
says, the spaces are not allowed but maybe there is a way...

Regards, Tomas
Reindl Harald
2012-12-03 13:55:06 UTC
Permalink
Post by Tomas Macek
I have line like this
smtpd_client_restrictions = check_policy_service inet:127.0.0.1:24575, ...
in my main.cf
submission inet n - n - - smtpd
-o smtpd_client_restrictions=check_policy_service inet:127.0.0.1:24575
but the space between "check_policy_service" and "inet" is a problem.
How can I write this (if it's possible generally)? I know, that the doc says, the spaces are not allowed but maybe
there is a way...
main.cf
whatever_smtpd_client_restrictions = check_policy_service inet:127.0.0.1:24575

master.cf:
-o smtpd_client_restrictions=$whatever_smtpd_client_restrictions
Tomas Macek
2012-12-03 13:59:27 UTC
Permalink
Post by Tomas Macek
Post by Tomas Macek
I have line like this
smtpd_client_restrictions = check_policy_service inet:127.0.0.1:24575, ...
in my main.cf
submission inet n - n - - smtpd
-o smtpd_client_restrictions=check_policy_service inet:127.0.0.1:24575
but the space between "check_policy_service" and "inet" is a problem.
How can I write this (if it's possible generally)? I know, that the doc says, the spaces are not allowed but maybe
there is a way...
main.cf
whatever_smtpd_client_restrictions = check_policy_service inet:127.0.0.1:24575
-o smtpd_client_restrictions=$whatever_smtpd_client_restrictions
Thanks, this seems to be also the solution.

But according to the http://marc.info/?l=postfix-users&m=108075412814545
(found after really long time) the "," (comma) did the job:

-o smtpd_client_restrictions=check_policy_service,inet:127.0.0.1:24575

How this can work?? :-o

Tomas
Stan Hoeppner
2012-12-03 14:19:59 UTC
Permalink
Post by Tomas Macek
I have line like this
smtpd_client_restrictions = check_policy_service inet:127.0.0.1:24575, ...
in my main.cf
I would like the $smtpd_client_restrictions to override in master.cf,
submission inet n - n - - smtpd
-o smtpd_client_restrictions=check_policy_service inet:127.0.0.1:24575
You override by NOT including it in the "-o" list. Here you are
explicitly telling the submission service to execute this policy server.
Is this really what you want? Or are you trying to exclude this policy
server from submission? Note in my example there were BLANK lines after
"=" which excludes everything for the restriction class.

submission inet n - n - - smtpd
-o smtpd_client_restrictions=

means do not execute any client restrictions in the submission service.
Only list a restriction here if you DO want it to execute.
--
Stan
Noel Jones
2012-12-03 15:04:50 UTC
Permalink
Post by Tomas Macek
Post by Tomas Macek
Post by Tomas Macek
I have line like this
smtpd_client_restrictions = check_policy_service
inet:127.0.0.1:24575, ...
in my main.cf
I would like the $smtpd_client_restrictions to override in
submission inet n - n - - smtpd
-o smtpd_client_restrictions=check_policy_service
inet:127.0.0.1:24575
but the space between "check_policy_service" and "inet" is a
problem.
How can I write this (if it's possible generally)? I know, that
the doc says, the spaces are not allowed but maybe
there is a way...
main.cf
whatever_smtpd_client_restrictions = check_policy_service
inet:127.0.0.1:24575
-o smtpd_client_restrictions=$whatever_smtpd_client_restrictions
Thanks, this seems to be also the solution.
But according to the
http://marc.info/?l=postfix-users&m=108075412814545 (found after
-o smtpd_client_restrictions=check_policy_service,inet:127.0.0.1:24575
How this can work?? :-o
A comma is treated as whitespace by the postfix option parser. This
is a safe workaround for master.cf options. I'm certain this is
documented somewhere, but I don't see it right now...

If you have a long list of options, it's easier & cleaner to define
them in main.cf as suggested by Reindl, but either method is equally
valid.



-- Noel Jones
Wietse Venema
2012-12-03 18:51:06 UTC
Permalink
Post by Tomas Macek
main.cf
whatever_smtpd_client_restrictions = check_policy_service inet:127.0.0.1:24575
-o smtpd_client_restrictions=$whatever_smtpd_client_restrictions
This is the recommended solution. It is mentioned in the master(5)
manpage, but the text is somewhat obscure. I have made the text
more explicit.

OLD: NOTE 1: do not specify whitespace around the "=". In
parameter values, either avoid whitespace altogether, use
commas instead of spaces, or consider overrides like "-o
name=$override_parameter" with $override_parameter set in
main.cf.

NEW: NOTE 1: do not specify whitespace around the "=" or in
parameter values. To specify a parameter value that con-
tains whitespace, use commas instead of spaces, or spec-
ify the value in main.cf. Example:

/etc/postfix/master.cf:
submission inet .... smtpd
-o smtpd_mumble=$submission_mumble

/etc/postfix/main.cf
submission_mumble = text with whitespace...

Postfix 2.9 and later will check that a user-defined $name in
master.cf has a definition in main.cf. It will log a warning if the
definition is missing (or mis-typed).

Wietse
mouss
2012-12-03 21:08:11 UTC
Permalink
Post by Tomas Macek
Post by Tomas Macek
Post by Tomas Macek
I have line like this
smtpd_client_restrictions = check_policy_service
inet:127.0.0.1:24575, ...
in my main.cf
I would like the $smtpd_client_restrictions to override in
submission inet n - n - - smtpd
-o smtpd_client_restrictions=check_policy_service
inet:127.0.0.1:24575
but the space between "check_policy_service" and "inet" is a problem.
How can I write this (if it's possible generally)? I know, that the
doc says, the spaces are not allowed but maybe
there is a way...
main.cf
whatever_smtpd_client_restrictions = check_policy_service
inet:127.0.0.1:24575
-o smtpd_client_restrictions=$whatever_smtpd_client_restrictions
Thanks, this seems to be also the solution.
it's not "also". it's "the".
Post by Tomas Macek
But according to the
http://marc.info/?l=postfix-users&m=108075412814545 (found after
-o smtpd_client_restrictions=check_policy_service,inet:127.0.0.1:24575
How this can work?? :-o
',' is a separator. so that works, but it is obscure. avoid it.

Continue reading on narkive:
Loading...