Index: ossp-pkg/lmtp2nntp/00TODO RCS File: /v/ossp/cvs/ossp-pkg/lmtp2nntp/00TODO,v rcsdiff -q -kk '-r1.20' '-r1.21' -u '/v/ossp/cvs/ossp-pkg/lmtp2nntp/00TODO,v' 2>/dev/null --- 00TODO 2001/08/28 14:27:35 1.20 +++ 00TODO 2001/08/29 14:58:21 1.21 @@ -1,5 +1,4 @@ -M=NNNN im Sendmail ergaenzen (weil Postfix gar nix hat) durch -l Commandline options fuer Maximum Message Size use "RFC1918-like" private Domainnames for @example.com (check which name is registered) whatsup draufleiten RFC1891 ENVID Index: ossp-pkg/lmtp2nntp/lmtp.c RCS File: /v/ossp/cvs/ossp-pkg/lmtp2nntp/Attic/lmtp.c,v rcsdiff -q -kk '-r1.17' '-r1.18' -u '/v/ossp/cvs/ossp-pkg/lmtp2nntp/Attic/lmtp.c,v' 2>/dev/null --- lmtp.c 2001/08/28 11:31:22 1.17 +++ lmtp.c 2001/08/29 14:58:21 1.18 @@ -218,7 +218,7 @@ size_t offset; /* required when cpBuf changed through realloc */ size_t offsetline; /* memorizing start of line when reallocing in the middle of a line */ - nBuf = 4096; + for (nBuf = 4096; nBuf > maxlen; nBuf = nBuf >> 1); if ((cpBuf = (char *)malloc(nBuf)) == NULL) return LMTP_ERR_MEM; *cppBuf = cpBuf; /* tell caller about the buffer */ Index: ossp-pkg/lmtp2nntp/lmtp2nntp.c RCS File: /v/ossp/cvs/ossp-pkg/lmtp2nntp/Attic/lmtp2nntp.c,v rcsdiff -q -kk '-r1.33' '-r1.34' -u '/v/ossp/cvs/ossp-pkg/lmtp2nntp/Attic/lmtp2nntp.c,v' 2>/dev/null --- lmtp2nntp.c 2001/08/28 14:27:35 1.33 +++ lmtp2nntp.c 2001/08/29 14:58:21 1.34 @@ -52,7 +52,6 @@ #define ERR_EXECUTION -1 #define ERR_DELIVERY -2 -#define MESSAGE_MAXLEN 8*1024*1024 #define STDSTRLEN 128 #define MAXNEWSSERVICES 3 @@ -94,6 +93,7 @@ int option_deliverymode; char *option_deliverymodefakestatus; char *option_deliverymodefakedsn; + int option_maxmessagesize; int nsc; struct ns ns[MAXNEWSSERVICES]; char *azGroupargs; @@ -130,8 +130,8 @@ */ fprintf(stderr, "USAGE: %s " - "lmtp2nntp [-d deliverymode] [-g groupmode] [-h host[:port]] " - "[-t tracefile] [-v] [-V] newsgroup [newsgroup ...]" + "[-d deliverymode] [-g groupmode] [-h host[:port]] " + "[-m maxmessagesize] [-t tracefile] [-v] [-V] newsgroup [newsgroup ...]" "\n", command); return; @@ -163,6 +163,7 @@ ctx->option_deliverymode = DELIVERYMODE_FAKE; ctx->option_deliverymodefakestatus = "553"; /* Requested action not taken: mailbox name not allowed */ ctx->option_deliverymodefakedsn = "5.7.1"; /* Delivery not authorized, message refused */ + ctx->option_maxmessagesize = 8 * 1024 * 1024; ctx->nsc = 0; for (i=0; i < MAXNEWSSERVICES; i++) { ctx->ns[i].h = NULL; @@ -199,12 +200,12 @@ /*POD B */ /* use - * perl ) { if(m/\/\*POD (.*) .*\*\//) { $_=$1; s/.<(.*?)>/$1/g ; print "$_\n" };}' + * perl ) { if(m/\/\*POD (.*) .*\*\//) { $_=$1; print "$_\n" };}' * to pull the POD SYNOPSIS header directly out of this source */ /* read in the arguments */ - while ((i = getopt(argc, argv, "d:g:h:t:vV")) != -1) { + while ((i = getopt(argc, argv, "d:g:h:m:t:vV")) != -1) { switch (i) { case 'd': /*POD [B<-d> I] */ if (strcasecmp(optarg, "post") == 0) @@ -304,6 +305,13 @@ } free(azHosts); break; + case 'm': /*POD [B<-m> I] */ + 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); + } + break; case 't': /*POD [B<-t> I] */ ctx->option_tracing = TRUE; trace_read (-1, optarg, 0); @@ -873,16 +881,17 @@ res.statusmsg = "Enter mail, end with \".\" on a line by itself"; lmtp_response(lmtp, &res); - rc = lmtp_readmsg(lmtp, &ctx->msg->cpMsg, MESSAGE_MAXLEN); + rc = lmtp_readmsg(lmtp, &ctx->msg->cpMsg, ctx->option_maxmessagesize); /* RFC0821 4.2.1. REPLY CODES BY FUNCTION GROUPS 552 Requested mail action aborted: exceeded storage allocation * RFC1893 2. Status Codes 5.X.X Permanent Failure - * RFC1893 3.5 Network and Routing Status X.3.4 Message too big for system + * RFC1893 3.5 Network and Routing Status X.2.3 Message length exceeds administrative limit. + */ if (rc == LMTP_ERR_OVERFLOW) { - str_format(errorstring, sizeof(errorstring), "Overflow reading message: %s", lmtp_error(rc)); + str_format(errorstring, sizeof(errorstring), "Message length exceeds administrative limit. %s", lmtp_error(rc)); res.statuscode = "552"; - res.dsncode = "5.3.4"; + res.dsncode = "5.2.3"; res.statusmsg = errorstring; rcpt = NULL; while ((rcpt = argz_next(ctx->msg->azRcpt, ctx->msg->asRcpt, rcpt)) != NULL) { Index: ossp-pkg/lmtp2nntp/lmtp2nntp.pod RCS File: /v/ossp/cvs/ossp-pkg/lmtp2nntp/lmtp2nntp.pod,v rcsdiff -q -kk '-r1.8' '-r1.9' -u '/v/ossp/cvs/ossp-pkg/lmtp2nntp/lmtp2nntp.pod,v' 2>/dev/null --- lmtp2nntp.pod 2001/08/28 13:12:58 1.8 +++ lmtp2nntp.pod 2001/08/29 14:58:21 1.9 @@ -11,10 +11,10 @@ [B<-d> I] [B<-g> I] [B<-h> I[I<:port>]] +[B<-m> I] [B<-t> I] [B<-v>] [B<-V>] -I [I ...] B [B<-o> I] [B<-j> I] @@ -53,6 +53,11 @@ LMTP and NNTP protocol timeouts (in seconds). +=item [B<-m> I] + +Maximum message size in bytes. Default is 8388608 (8M). Values below 64 are +considered unacceptable small. + =item B<-p> I Incoming protocol. Default is C which means B @@ -126,7 +131,26 @@ =head1 SENDMAIL INTEGRATION - Mlmtp2nntp, P=/... /*FIXME*/ +t.virtusertable + + # mail to news gateway + posting+*@mail.de.cw.net %2@lmtp2nntp + +t.mailertable + + # mail to news gateway + lmtp2nntp lmtp2nntp:visp.engelschall.com + +sendmail.m4 + + dnl # Mailer: LMTP2NNTP (mail to news gateway) + define(`LMTP2NNTP_MAILER_PATH', `confMYBINDIR/lmtp2nntp') + define(`LMTP2NNTP_MAILER_MAX', `100000') + define(`LMTP2NNTP_MAILER_DELIVERYMODE', `post') + define(`LMTP2NNTP_MAILER_GROUPMODE', `envelope') + define(`LMTP2NNTP_MAILER_ARGS', `-t confMYVARDIR/lmtp2nntp.log') + define(`LMTP2NNTP_MAILER_GROUPS', `cw.\* en.\*') + MAILER(lmtp2nntp) =head1 EXAMPLE