Using -o smtpd_end_of_data_restrictions=check_policy_service unix:private/policy not working in master.cf

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

Using -o smtpd_end_of_data_restrictions=check_policy_service unix:private/policy not working in master.cf

Harakiri
I can use

smtpd_end_of_data_restrictions=check_policy_service unix:private/policy

just fine in the main.cf. However this has the drawback that i need to
add

-o smtpd_end_of_data_restrictions=

to each filter in the master.cf which should not use the policy service again.

When i try to only set the policy service once for the SMTP entry i.e.

:smtp   inet    n       -       n       -       10       smtpd
-o content_filter=smgw:[127.0.0.1]:10025
-o smtpd_end_of_data_restrictions=check_policy_service unix:private/policy

postfix complains about an invalid syntax (probably due the space between policy server and unix:private/policy)

postfix/smtpd[808]: fatal: unexpected command-line argument: unix:private/policy

Why can i reset the mtpd_end_of_data_restrictions in the master.cf - but not set them?


     
Reply | Threaded
Open this post in threaded view
|

Re: Using -o smtpd_end_of_data_restrictions=check_policy_service unix:private/policy not working in master.cf

Michael Tokarev
Harakiri wrote:

> I can use
>
> smtpd_end_of_data_restrictions=check_policy_service unix:private/policy
>
> just fine in the main.cf. However this has the drawback that i need to
> add
>
> -o smtpd_end_of_data_restrictions=
>
> to each filter in the master.cf which should not use the policy service again.
>
> When i try to only set the policy service once for the SMTP entry i.e.
>
> :smtp   inet    n       -       n       -       10       smtpd
> -o content_filter=smgw:[127.0.0.1]:10025
> -o smtpd_end_of_data_restrictions=check_policy_service unix:private/policy
>
> postfix complains about an invalid syntax (probably due the space between policy server and unix:private/policy)

Try using a comma instead of a space there:

 -o smtpd_end_of_data_restrictions=check_policy_service,unix:private/policy

it works due to the way config parser is implemented, it's ugly, but
it works ;)

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

Re: Using -o smtpd_end_of_data_restrictions=check_policy_service unix:private/policy not working in master.cf bugfix?

Harakiri


--- On Wed, 5/19/10, Michael Tokarev <[hidden email]> wrote:

> From: Michael Tokarev <[hidden email]>
> Subject: Re: Using -o
> > postfix complains about an invalid syntax (probably
> due the space between policy server and
> unix:private/policy)
>
> Try using a comma instead of a space there:
>
>  -o
> smtpd_end_of_data_restrictions=check_policy_service,unix:private/policy
>
> it works due to the way config parser is implemented, it's
> ugly, but
> it works ;)

Great thank you, still looks like this bug should be fixed in later versions.



     
Reply | Threaded
Open this post in threaded view
|

Re: Using -o smtpd_end_of_data_restrictions=check_policy_service unix:private/policy not working in master.cf bugfix?

Noel Jones-2
On 5/20/2010 5:32 AM, Harakiri wrote:

>
>
> --- On Wed, 5/19/10, Michael Tokarev<[hidden email]>  wrote:
>
>> From: Michael Tokarev<[hidden email]>
>> Subject: Re: Using -o
>>> postfix complains about an invalid syntax (probably
>> due the space between policy server and
>> unix:private/policy)
>>
>> Try using a comma instead of a space there:
>>
>>   -o
>> smtpd_end_of_data_restrictions=check_policy_service,unix:private/policy
>>
>> it works due to the way config parser is implemented, it's
>> ugly, but
>> it works ;)
>
> Great thank you, still looks like this bug should be fixed in later versions.


This is not a bug; it's documented behavior.  Changing this
behavior would require a major rewrite of the config parser
and likely require other existing documented behavior to
change in incompatible ways -- such as a completely new config
syntax.

   -- Noel Jones
Reply | Threaded
Open this post in threaded view
|

Re: Using -o smtpd_end_of_data_restrictions=check_policy_service unix:private/policy not working in master.cf bugfix?

d.hill
In reply to this post by Harakiri
Quoting Harakiri <[hidden email]>:

>
>
> --- On Wed, 5/19/10, Michael Tokarev <[hidden email]> wrote:
>
>> From: Michael Tokarev <[hidden email]>
>> Subject: Re: Using -o
>> > postfix complains about an invalid syntax (probably
>> due the space between policy server and
>> unix:private/policy)
>>
>> Try using a comma instead of a space there:
>>
>>  -o
>> smtpd_end_of_data_restrictions=check_policy_service,unix:private/policy
>>
>> it works due to the way config parser is implemented, it's
>> ugly, but
>> it works ;)
>
> Great thank you, still looks like this bug should be fixed in later versions.

 From the man page for master.cf (http://www.postfix.org/master.5.html):

      ...
      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     $over-
      ride_parameter set in main.cf.
      ...

In other words, you could define this somewhere in main.cf:

...
$my_policy = check_policy_service unix:private/policy
...

Then in master.cf:

...
-o smtpd_end_of_data_restrictions=$my_policy
...