[Dovecot] Override master service settigs with spaces
I'd like to override one setting for a master service in conf.d/10-master.conf. Unfortunately, said setting contains spaces, and I do not know how to escape them properly.
Here's what I've tried so far. (Note: This is just the easiest/silliest test case I could come up with; not the actual setting or service I want to overwrite.)
conf.d/10-master.conf: service quota-status { executable = quota-status -p postfix -o plugin/quota_status_success=Testing 1 2 3 inet_listener { port = 12340 } }
Reaction: $ printf "recipient=test@example.org\nsize=0\n\n" | nc 127.0.0.1 12340 action=Testing
conf.d/10-master.conf: service quota-status { executable = quota-status -p postfix -o "plugin/quota_status_success=Testing 1 2 3" inet_listener { port = 12340 } }
Reaction: $ printf "recipient=test@example.org\nsize=0\n\n" | nc 127.0.0.1 12340 action=DUNNO [<-- This is the default setting]
conf.d/10-master.conf: service quota-status { executable = quota-status -p postfix -o 'plugin/quota_status_success=Testing 1 2 3' inet_listener { port = 12340 } }
Reaction: $ printf "recipient=test@example.org\nsize=0\n\n" | nc 127.0.0.1 12340 action=DUNNO [<-- This is the default setting]
conf.d/10-master.conf: service quota-status { executable = quota-status -p postfix -o plugin/quota_status_success="Testing 1 2 3" inet_listener { port = 12340 } }
Reaction: $ printf "recipient=test@example.org\nsize=0\n\n" | nc 127.0.0.1 12340 action="Testing [<-- Note the " after = ]
conf.d/10-master.conf: service quota-status { executable = quota-status -p postfix -o plugin/quota_status_success=Testing\ 1\ 2\ 3 inet_listener { port = 12340 } }
Reaction: $ printf "recipient=test@example.org\nsize=0\n\n" | nc 127.0.0.1 12340 action=Testing\ [<-- Note the \ ]
I'm out of ideas now. What's the correct way to quote / escape these options?
Le 7 août 2013 à 18:03, Ulrich Zehl a écrit :
I'd like to override one setting for a master service in conf.d/10-master.conf. Unfortunately, said setting contains spaces, and I do not know how to escape them properly.
Here's what I've tried so far. (Note: This is just the easiest/silliest test case I could come up with; not the actual setting or service I want to overwrite.)
[...]
I'm out of ideas now. What's the correct way to quote / escape these options?
Hello Ulrich,
What makes you think quota-status would accept a -o option? And what's that "quota_status_success" plugin supposed to do? Just curious (probably ill-informed), Axel
On Wed, Aug 07, 2013 at 10:49:28PM +0200, Axel Luttgens wrote:
What makes you think quota-status would accept a -o option?
Every service running under master accepts -o, as far as I can tell from the code. (Additionally verified by my tests; for settings without spaces it works well.)
And what's that "quota_status_success" plugin supposed to do?
It's just a setting that you'd normally set in conf.d/90-quota.conf (or similar) like this:
plugin { quota_status_success = DUNNO }
It tells quota-status what action to return to Postfix when the message will fit into quota, just like quota_status_overquota (and quota_status_toolarge since 2.2.5) do for messages that will not fit.
Le 8 août 2013 à 09:10, Ulrich Zehl a écrit :
On Wed, Aug 07, 2013 at 10:49:28PM +0200, Axel Luttgens wrote:
What makes you think quota-status would accept a -o option?
Every service running under master accepts -o, as far as I can tell from the code. (Additionally verified by my tests; for settings without spaces it works well.)
Hello Ulrich,
Sorry for the noise. I guess I was terribly tired yesterday, since I just didn't manage to understand what you were trying...
Axel
On 7.8.2013, at 19.03, Ulrich Zehl ulrich-dovecot@topfen.net wrote:
I'd like to override one setting for a master service in conf.d/10-master.conf. Unfortunately, said setting contains spaces, and I do not know how to escape them properly.
There is no support for escaping currently.
executable = quota-status -p postfix -o "plugin/quota_status_success=Testing 1 2 3"
Maybe this should work.. But for now you can just write a wrapper script.
participants (3)
-
Axel Luttgens
-
Timo Sirainen
-
Ulrich Zehl