Antwort: Re: rewrite "from" for sudo mails

barbara.ruess at allianz.de barbara.ruess at allianz.de
Wed Apr 23 05:01:20 EDT 2003


A colleague of mine has solved the problem:
additionally to what you told me, we have defined         mailerflags=" -t
-f newuser at xxx.com"     in the sudoers Defaults section.
Messages appear to be from newuser at xxx.com if and only if we make the
modification in logging.c and mailerflags as well.

Barbara



                                                                                                                                       
                      Todd.Miller at cour                                                                                                 
                      tesan.com                An:      Barbara Ruess/STG/AGIS at AGIS                                                    
                                               Kopie:   sudo-users at sudo.ws                                                             
                      24.03.03 22:12           Thema:   Re: rewrite "from" for sudo mails                                              
                                                                                                                                       
                                                                                                                                       



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