wrapper skript for e-mail folders

Discuss the Scalix Server software

Moderators: ScalixSupport, admin

TCWardrobe
Posts: 64
Joined: Fri Aug 18, 2006 7:33 pm

wrapper skript for e-mail folders

Postby TCWardrobe » Mon Aug 28, 2006 9:30 pm

Hi folks!

As I start using scalix I see many somehow cryptic commands which often caused trouble for some users, me included. As I did not find anything compareable I started this one. It is based upon the advanced bash scriptung guide template for getopt_simple. I am in no way a bash professional so please bare with me, don't complain, edit it so it is more useful, less erroneous, more userfriendly, less sluggish written, more convinient and of course more powerful.
As you see I left a bunch of unuseful lines in it... more or less intention, I like verbosity and the template gave a good start (even if I've found a more reasonable template... anyway, it's late, I'm tired, good night :)

Code: Select all

#!/bin/bash
# create-email-folder.sh a convinient way to add
# an emailable folder for scalix
#
# Author: Michael Schmitt
# Contributors:
#
# copy, use, edit, enhance it or throw it away. Do
# whatever you want as long as nobody is hurt...
# and of course it is covered by the GPL ;)
# template used was getopt_simple from
# http://www.tldp.org/LDP/abs/html/

echo Usage: create-email-folder.sh -n=foldername -m1=mailnode1 -m2=mailnode2 -e=e-mailaddress
echo Note:  -m1 and -m2 represent your mailnode as m1,m2 syntax
echo        as I am to dumb to parse the output of omshowmn in a smart way

create_folder()
{
    echo "create_folder()"
    echo "Parameters are '$*'"
    until [ -z "$1" ]
    do
      echo "Processing parameter of: '$1'"
      if [ ${1:0:1} = '-' ]
      then
          tmp=${1:1}               # Strip off leading '-' . . .
          parameter=${tmp%%=*}     # Extract name.
          value=${tmp##*=}         # Extract value.
          echo "Parameter: '$parameter', value: '$value'"
          eval $parameter=$value
      fi
      shift
    done
}

# Pass all options to create_folder().
create_folder $*

echo "Foldername is '$n'"
echo "Mailnode1 is '$m1'"
echo "Mailnode2 is '$m2'"
echo "Mailaddress is '$e'"

omaddent -e "S=+BB/CN=$n/OU1=$m1/OU2=$m2/DDT1=BB/DDV1=$n/IA=$e"
exit 0


greetings
Michael

florian
Scalix
Scalix
Posts: 3852
Joined: Fri Dec 24, 2004 8:16 am
Location: Frankfurt, Germany
Contact:

Postby florian » Tue Aug 29, 2006 12:14 pm

Hi Michael,

thanks - that's very useful - would you mind posting it to the Wiki at www.scalix.com/wiki, somewhere under the howto-section.

There is a public folder How-To already - if you would add the script to there, highly appreciated! :-)

http://www.scalix.com/wiki/index.php?ti ... ic_Folders

Thx,
Florian.
Florian von Kurnatowski, Die Harder!

TCWardrobe
Posts: 64
Joined: Fri Aug 18, 2006 7:33 pm

Postby TCWardrobe » Tue Aug 29, 2006 3:37 pm

Even if I would not post this one at that early stage in the wiki on my own, but you ordered me to do so, YES SIR! DONE, SIR! :)


Return to “Scalix Server”



Who is online

Users browsing this forum: No registered users and 5 guests

cron