Discussion:
Allow comments after an entry in conf and map files
(too old to reply)
Tom Browder
2016-03-22 12:52:48 UTC
Permalink
I would love to be able to use comments on the same line as conf and map
file entries. That has probably been requested before, but is it a
definite WILL NOT?

Best regards,

-Tom
Wietse Venema
2016-03-22 15:56:30 UTC
Permalink
Post by Tom Browder
I would love to be able to use comments on the same line as conf and map
file entries. That has probably been requested before, but is it a
definite WILL NOT?
Definitely. That would require some kind of quoting mechanism to
indicate which "#" are part of the data which "#" are not, and that
quoting mechanism would break compatibility with existing configurations.

Just saying that # after space is always a comment is incorrect. Email
addresses among other things may contain spaces.

Wietse
Tom Browder
2016-03-22 16:56:43 UTC
Permalink
Post by Wietse Venema
Post by Tom Browder
I would love to be able to use comments on the same line as conf and map
file entries. That has probably been requested before, but is it a
definite WILL NOT?
Definitely. That would require some kind of quoting mechanism to
indicate which "#" are part of the data which "#" are not, and that
quoting mechanism would break compatibility with existing configurations.
Okay, after reviewing the wide latitude for e-mail addresses I understand.

But, couldn't there be a user option to build Postfix to allow such
(or maybe define some special comment character or characters such as
the common '//' or '--')? It shouldn't change the default behavior
and wouldn't disturb other installations.

Best,

-Tom
Wietse Venema
2016-03-22 18:38:50 UTC
Permalink
Post by Tom Browder
Post by Wietse Venema
Post by Tom Browder
I would love to be able to use comments on the same line as conf and map
file entries. That has probably been requested before, but is it a
definite WILL NOT?
Definitely. That would require some kind of quoting mechanism to
indicate which "#" are part of the data which "#" are not, and that
quoting mechanism would break compatibility with existing configurations.
Okay, after reviewing the wide latitude for e-mail addresses I understand.
But, couldn't there be a user option to build Postfix to allow such
(or maybe define some special comment character or characters such as
the common '//' or '--')? It shouldn't change the default behavior
and wouldn't disturb other installations.
In practice, the only comment character that makes sense in as
Postfix file is the "#"; anything else will just confuse the hell
out of people. So there would need to be a way to turn on/off
trailing comments for an individual file. That would require some
kind of modeline support (a line with special sequences that change
how the file will be processed).

/etc/postfix/main.cf:
# This modeline is needed otherwise trailing comments won't work
# in main.cf (chicken and egg problem).
# postfix: trailing_comments=yes

trailing_comments = yes # Global default

/some/other/file:
# This file contains # in the data.
# Override the "trailing_comments = yes" setting in main.cf.
# postfix: trailing_comments=no

stuff that contains a # character

Is this really easier to use? That is not obvious to me.

Modeline support will break compatibility with every existing
configuration that has lines starting with "# postfix:".

Making "trailing_comments = yes" the built-in default will break
compatibility with every existing configuration that has # in the
data.

Wietse
Tom Browder
2016-03-22 19:03:40 UTC
Permalink
...
Post by Wietse Venema
Post by Tom Browder
But, couldn't there be a user option to build Postfix to allow such
(or maybe define some special comment character or characters such as
the common '//' or '--')? It shouldn't change the default behavior
and wouldn't disturb other installations.
In practice, the only comment character that makes sense in as
Postfix file is the "#"; anything else will just confuse the hell
out of people. So there would need to be a way to turn on/off
trailing comments for an individual file. That would require some
kind of modeline support (a line with special sequences that change
how the file will be processed).
# This modeline is needed otherwise trailing comments won't work
# in main.cf (chicken and egg problem).
# postfix: trailing_comments=yes
trailing_comments = yes # Global default
...
Post by Wietse Venema
Is this really easier to use? That is not obvious to me.
I agree, but I was think of a non-default build config define for CCARGS, say,
'-DALLOW_TRAILING_COMMENTS', so that all files read by postfix would
always have trailing comments stripped before the rest of the line is
processed. No one outside the using would be bothered by mode lines
or anything else, it would just work. If the ALLOW_TRAILING_COMMENTS
were used perhaps a warning could be issued upon postfix start.

Thanks.

-Tom

P.S. BTW, is the postcard address in AAAREADME still correct with your new job?
Wietse Venema
2016-03-22 19:23:33 UTC
Permalink
Wietse:
[modeline support to turn on/off #comment support]
Post by Tom Browder
I agree, but I was think of a non-default build config define for CCARGS, say,
'-DALLOW_TRAILING_COMMENTS', so that all files read by postfix would
always have trailing comments stripped before the rest of the line is
processed. No one outside the using would be bothered by mode lines
or anything else, it would just work. If the ALLOW_TRAILING_COMMENTS
were used perhaps a warning could be issued upon postfix start.
The next person to inherit your configuration will hate you.
Post by Tom Browder
P.S. BTW, is the postcard address in AAAREADME still correct with your new job?
No. It shows that it is a bad idea to put a mailing address in software
that is going to last for a long time.

Wietse
Tom Browder
2016-03-22 19:28:54 UTC
Permalink
Post by Wietse Venema
[modeline support to turn on/off #comment support]
Post by Tom Browder
I agree, but I was think of a non-default build config define for CCARGS, say,
'-DALLOW_TRAILING_COMMENTS', so that all files read by postfix would
always have trailing comments stripped before the rest of the line is
processed. No one outside the using would be bothered by mode lines
or anything else, it would just work. If the ALLOW_TRAILING_COMMENTS
were used perhaps a warning could be issued upon postfix start.
The next person to inherit your configuration will hate you.
I'm willing to take that risk!

Thanks.

Best,

-Tom

Loading...