On 09/19/2016 12:50 AM, Wietse Venema wrote:
> John Fawcett:
>>> Care to post a patch for src/global/dict_mysql.c? Do you
>>> think that the "prog_name" should be configurable? Perhaps
>>> allowing different Postfix instances to run with different
>>> settings? Or would a fixed name like "postfix" be better?
>>>
>> ok I can do that. I would go for a fixed name. It seems to
> Please also update proto/mysql_table?
>
> I apologize for still having to adopt in your patch for stored
> procedures. It will happen.
>
> Wietse
Looking into it further, most of the code was already there and the
fix is a simple one liner + documentation updates.
In this fix I have not used a hard coded group of [postfix] as I had
imagined above, but followed the way that dovecot is doing this.
The default group is hard coded as [client] so that the default behaviour
is to read only the [client] group. The default group can always be
changed by specifying the option_group parameter, in which case
both [client] and the specified group are read.
By the way there is no rush from me to get the stored procedure code in.
Apologies if I missed it, but I was expecting more feedback about other
people's testing (at least from the original requestor) before it went into
a release.
John
diff -ur postfix-3.2-20160917-orig/src/global/dict_mysql.c
postfix-3.2-20160917/src/global/dict_mysql.c
--- postfix-3.2-20160917-orig/src/global/dict_mysql.c 2016-06-26
02:57:43.000000000 +0200
+++ postfix-3.2-20160917/src/global/dict_mysql.c 2016-09-24
13:02:32.181654753 +0200
@@ -634,7 +634,7 @@
dict_mysql->dbname = cfg_get_str(p, "dbname", "", 1, 0);
dict_mysql->result_format = cfg_get_str(p, "result_format", "%s",
1, 0);
dict_mysql->option_file = cfg_get_str(p, "option_file", NULL, 0, 0);
- dict_mysql->option_group = cfg_get_str(p, "option_group", NULL, 0, 0);
+ dict_mysql->option_group = cfg_get_str(p, "option_group", "client",
0, 0);
#if defined(MYSQL_VERSION_ID) && MYSQL_VERSION_ID >= 40000
dict_mysql->tls_key_file = cfg_get_str(p, "tls_key_file", NULL, 0, 0);
dict_mysql->tls_cert_file = cfg_get_str(p, "tls_cert_file", NULL,
0, 0);
--- postfix-3.2-20160917-orig/proto/mysql_table 2016-02-12
21:25:01.000000000 +0100
+++ postfix-3.2-20160917/proto/mysql_table 2016-09-24
13:11:11.219154090 +0200
@@ -246,11 +246,16 @@
# values.
# .IP "\fBoption_file\fR"
# Read options from the given file instead of the default my.cnf
-# location.
+# location. When reading from the default configuration file
+# options are read from the [client] group and optionally
+# the group pecified by the option_group parameter.
# .sp
# This parameter is available with Postfix 2.11 and later.
# .IP "\fBoption_group\fR"
-# Read options from the given group.
+# Read options from the given group of the mysql options file.
+# Note that the [client] group is always read. If this
+# parameter is specified then the [client] group is read
+# followed by the specified group.
# .sp
# This parameter is available with Postfix 2.11 and later.
# .IP "\fBtls_cert_file\fR"