replying; other stuff if appropriate
SCCS-vsn: usr.bin/mail/aux.c 1.5
* Auxiliary functions.
*/
* Auxiliary functions.
*/
-static char *SccsId = "@(#)aux.c 1.4 %G%";
+static char *SccsId = "@(#)aux.c 1.5 %G%";
/*
* Return a pointer to a dynamic copy of the argument.
/*
* Return a pointer to a dynamic copy of the argument.
/*
* Fetch the sender's name from the passed message.
/*
* Fetch the sender's name from the passed message.
+ * If fetching this name for replying purposes, do not
+ * return sender:
register struct message *mp;
{
char namebuf[LINESIZE];
register struct message *mp;
{
char namebuf[LINESIZE];
register FILE *ibuf;
int first = 1;
register FILE *ibuf;
int first = 1;
- if ((cp = hfield("reply-to", mp)) != NOSTR) {
+ if ((cp = hfield("from", mp)) != NOSTR) {
+ strcpy(namebuf, cp);
+ return(savestr(namebuf));
+ }
+ if (!reply && (cp = hfield("sender", mp)) != NOSTR) {
strcpy(namebuf, cp);
return(savestr(namebuf));
}
strcpy(namebuf, cp);
return(savestr(namebuf));
}