On 14/01/2020 19:39, Wietse Venema wrote: >>> unsigned long *pf3) >>> { >>> if (set_macro_list) { >>> if (verbose) >>> printf("set symbol list %s to \"%s\"\n", >>> macro_states[set_macro_state], set_macro_list); >>> smfi_setsymlist(ctx, set_macro_state, set_macro_list); >>> ... >>> } >> >> the call to smfi_setsymlist is guarded by the flag set_macro_list. This >> flag is enabled with the -M command-line option. However, that option is >> never used, as far as I can see. Therefore, the code path is not taken. > > To 'use' the -M command-line option: > > $ make test-milter > $ ./test-milter -m state -M macros ... > > Where state is one of connect, helo, mail. etc. > Where macros is a list of macros. Example: "{rcpt_mailer} {rcpt_host}".
Thank you, Wietse. test-milter confirms that smfi_setsymlist does not work: $ test-milter -v -p inet:3000@localhost -m connect -M '{client_connections}' set symbol list connect to "{client_connections}" negotiate f0=1ff *pf0 = 1ff f1=1fffff *pf1=400 nosend=0 noreply=0 misc=0 test_connect localhost AF_INET (127.0.0.1:0) macro: j="mail.my.org" macro: v="Postfix 3.3.0" macro: {daemon_addr}="127.0.0.1" macro: {daemon_name}="mail.my.org" test_reply 0 The {client_connections} macro is not available in connect, even though it was requested. It is a great pity if we cannot use smfi_setsymlist with Postfix, it is such a useful (and obviously underappreciated) little API.