rewrite "from" for sudo mails

Todd C. Miller Todd.Miller at courtesan.com
Mon Mar 24 16:11:49 EST 2003


In message <OF0D87BF0D.5C10B759-ONC1256CF3.00323F9A at muc.allianz>
	so spake  (barbara.ruess):

> We"hacked" the code like Todd told me. Unfortunately this doesn't work -
> mails still have the user's from address.
> I'm sure we compiled the correct file since we can see the mail address we
> have put in logging.c  with the command "strings sudo".
> Are there any additional modifications that need to be done?

Strange, that works fine for me.   I made the following change
to cause messages to appear to be from sudo at courtesan.com.

 - todd

Index: logging.c
===================================================================
RCS file: /cvs/src/usr.bin/sudo/logging.c,v
retrieving revision 1.10
diff -u -r1.10 logging.c
--- logging.c	20 Mar 2003 02:06:58 -0000	1.10
+++ logging.c	24 Mar 2003 21:09:29 -0000
@@ -525,7 +525,7 @@
 
     /* Pipes are all setup, send message via sendmail. */
     (void) fprintf(mail, "To: %s\nFrom: %s\nSubject: ",
-	def_str(I_MAILTO), user_name);
+	def_str(I_MAILTO), "sudo at courtesan.com");
     for (p = def_str(I_MAILSUB); *p; p++) {
 	/* Expand escapes in the subject */
 	if (*p == '%' && *(p+1) != '%') {


More information about the sudo-users mailing list