add "suppress return-to-sender" function
authorEric Allman <eric@ucbvax.Berkeley.EDU>
Wed, 2 Sep 1981 02:43:38 +0000 (18:43 -0800)
committerEric Allman <eric@ucbvax.Berkeley.EDU>
Wed, 2 Sep 1981 02:43:38 +0000 (18:43 -0800)
SCCS-vsn: usr.sbin/sendmail/src/conf.c 3.27
SCCS-vsn: usr.sbin/sendmail/src/sendmail.h 3.36
SCCS-vsn: usr.sbin/sendmail/src/savemail.c 3.16
SCCS-vsn: usr.sbin/sendmail/src/main.c 3.31

usr/src/usr.sbin/sendmail/src/conf.c
usr/src/usr.sbin/sendmail/src/main.c
usr/src/usr.sbin/sendmail/src/savemail.c
usr/src/usr.sbin/sendmail/src/sendmail.h

index 53a11f7..43530ca 100644 (file)
@@ -32,7 +32,7 @@
 
 
 
 
 
 
-static char SccsId[] = "@(#)conf.c     3.26    %G%";
+static char SccsId[] = "@(#)conf.c     3.27    %G%";
 
 
 # include <whoami.h>           /* definitions of machine id's at berkeley */
 
 
 # include <whoami.h>           /* definitions of machine id's at berkeley */
@@ -272,6 +272,9 @@ ttypath()
 **     message should be given using "usrerr" and FALSE should
 **     be returned.
 **
 **     message should be given using "usrerr" and FALSE should
 **     be returned.
 **
+**     'NoReturn' can be set to suppress the return-to-sender
+**     function; this should be done on huge messages.
+**
 **     Parameters:
 **             to -- the person being sent to.
 **
 **     Parameters:
 **             to -- the person being sent to.
 **
@@ -287,11 +290,11 @@ bool
 checkcompat(to)
        register ADDRESS *to;
 {
 checkcompat(to)
        register ADDRESS *to;
 {
-# ifdef lint
-       ADDRESS *x = to;
-
-       to = x;
-# endif lint
-
+       if (to->q_mailer != MN_LOCAL && MsgSize > 100000)
+       {
+               usrerr("Message exceeds 100000 bytes");
+               NoReturn++;
+               return (FALSE);
+       }
        return (TRUE);
 }
        return (TRUE);
 }
index 0a7e98f..4c65a63 100644 (file)
@@ -5,7 +5,7 @@
 # include <syslog.h>
 # endif LOG
 
 # include <syslog.h>
 # endif LOG
 
-static char    SccsId[] = "@(#)main.c  3.30    %G%";
+static char    SccsId[] = "@(#)main.c  3.31    %G%";
 
 /*
 **  SENDMAIL -- Post mail to a set of destinations.
 
 /*
 **  SENDMAIL -- Post mail to a set of destinations.
@@ -125,6 +125,7 @@ bool        SuprErrs;       /* supress errors if set */
 bool   Verbose;        /* set if blow-by-blow desired */
 bool   GrabTo;         /* if set, read recipient addresses from msg */
 bool   DontSend;       /* mark recipients as QDONTSEND */
 bool   Verbose;        /* set if blow-by-blow desired */
 bool   GrabTo;         /* if set, read recipient addresses from msg */
 bool   DontSend;       /* mark recipients as QDONTSEND */
+bool   NoReturn;       /* don't return content of letter to sender */
 int    Debug;          /* debug level */
 int    Errors;         /* count of errors */
 int    AliasLevel;     /* current depth of aliasing */
 int    Debug;          /* debug level */
 int    Errors;         /* count of errors */
 int    AliasLevel;     /* current depth of aliasing */
index 61cde36..7fb7cd9 100644 (file)
@@ -1,7 +1,7 @@
 # include <pwd.h>
 # include "sendmail.h"
 
 # include <pwd.h>
 # include "sendmail.h"
 
-static char    SccsId[] = "@(#)savemail.c      3.15    %G%";
+static char    SccsId[] = "@(#)savemail.c      3.16    %G%";
 
 /*
 **  SAVEMAIL -- Save mail on error
 
 /*
 **  SAVEMAIL -- Save mail on error
@@ -219,7 +219,9 @@ errhdr(fp)
        fprintf(fp, "\n   ----- Transcript of session follows -----\n");
        while (fgets(buf, sizeof buf, xfile) != NULL)
                fputs(buf, fp);
        fprintf(fp, "\n   ----- Transcript of session follows -----\n");
        while (fgets(buf, sizeof buf, xfile) != NULL)
                fputs(buf, fp);
-       if (TempFile != NULL)
+       if (NoReturn)
+               fprintf(fp, "\n   ----- Return message suppressed -----\n\n");
+       else if (TempFile != NULL)
        {
                fprintf(fp, "\n   ----- Unsent message follows -----\n");
                (void) fflush(fp);
        {
                fprintf(fp, "\n   ----- Unsent message follows -----\n");
                (void) fflush(fp);
index aec8fa2..8ad1803 100644 (file)
@@ -1,7 +1,7 @@
 /*
 **  SENDMAIL.H -- Global definitions for sendmail.
 **
 /*
 **  SENDMAIL.H -- Global definitions for sendmail.
 **
-**     @(#)sendmail.h  3.35    %G%
+**     @(#)sendmail.h  3.36    %G%
 */
 
 
 */
 
 
@@ -265,6 +265,7 @@ extern bool SaveFrom;       /* save leading "From" lines */
 extern bool    Verbose;        /* set if blow-by-blow desired */
 extern bool    GrabTo;         /* if set, get recipients from msg */
 extern bool    DontSend;       /* mark recipients as QDONTSEND */
 extern bool    Verbose;        /* set if blow-by-blow desired */
 extern bool    GrabTo;         /* if set, get recipients from msg */
 extern bool    DontSend;       /* mark recipients as QDONTSEND */
+extern bool    NoReturn;       /* don't return letter to sender */
 extern int     Debug;          /* debugging level */
 extern int     Errors;         /* set if errors */
 extern int     ExitStat;       /* exit status code */
 extern int     Debug;          /* debugging level */
 extern int     Errors;         /* set if errors */
 extern int     ExitStat;       /* exit status code */