an SMTP transcript, only send the last half (i.e., that part which
describes the sending half).
SCCS-mr: usr.sbin/sendmail/src/version.c 142
SCCS-vsn: usr.sbin/sendmail/src/queue.c 3.68
SCCS-vsn: usr.sbin/sendmail/src/envelope.c 3.6
SCCS-vsn: usr.sbin/sendmail/src/srvrsmtp.c 3.43
SCCS-vsn: usr.sbin/sendmail/src/version.c 3.291
#include "sendmail.h"
#include <sys/stat.h>
#include "sendmail.h"
#include <sys/stat.h>
-SCCSID(@(#)envelope.c 3.5 %G%);
+SCCSID(@(#)envelope.c 3.6 %G%);
/*
** NEWENVELOPE -- allocate a new envelope
/*
** NEWENVELOPE -- allocate a new envelope
queueup(e, FALSE, FALSE);
/* now unlock the job */
queueup(e, FALSE, FALSE);
/* now unlock the job */
- if (e->e_xfp != NULL)
- (void) fclose(e->e_xfp);
unlockqueue(e);
/* make sure that this envelope is marked unused */
e->e_id = e->e_df = NULL;
unlockqueue(e);
/* make sure that this envelope is marked unused */
e->e_id = e->e_df = NULL;
- e->e_dfp = e->e_xfp = NULL;
}
\f/*
** CLEARENVELOPE -- clear an envelope without unlocking
}
\f/*
** CLEARENVELOPE -- clear an envelope without unlocking
{
/* remove the transcript */
#ifdef DEBUG
{
/* remove the transcript */
#ifdef DEBUG
+# ifdef LOG
+ if (LogLevel > 19)
+ syslog(LOG_DEBUG, "%s: unlock", e->e_id);
+# endif LOG
if (!tTd(51, 4))
#endif DEBUG
xunlink(queuename(e, 'x'));
if (!tTd(51, 4))
#endif DEBUG
xunlink(queuename(e, 'x'));
# ifdef DEBUG
if (tTd(7, 1))
printf("queuename: assigned id %s, env=%x\n", e->e_id, e);
# ifdef DEBUG
if (tTd(7, 1))
printf("queuename: assigned id %s, env=%x\n", e->e_id, e);
+# ifdef LOG
+ if (LogLevel > 16)
+ syslog(LOG_DEBUG, "%s: assigned id", e->e_id);
+# endif LOG
+# ifdef LOG
+ if (LogLevel > 19)
+ syslog(LOG_DEBUG, "%s: openx%s", e->e_id, e->e_xfp == NULL ? "" : " (no)");
+# endif LOG
if (e->e_xfp != NULL)
return;
p = queuename(e, 'x');
if (e->e_xfp != NULL)
return;
p = queuename(e, 'x');
(void) chmod(p, 0644);
}
\f/*
(void) chmod(p, 0644);
}
\f/*
+** CLOSEXSCRIPT -- close the transcript file.
+**
+** Parameters:
+** e -- the envelope containing the transcript to close.
+**
+** Returns:
+** none.
+**
+** Side Effects:
+** none.
+*/
+
+closexscript(e)
+ register ENVELOPE *e;
+{
+ if (e->e_xfp == NULL)
+ return;
+ (void) fclose(e->e_xfp);
+ e->e_xfp = NULL;
+}
+\f/*
** SETSENDER -- set the person who this message is from
**
** Under certain circumstances allow the user to say who
** SETSENDER -- set the person who this message is from
**
** Under certain circumstances allow the user to say who
# include <errno.h>
# ifndef QUEUE
# include <errno.h>
# ifndef QUEUE
-SCCSID(@(#)queue.c 3.67 %G% (no queueing));
+SCCSID(@(#)queue.c 3.68 %G% (no queueing));
-SCCSID(@(#)queue.c 3.67 %G%);
+SCCSID(@(#)queue.c 3.68 %G%);
/* set basic modes, etc. */
(void) alarm(0);
/* set basic modes, etc. */
(void) alarm(0);
CurEnv->e_flags &= ~EF_FATALERRS;
QueueRun = TRUE;
ErrorMode = EM_MAIL;
CurEnv->e_flags &= ~EF_FATALERRS;
QueueRun = TRUE;
ErrorMode = EM_MAIL;
# include "sendmail.h"
# ifndef SMTP
# include "sendmail.h"
# ifndef SMTP
-SCCSID(@(#)srvrsmtp.c 3.42 %G% (no SMTP));
+SCCSID(@(#)srvrsmtp.c 3.43 %G% (no SMTP));
-SCCSID(@(#)srvrsmtp.c 3.42 %G%);
+SCCSID(@(#)srvrsmtp.c 3.43 %G%);
/*
** SMTP -- run the SMTP protocol.
/*
** SMTP -- run the SMTP protocol.
** In any case, don't mail back errors for
** anything that has happened up to
** now (the other end will do this).
** In any case, don't mail back errors for
** anything that has happened up to
** now (the other end will do this).
+ ** Truncate our transcript -- the mail has gotten
+ ** to us successfully, and if we have
+ ** to mail this back, it will be easier
+ ** on the reader.
** Then send to everyone.
** Finally give a reply code. If an error has
** already been given, don't mail a
** Then send to everyone.
** Finally give a reply code. If an error has
** already been given, don't mail a
ErrorMode == EM_MAIL;
}
CurEnv->e_flags &= ~EF_FATALERRS;
ErrorMode == EM_MAIL;
}
CurEnv->e_flags &= ~EF_FATALERRS;
+ CurEnv->e_xfp = freopen(queuename(CurEnv, 'x'), "w", CurEnv->e_xfp);
/* send to all recipients */
sendall(CurEnv, SendMode);
/* send to all recipients */
sendall(CurEnv, SendMode);
-static char SccsId[] = "@(#)SendMail version 3.290 of %G%";
+static char SccsId[] = "@(#)SendMail version 3.291 of %G%";
-char Version[] = "3.290 [%G%]";
+char Version[] = "3.291 [%G%]";