Difference between revisions of "Zimbra Notes"

From Bitbull Wiki
Jump to navigation Jump to search
Line 1: Line 1:
 
[[Category:ReferenceCards]]
 
[[Category:ReferenceCards]]
 
=Configuration=
 
=Configuration=
 +
==Restrict Zimbra Senders to Distribution List==
 +
Recently I had some spam on internal distribution lists.
 +
That was too bad, because it was a first class credit card fake :-)
 +
So I searched and found a simple way to only allow domain sender address to send email to distribution lists.
 +
That solved my problem.<br>
 +
 +
Here is how I did it:
 +
<pre>
 +
zmprov modifyConfig zimbraMilterServerEnabled TRUE
 +
zmmilterctl restart
 +
zmmilterctl status
 +
 +
ZDOMAIN=mydomain.ch
 +
zmprov gadl $ZDOMAIN | while read dl_email
 +
do
 +
  echo "---- deny all senders to $dl_email"
 +
  zmprov grr dl $dl_email pub -sendToDistList
 +
  echo "---- allow $ZDOMAIN senders to $dl_email"
 +
  zmprov grr dl $dl_email dom $ZDOMAIN sendToDistList
 +
done
 +
 +
zmmtactl reload
 +
</pre>
 +
This is a good site to read more details:
 +
* https://wiki.zimbra.com/wiki/Enabling_and_administering_the_Zimbra_milter
 +
 
==Change Galsync Account==
 
==Change Galsync Account==
 
<pre>
 
<pre>
Line 60: Line 86:
 
==Change Password Changing URL==
 
==Change Password Changing URL==
 
  zmprov md mydomain.ch zimbraChangePasswordURL https://password.mydomain.ch
 
  zmprov md mydomain.ch zimbraChangePasswordURL https://password.mydomain.ch
 +
 +
[[Category:ReferenceCards]]
  
 
=Zimbra debugging=
 
=Zimbra debugging=

Revision as of 07:10, 9 November 2021

1 Configuration

1.1 Restrict Zimbra Senders to Distribution List

Recently I had some spam on internal distribution lists. That was too bad, because it was a first class credit card fake :-) So I searched and found a simple way to only allow domain sender address to send email to distribution lists. That solved my problem.

Here is how I did it:

zmprov modifyConfig zimbraMilterServerEnabled TRUE
zmmilterctl restart
zmmilterctl status

ZDOMAIN=mydomain.ch
zmprov gadl $ZDOMAIN | while read dl_email
do
   echo "---- deny all senders to $dl_email"
   zmprov grr dl $dl_email pub -sendToDistList
   echo "---- allow $ZDOMAIN senders to $dl_email"
   zmprov grr dl $dl_email dom $ZDOMAIN sendToDistList
done

zmmtactl reload

This is a good site to read more details:

1.2 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.3 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.4 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.5 Change Webmail Font for all Users

zmprov mc default zimbraPrefHtmlEditorDefaultFontFamily "Sans Serif"

1.6 Change Password Changing URL

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

2 Zimbra debugging

2.1 Check all users Trash folders for mails older than 40 days

USERS=`zmprov -l gaa | sort`
for ACCOUNT in $USERS
do
  echo "------- $ACCOUNT -------"
  zmmailbox -z -m $ACCOUNT s -l50 -t message "in:trash before:$(date -d '-40 day' +%m/%d/%y)"
done


2.2 Zimbra debugging in web browser

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

2.3 Zimbra debugging to logfile

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

2.4 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.5 comandline adressbook queries

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

2.6 list all accounts

zmprov  -m -l gaa

2.7 zimbra user query in mysql db

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

2.8 restore mailbox with prefix in username

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

2.9 find username from USER-UUID

zmprov getAccount <USER-UUID> mail

2.10 get zimbraID of account

zmprov ga <username> zimbraId