How to get the User-E-Mail in the "Before And After"-User Edit/Create Commands?

Howdy!

Because I want to create a Zarafa-user for every Virtualmin-User, I need to extract the E-Mail-Adress of the current User in the “Before and After”-Commands in the Useradmin.

I found a similar Thread concerning this, but i think, this was only for LDAP.

My custom.sh looks like this (where $USERADMIN_USER after the -e parameter should be replaced by the email:

#!/bin/sh
if [ “$USERADMIN_ACTION” = “CREATE_USER” ]; then

/usr/bin/zarafa-admin -c $USERADMIN_USER -p $USERADMIN_PASS -e $USERADMIN_USER -f “$USERADMIN_REAL” -a 0

fi

if [ “$USERADMIN_ACTION” = “MODIFY_USER” ]; then

/usr/bin/zarafa-admin -u $USERADMIN_USER -p $USERADMIN_PASS -e $USERADMIN_USER -f “$USERADMIN_REAL” -a 0

fi

if [ “$USERADMIN_ACTION” = “DELETE_USER” ]; then

/usr/bin/zarafa-admin -d $USERADMIN_USER

fi

Any Suggestions? Thanks!

No help on this topic?

What happens when you try running your script? If it’s not working, let us know what error messages you’re receiving.

If you’re not getting any output from your script to troubleshoot the problem, you may need to configure it to generate more output, perhaps to a logfile of some sort.

But, your above script appears to be a good start :slight_smile:

-Eric

Hey,

the above script works very well; but I need the Mail-Adress!

:slight_smile:

It can’t be generated out of the given Variables!

Did you ever work this out as I am trying to do the same thing?

I’m sorry, but i didn’t get it to work!

So I have to to that part manually.