[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [cobalt-users] virtusertable - Non Gui Add



On Saturday, May 12, 2001, at 06:42 PM, baltimoremd@xxxxxxxxxxxxxxx wrote:

Anyone have a script that would allow the addition of addresses
to virtusertable below the
# Put custom additions below (Do not change/remove this line).

Thanks
Thom

baltimoremd@xxxxxxxxxxxxxxx             Thom LaCosta K3HRN Webmaster

_______________________________________________
cobalt-users mailing list
cobalt-users@xxxxxxxxxxxxxxx
To Subscribe or Unsubscribe, please go to:
http://list.cobalt.com/mailman/listinfo/cobalt-users


Hello Thom,

You can get fancier, but this will work as run by root. If you need more functionality please email me, I love churning out scripts. :) This is based upon the fact that you would be entering into the virtusertable entries such as user@xxxxxxxxxxxxxxxxxx being forwarded to either username or username@xxxxxxxxxxxxxxxxxxxxxxxxx Also, I have just used the same user name in both domains, but of course this could be changed. I know I have been wordy but anyway ...

Eric

#!/bin/bash
NAME=$1
DOMAIN=$2
RESULT=$3
if [ "$1" = "" ]; then
        echo "Usage is ./adduser.sh username domain destination"
        exit 1
fi
if [ "$2" = "" ]; then
        echo "Usage is ./adduser.sh username domain destination"
        exit 1
fi
if [ "$3" = "" ]; then
        echo "Usage is ./adduser.sh username domain destination"
        exit 1
fi
echo $NAME"@"$DOMAIN" "$NAME"@"$RESULT >> /etc/mail/virtusertable
makemap hash /etc/mail/virtusertable < /etc/mail/virtusertable