Zimbra Notes

From Bitbull Wiki
Revision as of 08:55, 24 October 2019 by Chris (talk | contribs) (→‎get signatures of all users)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

1 Configuration

1.1 Change Galsync Account

zmprov modifyDomain mydomain.ch zimbraGalAccountId 42ef46f3-bc1e-4795-8fca-42d8c3c597bd

zmprov gd mybuehl.ch | egrep -i 'ldap|gal'
   zimbraGalAccountId: 42ef46f3-bc1e-4795-8fca-42d8c3c597bd

#login to zimbra admin and tick "hide in GAL" on galsync account

zmgsautil createAccount -a galsync@mydomain.ch -n InternalGAL --domain mydomain.ch -t zimbra -f _InternalGAL
   galsync@mydomain.ch    42ef46f3-bc1e-4795-8fca-42d8c3c597bd

zmgsautil forceSync -a galsync@mydomain.ch -n InternalGAL

# login to old galsync account (admin) and remove _InternalGAL folder from address book

1.2 get signatures of all users

#!/bin/bash

DIR=/opt/scripts/sig

id | grep zimbra || (echo "ERROR: start it as user zimbra" ; pkill -9 $$)

clear
mkdir -p $DIR
echo "Retrieve zimbra user name..."

USERS=`zmprov -l gaa | sort`

for ACCOUNT in $USERS
do
  NAME=`echo $ACCOUNT`
  zmprov ga $NAME zimbraPrefMailSignature > $DIR/$NAME.txt
  zmprov ga $NAME zimbraPrefMailSignatureHTML > $DIR/$NAME.html
  sed -i -e "1d" $DIR/$NAME.*
  sed -i 's/zimbraPrefMailSignature: //g' $DIR/$NAME.txt
  sed -i 's/zimbraPrefMailSignatureHTML: //g' $DIR/$NAME.html
  echo "Export signature for $NAME..."
done
echo "All signature has been export successfully"

1.3 Zimbra Backup

  • show backup config
zmschedulebackup -q
zmschedulebackup -s
crontab -l | grep backup
  • set backup config
zmschedulebackup -R --mail-report d 1m "0 0 * * *" --mail-report i "0 1 * * 0-5" -a all --mail-report f "0 1 * * 6"
crontab -l | grep backup

1.4 Change Webmail Font for all Users

zmprov mc default zimbraPrefHtmlEditorDefaultFontFamily "Sans Serif"

1.5 Change Password Changing URL

zmprov md mydomain.ch zimbraChangePasswordURL https://password.mydomain.ch

2 Zimbra debugging

2.1 Zimbra debugging in web browser

http://zimbra.domain.com/zimbra/?dev=1

2.2 Zimbra debugging to logfile

zmprov aal <username> zimbra.soap debug #mailbox.log 
zmprov ral <username> # stop logging

2.3 comandline calendar queries

zmmailbox -z -m <username> gf Calendar
zmmailbox -z -m <username> gaps -5day +5day  /Calendar 
zmmailbox -z -m <username> search -t appointment in:Calendar

2.4 comandline adressbook queries

zmmailbox -z -m <username> gact -f '/Öffentliche Adressbücher/Verteilerlisten'

2.5 list all accounts

zmprov  -m -l gaa

2.6 zimbra user query in mysql db

su - zimbra
mysql
use zimbra
select * from mailbox where account_id = "<USER-UUID>"\G

2.7 restore mailbox with prefix in username

zmrestore -a user@domain.com -ca -pre temp_

2.8 find username from USER-UUID

zmprov getAccount <USER-UUID> mail

2.9 get zimbraID of account

zmprov ga <username> zimbraId