OSSP CVS Repository

ossp - Difference in ossp-pkg/lmtp2nntp/lmtp2nntp.c versions 1.39 and 1.40
Not logged in
[Honeypot]  [Browse]  [Home]  [Login]  [Reports
[Search]  [Ticket]  [Timeline
  [History

ossp-pkg/lmtp2nntp/lmtp2nntp.c 1.39 -> 1.40

--- lmtp2nntp.c  2001/09/04 09:46:06     1.39
+++ lmtp2nntp.c  2001/09/05 09:14:26     1.40
@@ -112,6 +112,7 @@
     char           *option_deliverymodefakedsn;
     int             option_maxmessagesize;
     int             option_waittime;
+    char           *option_mailfrom;
     char           *cpBindh;
     char           *cpBindp;
     sa_t           *saBind;
@@ -152,11 +153,13 @@
     fprintf(stderr, 
             "USAGE: %s "
             "[-V]"
+            "[-b bindaddr[:port]"
             "[-d deliverymode]"
             "[-g groupmode]"
             "[-h host[:port][,host[:port], ...]]"
-            "[-m maxmessagesize]"
-            "[-n hostname]"
+            "[-m mailfrom]"
+            "[-n nodename]"
+            "[-s size]"
             "[-t tracefile]"
             "[-v]"
             "[-w waittime]"
@@ -194,6 +197,7 @@
     ctx->option_deliverymodefakedsn    = "5.7.1"; /* Delivery not authorized, message refused */
     ctx->option_maxmessagesize = 8 * 1024 * 1024;
     ctx->option_waittime = -1;
+    ctx->option_mailfrom = NULL;
     ctx->cpBindh = NULL;
     ctx->cpBindp = NULL;
     ctx->saBind = NULL;
@@ -238,7 +242,7 @@
      */
 
     /* read in the arguments */
-    while ((i = getopt(argc, argv, "Vb:d:g:h:m:n:t:vw:")) != -1) {
+    while ((i = getopt(argc, argv, "Vb:d:g:h:m:n:s:t:vw:")) != -1) {
         switch (i) {
             case 'V': /*POD [B<-V>] (version)*/
                 fprintf(stdout, "%s\n", lmtp2nntp_version.v_gnu);
@@ -373,20 +377,22 @@
                 }
                 free(azHosts);
                 break;
-            case 'm': /*POD [B<-m> I<maxmessagesize>] */
-                    ctx->option_maxmessagesize = atoi(optarg);
-                    if(ctx->option_maxmessagesize < 64) {
-                        fprintf(stderr, "%s:Error: maximum message size is unacceptable small.\n", progname);
-                        exit(ERR_EXECUTION);
-                    }
+            case 'm': /*POD [B<-m> I<mailfrom>] */
+                    ctx->option_mailfrom = strdup(optarg);
                 break;
-            case 'n': /*POD [B<-n> I<hostname>] */
+            case 'n': /*POD [B<-n> I<nodename>] */
                 if (strlen(optarg) > sizeof(ctx->uname.nodename)-1) {
                         fprintf(stderr, "%s:Error: nodename \"%s\" to long to option -n.\n", progname, optarg);
                         exit(ERR_EXECUTION);
                 }
                 strcpy(ctx->uname.nodename, optarg);
                 break;
+            case 's': /*POD [B<-s> I<size>] */
+                    ctx->option_maxmessagesize = atoi(optarg);
+                    if(ctx->option_maxmessagesize < 64) {
+                        fprintf(stderr, "%s:Error: maximum message size is unacceptable small.\n", progname);
+                        exit(ERR_EXECUTION);
+                    }
             case 't': /*POD [B<-t> I<tracefile>] */
                 ctx->option_tracing = TRUE;
                 trace_read (-1, optarg, 0);
@@ -688,6 +694,8 @@
         if (ctx->ns[i].h != NULL)
             free(ctx->ns[i].h);
     }
+    if (ctx->option_mailfrom != NULL)
+        free(ctx->option_mailfrom);
     if (ctx->cpBindh != NULL)
         free(ctx->cpBindh);
     if (ctx->cpBindp != NULL)

CVSTrac 2.0.1