Commenting multi line option

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Commenting multi line option

durwin
I would like to know if comments may be used in this fashion.  In the example below, will the last line 'permit' be seen as part of the 'smtpd_helo_restrictions' option?

smtpd_helo_restrictions =
        permit_mynetworks
        #   check_helo_access hash:/etc/postfix/helo_access
        #   reject_invalid_helo_hostname
        #   reject_unknown_helo_hostname
        permit




This email message and any attachments are for the sole use of the intended recipient(s) and may contain proprietary and/or confidential information which may be privileged or otherwise protected from disclosure. Any unauthorized review, use, disclosure or distribution is prohibited. If you are not the intended recipient(s), please contact the sender by reply email and destroy the original message and any copies of the message as well as any attachments to the original message.
Reply | Threaded
Open this post in threaded view
|

Re: Commenting multi line option

Christian Kivalo


On July 23, 2018 5:00:33 PM GMT+02:00, [hidden email] wrote:

>I would like to know if comments may be used in this fashion.  In the
>example below, will the last line 'permit' be seen as part of the
>'smtpd_helo_restrictions' option?
>
>smtpd_helo_restrictions =
>        permit_mynetworks
>        #   check_helo_access hash:/etc/postfix/helo_access
>        #   reject_invalid_helo_hostname
>        #   reject_unknown_helo_hostname
>        permit
>
Yes, permit will be seen as part of smtpd_helo_restrictions in this example.

For an explanation of the main.cf file format see http://www.postfix.org/postconf.5.HTML
--
Christian Kivalo
Reply | Threaded
Open this post in threaded view
|

Re: Commenting multi line option

Dominic Raferd
In reply to this post by durwin


On Mon, 23 Jul 2018 at 16:02, <[hidden email]> wrote:
I would like to know if comments may be used in this fashion.  In the example below, will the last line 'permit' be seen as part of the 'smtpd_helo_restrictions' option?

​​
smtpd_helo_restrictions =

        permit_mynetworks
        #  
​​
check_helo_access hash:/etc/postfix/helo_access

        #   reject_invalid_helo_hostname
        #   reject_unknown_helo_hostname
        permit

​Yes, and even blank (empty) lines are ok within restriction lists, as long as the next non-blank non-comment line is also indented​. Comment lines do not have to be indented within lists (although clarity may be lost by failing to do so). But you should not append comments to an active line.

smtpd_helo_restrictions =
 
        permit_mynetworks # this comment may cause problems
        ​
check_helo_access hash:/etc/postfix/helo_access
 
        reject_invalid_helo_hostname 
#... this comment is fine though...
        permit

BTW, the final 'permit' is not needed as it is implicit (but I tend to put it in anyway as a reminder to self). 
Reply | Threaded
Open this post in threaded view
|

Re: Commenting multi line option

durwin
Thank you both.

[hidden email] wrote on 07/23/2018 09:29:58 AM:

> From: Dominic Raferd <[hidden email]>

> To: Postfix users <[hidden email]>
> Date: 07/23/2018 09:31 AM
> Subject: Re: Commenting multi line option
> Sent by: [hidden email]
>
> On Mon, 23 Jul 2018 at 16:02, <[hidden email]> wrote:

> I would like to know if comments may be used in this fashion.  In
> the example below, will the last line 'permit' be seen as part of
> the 'smtpd_helo_restrictions' option?
>
> ​​smtpd_helo_restrictions =
>         permit_mynetworks
>         #   ​​check_helo_access hash:/etc/postfix/helo_access
>         #   reject_invalid_helo_hostname
>         #   reject_unknown_helo_hostname
>         permit

>
> ​Yes, and even blank (empty) lines are ok within restriction lists,
> as long as the next non-blank non-comment line is also
> indented​. Comment lines do not have to be indented within lists
> (although clarity may be lost by failing to do so). But you should
> not append comments to an active line.

>
> ​smtpd_helo_restrictions = 

>         permit_mynetworks # this comment may cause problems
>         ​check_helo_access hash:/etc/postfix/helo_access 
>         reject_invalid_helo_hostname 
> #... this comment is fine though...

>         permit
>
> BTW, the final 'permit' is not needed as it is implicit (but I tend
> to put it in anyway as a reminder to self). 



This email message and any attachments are for the sole use of the intended recipient(s) and may contain proprietary and/or confidential information which may be privileged or otherwise protected from disclosure. Any unauthorized review, use, disclosure or distribution is prohibited. If you are not the intended recipient(s), please contact the sender by reply email and destroy the original message and any copies of the message as well as any attachments to the original message.