[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: Mail: From Question

From: Jamie Lawrence <jal_at_jal.org>
Date: 2005-09-16 20:41:25 CEST

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
Received on Fri Sep 16 20:43:29 2005

This is an archived mail posted to the Subversion Users mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.