Add mailfrom Defaults option that sets the value of the From:

field in the warning/error mail.  If unset the login name of
the invoking user is used.
This commit is contained in:
Todd C. Miller
2008-03-05 21:52:19 +00:00
parent 2314fd903b
commit 0f9e7f96f4
7 changed files with 106 additions and 84 deletions

View File

@@ -510,7 +510,7 @@ send_mail(line)
/* Pipes are all setup, send message via sendmail. */
(void) fprintf(mail, "To: %s\nFrom: %s\nAuto-Submitted: %s\nSubject: ",
def_mailto, user_name, "auto-generated");
def_mailto, def_mailfrom ? def_mailfrom : user_name, "auto-generated");
for (p = def_mailsub; *p; p++) {
/* Expand escapes in the subject */
if (*p == '%' && *(p+1) != '%') {