SCCS-vsn: usr.sbin/sendmail/src/savemail.c 3.19
SCCS-vsn: usr.sbin/sendmail/src/version.c 3.45
SCCS-vsn: usr.sbin/sendmail/src/macro.c 3.5
# include "useful.h"
# include "conf.h"
# include "useful.h"
# include "conf.h"
-static char SccsId[] = "@(#)macro.c 3.4.1.1 %G%";
+static char SccsId[] = "@(#)macro.c 3.5 %G%";
char *Macro[128];
extern int Debug;
char *Macro[128];
extern int Debug;
# endif DEBUG
Macro[n & 0177] = v;
}
# endif DEBUG
Macro[n & 0177] = v;
}
+\f/*
+** MACVALUE -- return uninterpreted value of a macro.
+**
+** Parameters:
+** n -- the name of the macro.
+**
+** Returns:
+** The value of n.
+**
+** Side Effects:
+** none.
+*/
+
+char *
+macvalue(n)
+ char n;
+{
+ return (Macro[n & 0177]);
+}
# include <pwd.h>
# include "sendmail.h"
# include <pwd.h>
# include "sendmail.h"
-static char SccsId[] = "@(#)savemail.c 3.18 %G%";
+static char SccsId[] = "@(#)savemail.c 3.19 %G%";
/*
** SAVEMAIL -- Save mail on error
/*
** SAVEMAIL -- Save mail on error
{
char buf[MAXLINE];
register FILE *xfile;
{
char buf[MAXLINE];
register FILE *xfile;
+ extern char *macvalue();
+ char *oldfmac;
+ char *oldgmac;
+
+ oldfmac = macvalue('f');
+ define('f', "$n");
+ oldgmac = macvalue('g');
+ define('g', m->m_from);
(void) fflush(stdout);
if ((xfile = fopen(Transcript, "r")) == NULL)
syserr("Cannot open %s", Transcript);
errno = 0;
(void) fflush(stdout);
if ((xfile = fopen(Transcript, "r")) == NULL)
syserr("Cannot open %s", Transcript);
errno = 0;
+ /*
+ ** Output "From" line unless supressed
+ */
+
+ if (!bitset(M_NHDR, m->m_flags))
+ {
+ (void) expand("$l", buf, &buf[sizeof buf - 1]);
+ fprintf(fp, "%s\n", buf);
+ }
+
/*
** Output header of error message.
*/
/*
** Output header of error message.
*/
fprintf(fp, "To: %s\n", To);
fprintf(fp, "Subject: Unable to deliver mail\n");
fprintf(fp, "To: %s\n", To);
fprintf(fp, "Subject: Unable to deliver mail\n");
+ /*
+ ** End of error message header
+ */
+
+ define('f', oldfmac);
+ define('g', oldgmac);
+
/*
** Output transcript of errors
*/
/*
** Output transcript of errors
*/
-static char SccsId[] = "@(#)SendMail version 3.44 of %G%";
+static char SccsId[] = "@(#)SendMail version 3.45 of %G%";
-char Version[] = "3.44 [%G%]";
+char Version[] = "3.45 [%G%]";