--- lmtp2nntp_config.c 2002/01/31 14:47:13 1.27
+++ lmtp2nntp_config.c 2002/01/31 15:03:23 1.28
@@ -513,6 +513,57 @@
}
catch (ex)
rethrow;
+
+ /* --operationmode SINGLE */
+ try {
+ char *cp;
+
+ if ( (val_get(ctx->val, "option.operationmode", &ov) != VAL_OK)
+ || (ov->ndata != 1)
+ || (ov->data.s == NULL)
+ ) throw(0,0,0);
+ log1(ctx, TRACE, "--operationmode = \"%s\"", ov->data.s);
+
+ cp = strdup(ov->data.s);
+ if (strcasecmp(cp, "post") == 0)
+ ctx->option_operationmode = OPERATIONMODE_POST;
+ else if (strcasecmp(cp, "feed") == 0)
+ ctx->option_operationmode = OPERATIONMODE_FEED;
+ else {
+ if (strlen(cp) != 9) {
+ log1(ctx, ERROR, "option --operationmode, invalid length (%s)", cp);
+ throw(0,0,0);
+ }
+ if (cp[3] != '/') {
+ log1(ctx, ERROR, "option --operationmode, missing slash (%s)", cp);
+ throw(0,0,0);
+ }
+ cp[3] = NUL;
+ ctx->option_operationmodefakestatus = &cp[0];
+ ctx->option_operationmodefakedsn = &cp[4];
+ if ( strlen(ctx->option_operationmodefakestatus) != 3
+ || !isdigit((int)ctx->option_operationmodefakestatus[0])
+ || !isdigit((int)ctx->option_operationmodefakestatus[1])
+ || !isdigit((int)ctx->option_operationmodefakestatus[2])
+ ) {
+ log1(ctx, ERROR, "option --operationmode, invalid status code (%s)", cp);
+ throw(0,0,0);
+ }
+ if ( (strlen(ctx->option_operationmodefakedsn) != 5)
+ || !isdigit((int)ctx->option_operationmodefakedsn[0])
+ || (ctx->option_operationmodefakedsn[1] != '.')
+ || !isdigit((int)ctx->option_operationmodefakedsn[2])
+ || (ctx->option_operationmodefakedsn[3] != '.')
+ || !isdigit((int)ctx->option_operationmodefakedsn[4])
+ || (ctx->option_operationmodefakedsn[0] != ctx->option_operationmodefakestatus[0])
+ ) {
+ log1(ctx, ERROR, "option --operationmode, invalid dsn code (%s)", cp);
+ throw(0,0,0);
+ }
+ }
+ }
+ catch (ex)
+ rethrow;
CUS:
return;
}
|