allow $#local $: @ /filename
[unix-history] / usr / src / usr.sbin / sendmail / src / srvrsmtp.c
index f527460..3b844ed 100644 (file)
@@ -10,9 +10,9 @@
 
 #ifndef lint
 #ifdef SMTP
 
 #ifndef lint
 #ifdef SMTP
-static char sccsid[] = "@(#)srvrsmtp.c 8.42 (Berkeley) %G% (with SMTP)";
+static char sccsid[] = "@(#)srvrsmtp.c 8.52 (Berkeley) %G% (with SMTP)";
 #else
 #else
-static char sccsid[] = "@(#)srvrsmtp.c 8.42 (Berkeley) %G% (without SMTP)";
+static char sccsid[] = "@(#)srvrsmtp.c 8.52 (Berkeley) %G% (without SMTP)";
 #endif
 #endif /* not lint */
 
 #endif
 #endif /* not lint */
 
@@ -430,11 +430,11 @@ smtp(e)
                                        e->e_bodytype = newstr(vp);
                                        if (strcasecmp(vp, "8bitmime") == 0)
                                        {
                                        e->e_bodytype = newstr(vp);
                                        if (strcasecmp(vp, "8bitmime") == 0)
                                        {
-                                               SevenBit = FALSE;
+                                               SevenBitInput = FALSE;
                                        }
                                        else if (strcasecmp(vp, "7bit") == 0)
                                        {
                                        }
                                        else if (strcasecmp(vp, "7bit") == 0)
                                        {
-                                               SevenBit = TRUE;
+                                               SevenBitInput = TRUE;
                                        }
                                        else
                                        {
                                        }
                                        else
                                        {
@@ -443,6 +443,24 @@ smtp(e)
                                                /* NOTREACHED */
                                        }
                                }
                                                /* NOTREACHED */
                                        }
                                }
+                               else if (strcasecmp(kp, "envid") == 0)
+                               {
+                                       if (vp == NULL)
+                                       {
+                                               usrerr("501 ENVID requires a value");
+                                               /* NOTREACHED */
+                                       }
+                                       e->e_envid = newstr(vp);
+                               }
+                               else if (strcasecmp(kp, "omts") == 0)
+                               {
+                                       if (vp == NULL)
+                                       {
+                                               usrerr("501 OMTS requires a value");
+                                               /* NOTREACHED */
+                                       }
+                                       e->e_omts = newstr(vp);
+                               }
                                else
                                {
                                        usrerr("501 %s parameter unrecognized", kp);
                                else
                                {
                                        usrerr("501 %s parameter unrecognized", kp);
@@ -546,7 +564,7 @@ smtp(e)
 
                        /* collect the text of the message */
                        SmtpPhase = "collect";
 
                        /* collect the text of the message */
                        SmtpPhase = "collect";
-                       collect(TRUE, doublequeue, e);
+                       collect(InChannel, TRUE, doublequeue, NULL, e);
                        if (Errors != 0)
                                goto abortmessage;
 
                        if (Errors != 0)
                                goto abortmessage;
 
@@ -580,6 +598,8 @@ smtp(e)
                        {
                                /* make sure it is in the queue */
                                queueup(e, TRUE, FALSE);
                        {
                                /* make sure it is in the queue */
                                queueup(e, TRUE, FALSE);
+                               if (e->e_sendmode == SM_QUEUE)
+                                       e->e_flags |= EF_KEEPQUEUE;
                        }
                        else
                        {
                        }
                        else
                        {
@@ -796,6 +816,87 @@ skipword(p, w)
        return (p);
 }
 \f/*
        return (p);
 }
 \f/*
+**  RCPT_ESMTP_ARGS -- process ESMTP arguments from RCPT line
+**
+**     Parameters:
+**             a -- the address corresponding to the To: parameter.
+**             kp -- the parameter key.
+**             vp -- the value of that parameter.
+**             e -- the envelope.
+**
+**     Returns:
+**             none.
+*/
+
+rcpt_esmtp_args(a, kp, vp, e)
+       ADDRESS *a;
+       char *kp;
+       char *vp;
+       ENVELOPE *e;
+{
+       if (strcasecmp(kp, "notify") == 0)
+       {
+               char *p;
+
+               if (vp == NULL)
+               {
+                       usrerr("501 NOTIFY requires a value");
+                       /* NOTREACHED */
+               }
+               a->q_flags &= ~(QPINGONSUCCESS|QPINGONFAILURE|QPINGONDELAY);
+               if (strcasecmp(vp, "never") == 0)
+                       return;
+               for (p = vp; p != NULL; vp = p)
+               {
+                       p = strchr(p, ',');
+                       if (p != NULL)
+                               *p++ = '\0';
+                       if (strcasecmp(vp, "success") == 0)
+                               a->q_flags |= QPINGONSUCCESS;
+                       else if (strcasecmp(vp, "failure") == 0)
+                               a->q_flags |= QPINGONFAILURE;
+                       else if (strcasecmp(vp, "delay") == 0)
+                               a->q_flags |= QPINGONDELAY;
+                       else
+                       {
+                               usrerr("501 Bad argument \"%s\"  to NOTIFY",
+                                       vp);
+                               /* NOTREACHED */
+                       }
+               }
+       }
+       else if (strcasecmp(kp, "ret") == 0)
+       {
+               if (vp == NULL)
+               {
+                       usrerr("501 RET requires a value");
+                       /* NOTREACHED */
+               }
+               a->q_flags |= QHAS_RET_PARAM;
+               if (strcasecmp(vp, "hdrs") == 0)
+                       a->q_flags |= QRET_HDRS;
+               else if (strcasecmp(vp, "full") != 0)
+               {
+                       usrerr("501 Bad argument \"%s\" to RET", vp);
+                       /* NOTREACHED */
+               }
+       }
+       else if (strcasecmp(kp, "orcpt") == 0)
+       {
+               if (vp == NULL)
+               {
+                       usrerr("501 ORCPT requires a value");
+                       /* NOTREACHED */
+               }
+               a->q_orcpt = newstr(vp);
+       }
+       else
+       {
+               usrerr("501 %s parameter unrecognized", kp);
+               /* NOTREACHED */
+       }
+}
+\f/*
 **  PRINTVRFYADDR -- print an entry in the verify queue
 **
 **     Parameters:
 **  PRINTVRFYADDR -- print an entry in the verify queue
 **
 **     Parameters: