no body is to be returned -- this could confuse mail readers
SCCS-vsn: usr.sbin/sendmail/src/usersmtp.c 8.27
SCCS-vsn: usr.sbin/sendmail/src/headers.c 8.42
SCCS-vsn: usr.sbin/sendmail/src/sendmail.h 8.71
SCCS-vsn: usr.sbin/sendmail/src/savemail.c 8.37
SCCS-vsn: usr.sbin/sendmail/src/deliver.c 8.108
SCCS-vsn: usr.sbin/sendmail/src/queue.c 8.53
SCCS-vsn: usr.sbin/sendmail/src/conf.c 8.117
SCCS-vsn: usr.sbin/sendmail/src/mime.c 8.9
-static char sccsid[] = "@(#)conf.c 8.116 (Berkeley) %G%";
+static char sccsid[] = "@(#)conf.c 8.117 (Berkeley) %G%";
#endif /* not lint */
# include "sendmail.h"
#endif /* not lint */
# include "sendmail.h"
"comments", H_FORCE,
"return-path", H_FORCE|H_ACHECK,
"content-transfer-encoding", H_CTE,
"comments", H_FORCE,
"return-path", H_FORCE|H_ACHECK,
"content-transfer-encoding", H_CTE,
+ "content-type", H_CTYPE,
-static char sccsid[] = "@(#)deliver.c 8.107 (Berkeley) %G%";
+static char sccsid[] = "@(#)deliver.c 8.108 (Berkeley) %G%";
#endif /* not lint */
#include "sendmail.h"
#endif /* not lint */
#include "sendmail.h"
- (*e->e_puthdr)(mci, e->e_header, e);
- (*e->e_putbody)(mci, e, NULL);
+ (*e->e_puthdr)(mci, e->e_header, e, 0);
+ (*e->e_putbody)(mci, e, NULL, 0);
/* get the exit status */
rcode = endmailer(mci, e, pv);
/* get the exit status */
rcode = endmailer(mci, e, pv);
** e -- the envelope to put out.
** separator -- if non-NULL, a message separator that must
** not be permitted in the resulting message.
** e -- the envelope to put out.
** separator -- if non-NULL, a message separator that must
** not be permitted in the resulting message.
+** flags -- to modify the behaviour.
#define OS_CR 1 /* read a carriage return */
#define OS_INLINE 2 /* putting rest of line */
#define OS_CR 1 /* read a carriage return */
#define OS_INLINE 2 /* putting rest of line */
-putbody(mci, e, separator)
+putbody(mci, e, separator, flags)
register MCI *mci;
register ENVELOPE *e;
char *separator;
register MCI *mci;
register ENVELOPE *e;
char *separator;
mcibuf.mci_flags |= MCIF_7BIT;
putfromline(&mcibuf, e);
mcibuf.mci_flags |= MCIF_7BIT;
putfromline(&mcibuf, e);
- (*e->e_puthdr)(&mcibuf, e->e_header, e);
- (*e->e_putbody)(&mcibuf, e, NULL);
+ (*e->e_puthdr)(&mcibuf, e->e_header, e, 0);
+ (*e->e_putbody)(&mcibuf, e, NULL, 0);
putline("\n", &mcibuf);
if (ferror(f))
{
putline("\n", &mcibuf);
if (ferror(f))
{
-static char sccsid[] = "@(#)headers.c 8.41 (Berkeley) %G%";
+static char sccsid[] = "@(#)headers.c 8.42 (Berkeley) %G%";
#endif /* not lint */
# include <errno.h>
#endif /* not lint */
# include <errno.h>
** mci -- the connection information.
** h -- the header to put.
** e -- envelope to use.
** mci -- the connection information.
** h -- the header to put.
** e -- envelope to use.
+** flags -- to modify the behaviour.
# define MAX(a,b) (((a)>(b))?(a):(b))
#endif
# define MAX(a,b) (((a)>(b))?(a):(b))
#endif
+putheader(mci, h, e, flags)
register MCI *mci;
register HDR *h;
register ENVELOPE *e;
register MCI *mci;
register HDR *h;
register ENVELOPE *e;
{
char buf[MAX(MAXLINE,BUFSIZ)];
char obuf[MAXLINE];
{
char buf[MAX(MAXLINE,BUFSIZ)];
char obuf[MAXLINE];
+ /* suppress Content-Type: if we are not including the body */
+ if (bitset(PF_NOBODYPART, flags) && bitset(H_CTYPE, h->h_flags))
+ {
+ if (tTd(34, 11))
+ printf(" (skipped (content-type))\n");
+ continue;
+ }
+
/* suppress Content-Transfer-Encoding: if we are MIMEing */
if (bitset(H_CTE, h->h_flags) &&
/* suppress Content-Transfer-Encoding: if we are MIMEing */
if (bitset(H_CTE, h->h_flags) &&
- bitset(MCIF_CVT8TO7, mci->mci_flags))
+ (bitset(MCIF_CVT8TO7, mci->mci_flags) ||
+ bitset(PF_NOBODYPART, flags)))
{
if (tTd(34, 11))
printf(" (skipped (content-transfer-encoding))\n");
{
if (tTd(34, 11))
printf(" (skipped (content-transfer-encoding))\n");
# include <string.h>
#ifndef lint
# include <string.h>
#ifndef lint
-static char sccsid[] = "@(#)mime.c 8.8 (Berkeley) %G%";
+static char sccsid[] = "@(#)mime.c 8.9 (Berkeley) %G%";
sprintf(buf, "--%s", bbuf);
putline(buf, mci);
collect(e->e_dfp, FALSE, FALSE, &hdr, e);
sprintf(buf, "--%s", bbuf);
putline(buf, mci);
collect(e->e_dfp, FALSE, FALSE, &hdr, e);
- putheader(mci, hdr, e);
+ putheader(mci, hdr, e, 0);
bt = mime8to7(mci, hdr, e, bbuf);
}
sprintf(buf, "--%s--", bbuf);
bt = mime8to7(mci, hdr, e, bbuf);
}
sprintf(buf, "--%s--", bbuf);
#ifndef lint
#ifdef QUEUE
#ifndef lint
#ifdef QUEUE
-static char sccsid[] = "@(#)queue.c 8.52 (Berkeley) %G% (with queueing)";
+static char sccsid[] = "@(#)queue.c 8.53 (Berkeley) %G% (with queueing)";
-static char sccsid[] = "@(#)queue.c 8.52 (Berkeley) %G% (without queueing)";
+static char sccsid[] = "@(#)queue.c 8.53 (Berkeley) %G% (without queueing)";
#endif
#endif /* not lint */
#endif
#endif /* not lint */
bzero(&mcibuf, sizeof mcibuf);
mcibuf.mci_out = dfp;
mcibuf.mci_mailer = FileMailer;
bzero(&mcibuf, sizeof mcibuf);
mcibuf.mci_out = dfp;
mcibuf.mci_mailer = FileMailer;
- (*e->e_putbody)(&mcibuf, e, NULL);
+ (*e->e_putbody)(&mcibuf, e, NULL, 0);
(void) xfclose(dfp, "queueup dfp", e->e_id);
e->e_putbody = putbody;
}
(void) xfclose(dfp, "queueup dfp", e->e_id);
e->e_putbody = putbody;
}
-static char sccsid[] = "@(#)savemail.c 8.36 (Berkeley) %G%";
+static char sccsid[] = "@(#)savemail.c 8.37 (Berkeley) %G%";
#endif /* not lint */
# include "sendmail.h"
#endif /* not lint */
# include "sendmail.h"
mcibuf.mci_flags |= MCIF_7BIT;
putfromline(&mcibuf, e);
mcibuf.mci_flags |= MCIF_7BIT;
putfromline(&mcibuf, e);
- (*e->e_puthdr)(&mcibuf, e->e_header, e);
- (*e->e_putbody)(&mcibuf, e, NULL);
+ (*e->e_puthdr)(&mcibuf, e->e_header, e, 0);
+ (*e->e_putbody)(&mcibuf, e, NULL, 0);
putline("\n", &mcibuf);
(void) fflush(fp);
state = ferror(fp) ? ESM_PANIC : ESM_DONE;
putline("\n", &mcibuf);
(void) fflush(fp);
state = ferror(fp) ? ESM_PANIC : ESM_DONE;
** mci -- the mailer connection information.
** e -- the envelope we are working in.
** separator -- any possible MIME separator.
** mci -- the mailer connection information.
** e -- the envelope we are working in.
** separator -- any possible MIME separator.
+** flags -- to modify the behaviour.
** Outputs the body of an error message.
*/
** Outputs the body of an error message.
*/
-errbody(mci, e, separator)
+errbody(mci, e, separator, flags)
register MCI *mci;
register ENVELOPE *e;
char *separator;
register MCI *mci;
register ENVELOPE *e;
char *separator;
char *p;
register ADDRESS *q;
bool printheader;
char *p;
register ADDRESS *q;
bool printheader;
char buf[MAXLINE];
if (bitset(MCIF_INHEADER, mci->mci_flags))
char buf[MAXLINE];
if (bitset(MCIF_INHEADER, mci->mci_flags))
if (bitset(EF_NORETURN, e->e_parent->e_flags))
SendBody = FALSE;
if (bitset(EF_NORETURN, e->e_parent->e_flags))
SendBody = FALSE;
+ if (!SendBody)
+ pflags |= PF_NOBODYPART;
putline("", mci);
if (e->e_parent->e_df != NULL)
{
putline("", mci);
if (e->e_parent->e_df != NULL)
{
putline("Content-Type: message/rfc822", mci);
putline("", mci);
}
putline("Content-Type: message/rfc822", mci);
putline("", mci);
}
- putheader(mci, e->e_parent->e_header, e->e_parent);
+ putheader(mci, e->e_parent->e_header, e->e_parent, pflags);
- putbody(mci, e->e_parent, e->e_msgboundary);
+ putbody(mci, e->e_parent, e->e_msgboundary, pflags);
*
* %sccs.include.redist.c%
*
*
* %sccs.include.redist.c%
*
- * @(#)sendmail.h 8.70 (Berkeley) %G%
+ * @(#)sendmail.h 8.71 (Berkeley) %G%
# ifdef _DEFINE
# define EXTERN
# ifndef lint
# ifdef _DEFINE
# define EXTERN
# ifndef lint
-static char SmailSccsId[] = "@(#)sendmail.h 8.70 %G%";
+static char SmailSccsId[] = "@(#)sendmail.h 8.71 %G%";
# endif
# else /* _DEFINE */
# define EXTERN extern
# endif
# else /* _DEFINE */
# define EXTERN extern
# define H_RECEIPTTO 0x0400 /* this field has return receipt info */
# define H_ERRORSTO 0x0800 /* this field has error address info */
# define H_CTE 0x1000 /* this field is a content-transfer-encoding */
# define H_RECEIPTTO 0x0400 /* this field has return receipt info */
# define H_ERRORSTO 0x0800 /* this field has error address info */
# define H_CTE 0x1000 /* this field is a content-transfer-encoding */
+# define H_CTYPE 0x2000 /* this is a content-type field */
\f/*
** Information about currently open connections to mailers, or to
** hosts that we have looked up recently.
\f/*
** Information about currently open connections to mailers, or to
** hosts that we have looked up recently.
short e_sendmode; /* message send mode */
short e_errormode; /* error return mode */
short e_timeoutclass; /* message timeout class */
short e_sendmode; /* message send mode */
short e_errormode; /* error return mode */
short e_timeoutclass; /* message timeout class */
- int (*e_puthdr)__P((MCI *, HDR *, ENVELOPE *));
+ int (*e_puthdr)__P((MCI *, HDR *, ENVELOPE *, int));
/* function to put header of message */
/* function to put header of message */
- int (*e_putbody)__P((MCI *, ENVELOPE *, char *));
+ int (*e_putbody)__P((MCI *, ENVELOPE *, char *, int));
/* function to put body of message */
struct envelope *e_parent; /* the message this one encloses */
struct envelope *e_sibling; /* the next envelope of interest */
/* function to put body of message */
struct envelope *e_parent; /* the message this one encloses */
struct envelope *e_sibling; /* the next envelope of interest */
#define SFF_ROOTOK 0x0004 /* ok for root to own this file */
#define SFF_ROOTOK 0x0004 /* ok for root to own this file */
+/*
+** Flags passed to putheader and putbody.
+*/
+
+#define PF_NOBODYPART 0x0001 /* don't send the body part */
+
+
/*
** Regular UNIX sockaddrs are too small to handle ISO addresses, so
** we are forced to declare a supertype here.
/*
** Regular UNIX sockaddrs are too small to handle ISO addresses, so
** we are forced to declare a supertype here.
-static char sccsid[] = "@(#)usersmtp.c 8.26 (Berkeley) %G% (with SMTP)";
+static char sccsid[] = "@(#)usersmtp.c 8.27 (Berkeley) %G% (with SMTP)";
-static char sccsid[] = "@(#)usersmtp.c 8.26 (Berkeley) %G% (without SMTP)";
+static char sccsid[] = "@(#)usersmtp.c 8.27 (Berkeley) %G% (without SMTP)";
#endif
#endif /* not lint */
#endif
#endif /* not lint */
** Output the actual message.
*/
** Output the actual message.
*/
- (*e->e_puthdr)(mci, e->e_header, e);
- (*e->e_putbody)(mci, e, NULL);
+ (*e->e_puthdr)(mci, e->e_header, e, 0);
+ (*e->e_putbody)(mci, e, NULL, 0);
/*
** Cleanup after sending message.
/*
** Cleanup after sending message.