You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@subversion.apache.org by Michael Lee <mp...@hpcn.ca.sandia.gov> on 2005/09/16 18:26:13 UTC

Mail: From Question

I'm using the commit-email.pl script to send out a notification to a
mailing list when a write has occurred.  I noticed that the body of the
e-mails have:

Author: bsaget
Date: 2005-09-16 06:14:58 -0700 (Fri, 16 Sep 2005)
New Revision: 2

And that the e-mail is addressed from "bsaget@mysite.com"

Can someone give me suggestions to have the system usernames resolved to
their full, real names ("Bob Saget" instead of "bsaget") in both the
body and From header?  

Write access to the repository is controlled by an svn-auth-file, which
does have the usernames "bsaget," "bwayne," etc.  

Thanks,
Michael


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org

Re: Mail: From Question

Posted by Jamie Lawrence <ja...@jal.org>.
On Tue, 20 Sep 2005, Dale R. Worley wrote:

>     split(/:/, $line);
>     next unless $_[0] eq $user;
>     $user = $_[4];


Much better, yes. I seem to recall that I was elbow deep in regexes that
day, so everything looked like a pattern match.

-j


-- 
Jamie Lawrence                                        jal@jal.org


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org

Re: Mail: From Question

Posted by "Dale R. Worley" <dw...@pingtel.com>.
On Fri, 2005-09-16 at 14:41 -0400, Jamie Lawrence wrote:

> open PASSWD, "</etc/passwd" or die "$!";
> While ($line = <PASSWD>) {
> 	next if ( $line !=~ /^$user/ );
> 	$user =~ s/^.*?:.*?:.*:.*?:(.*?):.*$/$1/;
> }

    split(/:/, $line);
    next unless $_[0] eq $user;
    $user = $_[4];

Dale



---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org

Re: Mail: From Question

Posted by Jamie Lawrence <ja...@jal.org>.
On Fri, 16 Sep 2005, Michael Lee wrote:

> I'm using the commit-email.pl script to send out a notification to a
> mailing list when a write has occurred.  I noticed that the body of the
> e-mails have:
> 
> Author: bsaget
> Date: 2005-09-16 06:14:58 -0700 (Fri, 16 Sep 2005)
> New Revision: 2
> 
> And that the e-mail is addressed from "bsaget@mysite.com"
> 
> Can someone give me suggestions to have the system usernames resolved to
> their full, real names ("Bob Saget" instead of "bsaget") in both the
> body and From header?  
> 
> Write access to the repository is controlled by an svn-auth-file, which
> does have the usernames "bsaget," "bwayne," etc.  

Without looking at the script, I'd hazard that it shouldn't be too hard
to grep /etc/passwd for the GCOS field.  e.g., add something like: 

open PASSWD, "</etc/passwd" or die "$!";
While ($line = <PASSWD>) {
	next if ( $line !=~ /^$user/ );
	$user =~ s/^.*?:.*?:.*:.*?:(.*?):.*$/$1/;
}

You'll probably want to mangle the address to be still valid, so that
people can still reply.

(No, I didn't test that regex, and yes, it is probably a bad idea. For
illustrative purposes only.)

-j


-- 
Jamie Lawrence                                        jal@jal.org
Things could always be worse; for instance, you could be ugly and 
work in the Post Office.
   - Adrienne E. Gusoff



---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org