David B?rgin:
> Wietse,
> 
> On 14/01/2020 18:58, Wietse Venema wrote:
> > smfi_setsymlist() is called by test_negotiate():
> > 
> > static sfsistat test_negotiate(SMFICTX *ctx,
> >                                        unsigned long f0,
..
> >                                        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}".

Here is the code that sets set_macro_list:

        case 'm':
#if SMFI_VERSION > 5
            if (set_macro_state_arg) {
                fprintf(stderr, "too many -m options\n");
                exit(1);
            }
            set_macro_state_arg = optarg;
#else
            fprintf(stderr, "no libmilter support to specify macro list\n");
            exit(1);
#endif
            break;
        case 'M':
#if SMFI_VERSION > 5
            if (set_macro_list) {
                fprintf(stderr, "too many -M options\n");
                exit(1);
            }
            set_macro_list = optarg;
#else
            fprintf(stderr, "no libmilter support to specify macro list\n");
#endif
            break;

        Wietse

Reply via email to