- *bang = '\0';
- expand("From $f $d remote from $g\n", buf,
- &buf[sizeof buf - 1], CurEnv);
- *bang = '!';
- }
- else
-# endif UGLYUUCP
- expand("$l\n", buf, &buf[sizeof buf - 1], CurEnv);
- putline(buf, fp, bitset(M_FULLSMTP, m->m_flags));
-}
-\f/*
-** PUTHEADER -- put the header part of a message from the in-core copy
-**
-** Parameters:
-** fp -- file to put it on.
-** m -- mailer to use.
-** e -- envelope to use.
-**
-** Returns:
-** none.
-**
-** Side Effects:
-** none.
-*/
-
-putheader(fp, m, e)
- register FILE *fp;
- register struct mailer *m;
- register ENVELOPE *e;
-{
- char buf[BUFSIZ];
- register HDR *h;
- extern char *arpadate();
- extern char *capitalize();
- extern char *hvalue();
- extern bool samefrom();
- char *of_line;
- char obuf[MAXLINE];
- register char *obp;
- bool fullsmtp = bitset(M_FULLSMTP, m->m_flags);
-
- of_line = hvalue("original-from");
- for (h = e->e_header; h != NULL; h = h->h_link)
- {
- register char *p;
- char *origfrom = e->e_origfrom;
- bool nooutput;
-
- nooutput = FALSE;
- if (bitset(H_CHECK|H_ACHECK, h->h_flags) && !bitset(h->h_mflags, m->m_flags))
- nooutput = TRUE;
-
- /* use From: line from message if generated is the same */
- p = h->h_value;
- if (strcmp(h->h_field, "from") == 0 && origfrom != NULL &&
- strcmp(m->m_from, "$f") == 0 && of_line == NULL)
- {
- p = origfrom;
- origfrom = NULL;
- }
- else if (bitset(H_DEFAULT, h->h_flags))
- {
- /* macro expand value if generated internally */
- expand(h->h_value, buf, &buf[sizeof buf], e);
- p = buf;
- }
- else if (bitset(H_ADDR, h->h_flags))
- {
- if (p == NULL || *p == '\0' || nooutput)
- continue;
- commaize(p, capitalize(h->h_field), fp, e->e_oldstyle, m);
- nooutput = TRUE;
- }
- if (p == NULL || *p == '\0')
- continue;
-
- /* hack, hack -- output Original-From field if different */
- if (strcmp(h->h_field, "from") == 0 && origfrom != NULL)