fixes for MIME body type support
authorEric Allman <eric@ucbvax.Berkeley.EDU>
Sat, 18 Jun 1994 02:06:30 +0000 (18:06 -0800)
committerEric Allman <eric@ucbvax.Berkeley.EDU>
Sat, 18 Jun 1994 02:06:30 +0000 (18:06 -0800)
SCCS-vsn: usr.sbin/sendmail/src/usersmtp.c 8.19
SCCS-vsn: usr.sbin/sendmail/src/srvrsmtp.c 8.40

usr/src/usr.sbin/sendmail/src/srvrsmtp.c
usr/src/usr.sbin/sendmail/src/usersmtp.c

index 3e5faae..5140df7 100644 (file)
@@ -10,9 +10,9 @@
 
 #ifndef lint
 #ifdef SMTP
 
 #ifndef lint
 #ifdef SMTP
-static char sccsid[] = "@(#)srvrsmtp.c 8.39 (Berkeley) %G% (with SMTP)";
+static char sccsid[] = "@(#)srvrsmtp.c 8.40 (Berkeley) %G% (with SMTP)";
 #else
 #else
-static char sccsid[] = "@(#)srvrsmtp.c 8.39 (Berkeley) %G% (without SMTP)";
+static char sccsid[] = "@(#)srvrsmtp.c 8.40 (Berkeley) %G% (without SMTP)";
 #endif
 #endif /* not lint */
 
 #endif
 #endif /* not lint */
 
@@ -399,23 +399,21 @@ smtp(e)
                                                usrerr("501 BODY requires a value");
                                                /* NOTREACHED */
                                        }
                                                usrerr("501 BODY requires a value");
                                                /* NOTREACHED */
                                        }
-# ifdef MIME
+                                       e->e_bodytype = newstr(vp);
                                        if (strcasecmp(vp, "8bitmime") == 0)
                                        {
                                        if (strcasecmp(vp, "8bitmime") == 0)
                                        {
-                                               e->e_bodytype = "8BITMIME";
                                                SevenBit = FALSE;
                                        }
                                        else if (strcasecmp(vp, "7bit") == 0)
                                        {
                                                SevenBit = FALSE;
                                        }
                                        else if (strcasecmp(vp, "7bit") == 0)
                                        {
-                                               e->e_bodytype = "7BIT";
                                                SevenBit = TRUE;
                                        }
                                        else
                                        {
                                                usrerr("501 Unknown BODY type %s",
                                                        vp);
                                                SevenBit = TRUE;
                                        }
                                        else
                                        {
                                                usrerr("501 Unknown BODY type %s",
                                                        vp);
+                                               /* NOTREACHED */
                                        }
                                        }
-# endif
                                }
                                else
                                {
                                }
                                else
                                {
index cfd3db1..b5bcc2f 100644 (file)
@@ -10,9 +10,9 @@
 
 #ifndef lint
 #ifdef SMTP
 
 #ifndef lint
 #ifdef SMTP
-static char sccsid[] = "@(#)usersmtp.c 8.18 (Berkeley) %G% (with SMTP)";
+static char sccsid[] = "@(#)usersmtp.c 8.19 (Berkeley) %G% (with SMTP)";
 #else
 #else
-static char sccsid[] = "@(#)usersmtp.c 8.18 (Berkeley) %G% (without SMTP)";
+static char sccsid[] = "@(#)usersmtp.c 8.19 (Berkeley) %G% (without SMTP)";
 #endif
 #endif /* not lint */
 
 #endif
 #endif /* not lint */
 
@@ -312,6 +312,21 @@ smtpmailfrom(m, mci, e)
        else
                strcpy(optbuf, "");
 
        else
                strcpy(optbuf, "");
 
+       if (e->e_bodytype != NULL)
+       {
+               if (bitset(MCIF_8BITMIME, mci->mci_flags))
+               {
+                       strcat(optbuf, " BODY=");
+                       strcat(optbuf, e->e_bodytype);
+               }
+               else if (strcasecmp(e->e_bodytype, "7bit") != 0)
+               {
+                       /* cannot just send a 7-bit version */
+                       usrerr("%s does not support 8BITMIME", mci->mci_host);
+                       return EX_DATAERR;
+               }
+       }
+
        /*
        **  Send the HOPS command.
        **      This is non-standard and may give an "unknown command".
        /*
        **  Send the HOPS command.
        **      This is non-standard and may give an "unknown command".