Contacts - File As - change default

Discuss your pilot or production implementation with other Zimbra admins or our engineers.
ivica.glavocic
Posts: 9
Joined: Tue Oct 09, 2018 3:06 pm

Contacts - File As - change default

Postby ivica.glavocic » Fri Oct 19, 2018 2:17 pm

Hi all

By default, when creating new contact, File As is set to "Last, First"
How can I change order to "First, Last" for all existing and new accounts?
COS maybe? Searched a lot, couldn't find an answer.

Thanks, regards
Ivica


User avatar
DualBoot
Outstanding Member
Outstanding Member
Posts: 806
Joined: Mon Apr 18, 2016 8:18 pm
Location: Earth
ZCS/ZD Version: ZCS FLOSS - 8.7.11 Mutli servers

Re: Contacts - File As - change default

Postby DualBoot » Mon Oct 22, 2018 2:12 pm

Hello,

as far as I know, it is by design.

Regards,
ivica.glavocic
Posts: 9
Joined: Tue Oct 09, 2018 3:06 pm

Re: Contacts - File As - change default

Postby ivica.glavocic » Wed Oct 24, 2018 8:52 am

We are migrating 200 users from Exchange to Zimbra, does it mean that we will have to change order for all 200 users manually, if possible at all?
Also every additional entry will have to be manually changed?
Very annoying limitation. Can't believe that this option is not covered, it is basic stuff.
Thanks, regards, Ivica
User avatar
JDunphy
Outstanding Member
Outstanding Member
Posts: 302
Joined: Fri Sep 12, 2014 11:18 pm
Location: Victoria, BC
ZCS/ZD Version: Release 8.7.11_GA_1854.RHEL6_64.P7
Contact:

Re: Contacts - File As - change default

Postby JDunphy » Wed Oct 24, 2018 2:46 pm

I remembering have this exact same problem years ago. I went digging and found the script I used. Here is what I did for just a few users.

Code: Select all

#!/usr/bin/perl

#
# Step1: get list of contacts into a file
#        zmmailbox -z -m user@example.com gact > /tmp/user
# Step2: cat /tmp/user | argv[0]

# fileAs number
#(Blank) = Last, First
#1 = Last, First
#2 = First Last
#3 = Company
#4 = Last, First (Company)
#5 = First Last (Company)
#6 = Company (Last, First)
#7 = Company (First Last)
#8 = Custom - one must type: 8:<custom string>
#

#need email address
$emailAddr=shift(@ARGV);
if (!$emailAddr)
{
        printf "usage: %s: email address\n",$0;
}

sub FileAs {
 my($Id) = @_;

 #printf "zmmailbox -z -m user\@example.com mcta %s fileAs 1\n",$Id;
 printf "zmmailbox -z -m %s mcta %s fileAs 1\n",$emailAddr,$Id;
}

my $data = do { local $/; <STDIN> };
@data = split(/Id:/,$data);

foreach (@data)
{
        #default was 2
        if ($_ =~ /fileAs:\s*/)
        {

          # dont' touch group fileAs or existing ones that are file correctly
           if (($_ =~ m#type: group#) || ($_ =~ m#fileAs:\s*1#)) { next;}

            my ($Id) = $_ =~ m#\s+(\d+)#;
            if ($_ =~ m#/Contacts#)
            {
                FileAs($Id);
                #printf "[%s]\n",$_;
            }
        }
}

I drove the above script with this bash script.

Code: Select all

#!/bin/sh

#
# as zimbra user.
#
# To see what would change:
#     usage: /home/jad/Zimbra/scripts/zimbra-build-gact.sh
#
# To execute the changes:
#     usage: /home/jad/Zimbra/scripts/zimbra-build-gact.sh  | sh
#
pathname=/home/jad/Zimbra/scripts

# replace with this for list of all users... [domain] optional
# zmprov -l gaa [domain]
for i in user1 user2 user3 user4
do
   zmmailbox -z -m $i@example.com gact | $pathname/zimbra-contacts-fileAs.pl $i@example.com
done

exit 0

For 200 users, It would make more sense to just run the zmprov -l gaa after filtering out the spam/hash accounts. This might get you closer for your users.

HTH,

Jim

Return to “Administrators”

Who is online

Users browsing this forum: Google [Bot] and 8 guests