Contacts - File As - change default

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

Contacts - File As - change default

Post by ivica.glavocic »

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
Elite member
Elite member
Posts: 1326
Joined: Mon Apr 18, 2016 8:18 pm
Location: France - Earth
ZCS/ZD Version: ZCS FLOSS - 8.8.15 Mutli servers
Contact:

Re: Contacts - File As - change default

Post by DualBoot »

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

Post by ivica.glavocic »

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: 889
Joined: Fri Sep 12, 2014 11:18 pm
Location: Victoria, BC
ZCS/ZD Version: 9.0.0_P39 NETWORK Edition

Re: Contacts - File As - change default

Post by JDunphy »

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
kamesh
Posts: 1
Joined: Thu May 20, 2021 1:08 pm

Re: Contacts - File As - change default

Post by kamesh »

Were there any options added in console or CLI to sort this issue out?

Running 9.0.0_GA_3990 Network Edition.

If anyone finds it, let me know.

Thanks.
Post Reply