Mail Address Rule.

Discuss the Scalix Server software

Moderators: ScalixSupport, admin

BaldBoy
Posts: 141
Joined: Fri May 19, 2006 12:45 pm

Re: Mail Address Rule.

Postby BaldBoy » Mon Aug 09, 2010 6:35 am

You could check this reply from florian
http://www.scalix.com/forums/viewtopic.php?f=8&t=2229&start=0

BaldBoy
Posts: 141
Joined: Fri May 19, 2006 12:45 pm

Re: Mail Address Rule.

Postby BaldBoy » Tue Aug 10, 2010 10:05 am

Well you can do that ... with some coding.

NOTE ! What I am going to explain is a hack that will change some core scripts of SAC. Any changes made here will be likely overwritten if you upgrade your Scalix's setup. Before you make any changes ensure you have a backup copy of any touched file ! You're warned.

With hands on Scalix's server ...
  • Open a terminal window and switch to root (su)
  • Navigate to /var/opt/scalix/xx/tomcat/webapps/sac/js
  • With your favourite text editor edit file Strings.js
  • Locate the following string : UIstrings.ID.Gis = "Firstil";
  • Insert a new line immediately after and paste the following :

    Code: Select all

    UIstrings.ID.S = "Last";
  • Save the file and close
  • Now edit the file SettingsInfo.js
  • Locate the following block of code :

    Code: Select all

    SettingsInfo.mailAddressTemplates = new Array();
    SettingsInfo.fullMailAddressTemplates = new Array();
    SettingsInfo.authIdTemplates = new Array();
    SettingsInfo.fullAuthIdTemplates = new Array();
  • Immediately BEFORE that block make some room to paste the following:

    Code: Select all

    // '"C" <S>'
    SettingsInfo.computeIdS = function(calcObj, nameObj, includeDomain) {
      var str = "";
      if (nameObj.surName != null && nameObj.surName != "") {
        str = nameObj.surName;
      }
      str = str.replace(SettingsInfo.IdIllegalCharactersRegExp, SettingsInfo.convertChar);

      if (str != "" && includeDomain && nameObj.authIdDomain != "") {
        str += "@" + nameObj.authIdDomain;
      }
      return str;
    };
  • Now locate this block of code:

    Code: Select all

    SettingsInfo.authIdTemplates["Gis"] =
        SettingsInfo.fullAuthIdTemplates["Gis"] =
            SettingsInfoBaseTemplate.create("Gis", UIstrings.ID.Gis, SettingsInfo.computeIdGis, null, false);
  • Immediately AFTER that block paste the following :

    Code: Select all

    SettingsInfo.fullMailAddressTemplates['"C" <S>'] =
        SettingsInfo.mailAddressTemplates['"C" <S>'] =
            SettingsInfoBaseTemplate.create('"C" <S>', UIstrings.ID.S, SettingsInfo.computeIdS, null, false);

    SettingsInfo.authIdTemplates["S"] =
        SettingsInfo.fullAuthIdTemplates["S"] =
            SettingsInfoBaseTemplate.create("S", UIstrings.ID.S, SettingsInfo.computeIdS, null, false);
  • Save the file and close
  • Now access the SAC (if you already had an open session, close it and reopen it)
  • Go to the "Settings" section
  • In the "General" tab you now have the option to select "Last" either for "Authentication ID rule" and "Mail Address Rule"

Have fun !

les
Scalix Star
Scalix Star
Posts: 819
Joined: Thu Feb 23, 2006 10:18 am
Location: Sydney, Australia

Re: Mail Address Rule.

Postby les » Wed Aug 11, 2010 10:49 am

Baldboy...thats great. it seems so simple (yet it would have taken you a while to figure out). Kudos for sharing.

I remember years back asking scalix for this but it all fell on deaf ears. Perhaps now you could post it to the feedback forum and it might get rolled into 11.4.7 or 11.5.....you've done all the hard work for them ;)
Regards,

Les Stott

BaldBoy
Posts: 141
Joined: Fri May 19, 2006 12:45 pm

Re: Mail Address Rule.

Postby BaldBoy » Wed Aug 11, 2010 1:04 pm

Thanks for the compliments les.
I've really have not done nothing particular: just cloned already existing functions to accomplish "Last" only rule.

However I would not subscribe for such an option to be implemented by default in future releases. Let me explain:
  • In my experience I've almost never seen email addresses in the form last@domain. Not-written standard rules, lead by common sense, are the ones already covered by scalix's default settings.
  • The risk of creation of duplicated IDs is very high: this could lead non-experienced users to wonder why this is happening.

Nevertheless the real important thing is that with Scalix if you want, you can. That's the cornerstone !

On first impact I was tempted not to follow this statement from BooBoo
I do not want to add users by command line. I just want to have an entry like "Last" in the drop down menu in the SAC, to add rule like last@domain.


This is quite a Windows' customer philosophy : I want a button I can click on ... that's it ! No matter what happens behind the scenes.
And when they drop into linux's world they try to apply the same method assuming their whishes will be satisfied for free. (There is a wide misconception about everything which is not Windows has to be necessary free and "for-free"). That's not valid for Scalix, and, more generally speaking, for Linux's related world. It gives you many benefits, in 99% of cases for a lot less money, but there is a secondary price to pay: knowledge.

Talking about Mail Messaging and Collaboration ... if you're not prepared to dirt your hands with scalix and learn how it can be your swiss army knife, well ... put your hands deeply into your pocket, go for Windows Server and Exchange (you have to pay for both) and click Next, then Next, then again Next and, eventually ... "Finish".

I've been with Scalix for three years right now and really love this product and it's manageabilty: I wish many people more could feel the same .... that's why, when I have time, I come here to help.

les
Scalix Star
Scalix Star
Posts: 819
Joined: Thu Feb 23, 2006 10:18 am
Location: Sydney, Australia

Re: Mail Address Rule.

Postby les » Wed Aug 11, 2010 6:37 pm

BaldBoy wrote:Thanks for the compliments les.
I've really have not done nothing particular: just cloned already existing functions to accomplish "Last" only rule.

However I would not subscribe for such an option to be implemented by default in future releases. Let me explain:
  • In my experience I've almost never seen email addresses in the form last@domain. Not-written standard rules, lead by common sense, are the ones already covered by scalix's default settings.
  • The risk of creation of duplicated IDs is very high: this could lead non-experienced users to wonder why this is happening.



When i needed it for a client they wanted a "first" only (first@domain.com) rule. And that was not available/too hard (had to settle for first.l and manually edit addresses on the fly). Whether its non standard or not shouldn't matter, its what the customer wants at the end of the day, and it should be easy for them. And if that means a gui with click next - next - finish, then thats what they should be able to get.

SAC already does this (click next, next finish) in the gui, if you leave the defaults it will auto create a user email address and authid, based on rules. it won't let you create a user with the same auth id or common name. Those rules should be flexible.

Don't get me wrong, i think Scalix is a great product and i've got it installed in multiple sites. This is just a simple request, and to me its like an icing on the cake thing for Scalix.
Regards,

Les Stott

BaldBoy
Posts: 141
Joined: Fri May 19, 2006 12:45 pm

Re: Mail Address Rule.

Postby BaldBoy » Thu Aug 12, 2010 7:04 am

You're right les!
And of course I did not want to argue with you. Sorry if you meant that.

It was just my thinking-out-loud.


Return to “Scalix Server”



Who is online

Users browsing this forum: No registered users and 11 guests