Last active
October 11, 2023 22:58
-
-
Save Corgumolax/47d3867dc8ca3b2f2aedd6a59569f6d5 to your computer and use it in GitHub Desktop.
Zimbra Admin. Add a standard signature to all domain users.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
path="/opt/zimbra/bin" | |
corpSite="http://www.example.com" | |
for i in `/opt/zimbra/bin/zmprov -l gaa` | |
do | |
echo -ne "Checking Account: $i \t" | |
echo | |
cn=`$path/zmprov ga $i cn` | |
name=$( echo $cn | cut -d\: -f2) | |
tmp=`$path/zmprov ga $i company` | |
societe=$( echo $tmp | cut -d\: -f2) | |
tmp=`$path/zmprov ga $i street` | |
adresse=$( echo $tmp | cut -d\: -f2 ) | |
tmp=`$path/zmprov ga $i telephoneNumber` | |
telNum=$( echo $tmp | cut -d\: -f2) | |
tmp=`$path/zmprov ga $i mobile` | |
portNum=$( echo $tmp | cut -d\: -f2) | |
tmp=`$path/zmprov ga $i title` | |
title=$( echo $tmp | cut -d\: -f2) | |
tmp=`$path/zmprov ga $i l` | |
town=$( echo $tmp | cut -d\: -f2) | |
tmp=`$path/zmprov ga $i postalCode` | |
postCode=$( echo $tmp | cut -d\: -f2) | |
read -d '' signature <<_EOF_ | |
<div> | |
<b style='font-size: small;'><span color='#3333ff' style='color: #3333ff;'>$name</span></b><br style='font-size: small;' /> | |
<span style='font-size: small;'>$title</span><br style='font-size: small;' /> | |
<span style='font-size: small;'>____________________________________ </span><br style='font-size: small;' /> | |
<b style='font-size: small;'><span color='#ff6600' style='color: #ff6600;'>$societe</span></b></span><br style='font-size: small;' /> | |
<span style='font-size: small;'>$adresse</span><br style='font-size: small;' /> | |
<span style='font-size: small;'>Tel: $telNum Fax: 03.83.27.57.25 </span><br style='font-size: small;' /> | |
<span style='font-size: small;'>Port: $portNum</span><br style='font-size: small;' /> | |
<span style='font-size: small;'>Mel: <a href='mailto:$i'>$i</a> </span><br style='font-size: small;' /> | |
<span style='font-size: small;'>Web: <a href='$corpSite'>$corpSite</a> </span> | |
</div> | |
_EOF_ | |
signId=$(/opt/zimbra/bin/zmprov csig $i corpSignature zimbraPrefMailSignatureHTML "$signature") | |
#$(echo $path/zmprov mid $i zimbraPrefDefaultSignatureId $signId) | |
$(echo $path/zmprov ma $i zimbraPrefDefaultSignatureId $signId) | |
echo "done!" | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment