Index: ossp-pkg/lmtp2nntp/lmtp2nntp_config.c RCS File: /v/ossp/cvs/ossp-pkg/lmtp2nntp/lmtp2nntp_config.c,v rcsdiff -q -kk '-r1.25' '-r1.26' -u '/v/ossp/cvs/ossp-pkg/lmtp2nntp/lmtp2nntp_config.c,v' 2>/dev/null --- lmtp2nntp_config.c 2002/01/31 14:20:09 1.25 +++ lmtp2nntp_config.c 2002/01/31 14:43:52 1.26 @@ -469,6 +469,33 @@ catch (ex) rethrow; + /* --mailfrom SINGLE */ + try { + char *cp; + + if ( (val_get(ctx->val, "option.mailfrom", &ov) != VAL_OK) + || (ov->ndata != 1) + || (ov->data.s == NULL) + ) throw(0,0,0); + log1(ctx, TRACE, "--mailfrom = \"%s\"", ov->data.s); + + ctx->option_mailfrom = strdup(ov->data.s); + /* protect ourselfs from the substitution of backreferences. + * Missing varargs would cause segfaults. Rewrite capturing + * brackets to clustering syntax. Use poor man's s///g + * simulator as current str library doesn't support global + * substitution */ + while (str_parse(ctx->option_mailfrom, "s/(.*?)\\((?!\\?:)(.*)/$1(?:$2/", &cp) > 0) { + free(ctx->option_mailfrom); + ctx->option_mailfrom = cp; + } + if (str_parse("<>", ctx->option_mailfrom) == -1) { + log1(ctx, ERROR, "option --mailfrom, illegal regex (%s)", ctx->option_mailfrom); + throw(0,0,0); + } + } + catch (ex) + rethrow; CUS: return; } Index: ossp-pkg/lmtp2nntp/lmtp2nntp_main.c RCS File: /v/ossp/cvs/ossp-pkg/lmtp2nntp/lmtp2nntp_main.c,v rcsdiff -q -kk '-r1.19' '-r1.20' -u '/v/ossp/cvs/ossp-pkg/lmtp2nntp/lmtp2nntp_main.c,v' 2>/dev/null --- lmtp2nntp_main.c 2002/01/31 14:20:09 1.19 +++ lmtp2nntp_main.c 2002/01/31 14:43:52 1.20 @@ -456,22 +456,6 @@ /* read in the arguments */ while ((i = getopt(argc, argv, "C:DKP:Va:b:c:d:g:h:l:m:n:o:r:s:t:u:v")) != -1) { switch (i) { - case 'm': /*POD [B<-m> I] */ - ctx->option_mailfrom = strdup(optarg); - /* protect ourselfs from the substitution of backreferences. - * Missing varargs would cause segfaults. Rewrite capturing - * brackets to clustering syntax. Use poor man's s///g - * simulator as current str library doesn't support global - * substitution */ - while (str_parse(ctx->option_mailfrom, "s/(.*?)\\((?!\\?:)(.*)/$1(?:$2/", &cp) > 0) { - free(ctx->option_mailfrom); - ctx->option_mailfrom = cp; - } - if (str_parse("<>", ctx->option_mailfrom) == -1) { - fprintf(stderr, "%s:Error: illegal regex \"%s\" to option -m.\n", ctx->progname, ctx->option_mailfrom); - CU(ERR_EXECUTION); - } - break; case 'n': /*POD [B<-n> I] */ if (strlen(optarg) > sizeof(ctx->uname.nodename)-1) { fprintf(stderr, "%s:Error: nodename \"%s\" to long to option -n.\n", ctx->progname, optarg);