disable UPPER->lower case mapping in RHS's of aliases so that upper
authorEric Allman <eric@ucbvax.Berkeley.EDU>
Mon, 12 Mar 1984 11:58:44 +0000 (03:58 -0800)
committerEric Allman <eric@ucbvax.Berkeley.EDU>
Mon, 12 Mar 1984 11:58:44 +0000 (03:58 -0800)
case letters can be used in file names and as args to programs.

SCCS-vsn: usr.sbin/sendmail/src/savemail.c 4.4
SCCS-vsn: usr.sbin/sendmail/src/recipient.c 4.3
SCCS-vsn: usr.sbin/sendmail/src/version.c 4.26
SCCS-vsn: usr.sbin/sendmail/src/envelope.c 4.4
SCCS-vsn: usr.sbin/sendmail/src/parseaddr.c 4.5

usr/src/usr.sbin/sendmail/src/envelope.c
usr/src/usr.sbin/sendmail/src/parseaddr.c
usr/src/usr.sbin/sendmail/src/recipient.c
usr/src/usr.sbin/sendmail/src/savemail.c
usr/src/usr.sbin/sendmail/src/version.c

index 569f499..a1694c1 100644 (file)
@@ -3,7 +3,7 @@
 #include "sendmail.h"
 #include <sys/stat.h>
 
 #include "sendmail.h"
 #include <sys/stat.h>
 
-SCCSID(@(#)envelope.c  4.3             %G%);
+SCCSID(@(#)envelope.c  4.4             %G%);
 
 /*
 **  NEWENVELOPE -- allocate a new envelope
 
 /*
 **  NEWENVELOPE -- allocate a new envelope
@@ -608,6 +608,7 @@ setsender(from)
        else
                FromFlag = TRUE;
        CurEnv->e_from.q_flags |= QDONTSEND;
        else
                FromFlag = TRUE;
        CurEnv->e_from.q_flags |= QDONTSEND;
+       loweraddr(&CurEnv->e_from);
        SuprErrs = FALSE;
 
        if (pw == NULL && CurEnv->e_from.q_mailer == LocalMailer)
        SuprErrs = FALSE;
 
        if (pw == NULL && CurEnv->e_from.q_mailer == LocalMailer)
index 4c4a0fa..efdbd52 100644 (file)
@@ -1,6 +1,6 @@
 # include "sendmail.h"
 
 # include "sendmail.h"
 
-SCCSID(@(#)parseaddr.c 4.4             %G%);
+SCCSID(@(#)parseaddr.c 4.5             %G%);
 
 /*
 **  PARSEADDR -- Parse an address
 
 /*
 **  PARSEADDR -- Parse an address
@@ -123,15 +123,6 @@ parseaddr(addr, a, copyf, delim)
                        a->q_user = newstr(a->q_user);
        }
 
                        a->q_user = newstr(a->q_user);
        }
 
-       /*
-       **  Do UPPER->lower case mapping unless inhibited.
-       */
-
-       if (!bitnset(M_HST_UPPER, m->m_flags))
-               makelower(a->q_host);
-       if (!bitnset(M_USR_UPPER, m->m_flags))
-               makelower(a->q_user);
-
        /*
        **  Compute return value.
        */
        /*
        **  Compute return value.
        */
@@ -147,6 +138,29 @@ parseaddr(addr, a, copyf, delim)
        return (a);
 }
 \f/*
        return (a);
 }
 \f/*
+**  LOWERADDR -- map UPPER->lower case on addresses as requested.
+**
+**     Parameters:
+**             a -- address to be mapped.
+**
+**     Returns:
+**             none.
+**
+**     Side Effects:
+**             none.
+*/
+
+loweraddr(a)
+       register ADDRESS *a;
+{
+       register MAILER *m = a->q_mailer;
+
+       if (!bitnset(M_HST_UPPER, m->m_flags))
+               makelower(a->q_host);
+       if (!bitnset(M_USR_UPPER, m->m_flags))
+               makelower(a->q_user);
+}
+\f/*
 **  PRESCAN -- Prescan name and make it canonical
 **
 **     Scans a name and turns it into a set of tokens.  This process
 **  PRESCAN -- Prescan name and make it canonical
 **
 **     Scans a name and turns it into a set of tokens.  This process
index c5156ab..062576f 100644 (file)
@@ -2,7 +2,7 @@
 # include "sendmail.h"
 # include <sys/stat.h>
 
 # include "sendmail.h"
 # include <sys/stat.h>
 
-SCCSID(@(#)recipient.c 4.2             %G%);
+SCCSID(@(#)recipient.c 4.3             %G%);
 
 /*
 **  SENDTOLIST -- Designate a send list.
 
 /*
 **  SENDTOLIST -- Designate a send list.
@@ -229,8 +229,14 @@ recipient(a, sendq)
        **  Finish setting up address structure.
        */
 
        **  Finish setting up address structure.
        */
 
+       /* set the queue timeout */
        a->q_timeout = TimeOut;
 
        a->q_timeout = TimeOut;
 
+       /* map user & host to lower case if requested on non-aliases */
+       if (a->q_alias == NULL)
+               loweraddr(a);
+
+       /* get unquoted user for file, program or user.name check */
        (void) strcpy(buf, a->q_user);
        for (p = buf; *p != '\0' && !quoted; p++)
        {
        (void) strcpy(buf, a->q_user);
        for (p = buf; *p != '\0' && !quoted; p++)
        {
index 4cf737d..c1ceeb0 100644 (file)
@@ -1,7 +1,7 @@
 # include <pwd.h>
 # include "sendmail.h"
 
 # include <pwd.h>
 # include "sendmail.h"
 
-SCCSID(@(#)savemail.c  4.3             %G%);
+SCCSID(@(#)savemail.c  4.4             %G%);
 
 /*
 **  SAVEMAIL -- Save mail on error
 
 /*
 **  SAVEMAIL -- Save mail on error
@@ -267,6 +267,7 @@ returntosender(msg, returnto, sendbody)
                returndepth--;
                return (-1);
        }
                returndepth--;
                return (-1);
        }
+       loweraddr(&ee->e_from);
 
        /* push state into submessage */
        CurEnv = ee;
 
        /* push state into submessage */
        CurEnv = ee;
index 0120e3b..2dd6ec3 100644 (file)
@@ -1,5 +1,5 @@
 # ifndef lint
 # ifndef lint
-static char    SccsId[] = "@(#)SendMail version 4.25 of %G%";
+static char    SccsId[] = "@(#)SendMail version 4.26 of %G%";
 # endif lint
 
 # endif lint
 
-char   Version[] = "4.25";
+char   Version[] = "4.26";