[SAC] LDAP emails

Sandro Santilli strk at keybit.net
Mon Oct 19 03:13:57 PDT 2015


On Mon, Oct 19, 2015 at 12:02:06PM +0200, Martin Spott wrote:
> On Mon, Oct 19, 2015 at 11:17:45AM +0200, Martin Spott wrote:
> 
> > tracsvn: 2:17:01 ~> [...]
> 
> Maybe refine the awk-statement to:
> 
>   awk 'BEGIN{FS=":|: "} /^mail:/ {print $2}'
> 
> .... just to be on the safe side.
> 
> Moreover I found out that the manpage recommends to add quotes and
> braces for the search even if it's only one single attribute/value
> pair.  Thus, replace
> 
>   uid=strk
> 
> by
> 
>   "(uid=strk)"

Thanks, updated with:

/usr/bin/ldapsearch -H ldaps://ldap.osgeo.org/ \
  -b dc=osgeo,dc=org -x \
  "(uid=${author})" mail \
  | grep '^mail:' | cut -d: -f2

> If you expect non-ASCII characters in EMail adresses, things might get
> a little more complicated  ;-)

Not in the email part. I actually expect them in the "cn" field
which seem to be the real name (Common Name?) but for now that
field is not used by the script

--strk;


More information about the Sac mailing list