OSSP CVS Repository

ossp - Check-in [857]
Not logged in
[Honeypot]  [Browse]  [Home]  [Login]  [Reports
[Search]  [Ticket]  [Timeline
  [Patchset]  [Tagging/Branching

Check-in Number: 857
Date: 2001-Sep-05 11:14:26 (local)
2001-Sep-05 09:14:26 (UTC)
User:thl
Branch:
Comment: flush pending (unfinished) work.
Tickets:
Inspections:
Files:
ossp-pkg/lmtp2nntp/00TODO      1.25 -> 1.26     8 inserted, 0 deleted
ossp-pkg/lmtp2nntp/lmtp2nntp.c      1.39 -> 1.40     18 inserted, 10 deleted
ossp-pkg/lmtp2nntp/lmtp2nntp.pod      1.15 -> 1.16     21 inserted, 6 deleted

ossp-pkg/lmtp2nntp/00TODO 1.25 -> 1.26

--- 00TODO       2001/09/03 15:06:29     1.25
+++ 00TODO       2001/09/05 09:14:26     1.26
@@ -4,6 +4,14 @@
 
 [B<-b> I<bindaddress>]
 
+
+Hallo Thomas, wir haben festgestellt, dass wir noch ein feature brauchen.
+Momentan waere es moeglich, dass jeder x-beliebige (der die entsprechende
+Mail-Adresse kennt) eine Mail an mail.de.cw.net schickt, und diese somit auf
+unsern News-Server abgebildet wird. Wir brauchen daher noch einen Filter, der
+dies pro Gruppe auf einen definierten, erlaubten Absender erlaubt.
+[B<-m> I<mailfrom>]
+
 use L2 for logging, grab ID through RFC1891 ENVID, 6.2
 [B<-i> I<messageid>]
 [B<-l> I<logtarget>]


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)


ossp-pkg/lmtp2nntp/lmtp2nntp.pod 1.15 -> 1.16

--- lmtp2nntp.pod        2001/09/04 09:46:06     1.15
+++ lmtp2nntp.pod        2001/09/05 09:14:27     1.16
@@ -34,18 +34,19 @@
 
 B<lmtp2nntp>
 [B<-V>]
+[B<-b> I<bindaddr>[I<:port>]
 [B<-d> I<deliverymode>]
 [B<-g> I<groupmode>]
 [B<-h> I<host>[I<:port>][,I<host>[I<:port>], ...]]
-[B<-m> I<maxmessagesize>]
-[B<-n> I<hostname>]
+[B<-m> I<mailfrom>]
+[B<-n> I<nodename>]
+[B<-s> I<size>]
 [B<-t> I<tracefile>]
 [B<-v>]
 [B<-w> I<waittime>]
 I<newsgroup> [I<newsgroup> ...]
 
 B<FIXME NOT YET IMPLEMENTED>
-[B<-b> I<bindaddress>]
 [B<-i> I<messageid>]
 [B<-l> I<logtarget>]
 
@@ -67,6 +68,14 @@
 
 Print version information.
 
+=item B<-b> I<bindaddr>[I<:port>]
+
+Bind address and/or port to be used by the LMTP client.  If an address is
+specified but port is omitted the kernel chooses an ephemeral port. If you
+want to specify a port but no address replace address with 0.0.0.0.  If
+completely omitted, 0.0.0.0:0 is assumed which causes the kernel to choose an
+address based on routing information and an ephemeral port.
+
 =item B<-d> I<deliverymode>
 
 Possible values for I<deliverymode> are C<post>, C<feed> or a string used to
@@ -107,16 +116,22 @@
 In regard to this program they must provide the same groups and talk to each
 other. 
 
-=item B<-m> I<maxmessagesize>
+=item B<-m> I<mailfrom>
 
-Maximum message size in bytes. Default is 8388608 (8M). Values below 64 are
-considered unacceptable small.
+"MAIL From:" filter to limit sender addresses. If ommitted, anyone can send
+mail. The value to be compared includes the angle brackets. Use a PCRE (Perl
+compatible reguar expression) for I<mailfrom>.
 
 =item B<-n> I<nodename>
 
 Own FQDN used in LMTP and NNTP protocols. This overrides the nodename returned
 by uname(3).
 
+=item B<-s> I<size>
+
+Size limitation on message in bytes. Default is 8388608 (8M). Values below 64
+are considered unacceptable small.
+
 =item B<-t> I<tracefile>
 
 Enable LMTP and NNTP protocol tracing into tracefile. When using C<syslog:>

CVSTrac 2.0.1