Skip to content

Instantly share code, notes, and snippets.

@richardsonlima
Last active September 21, 2016 14:50
Show Gist options
  • Save richardsonlima/05bed97a827ee30b55ce803e9bc0a060 to your computer and use it in GitHub Desktop.
Save richardsonlima/05bed97a827ee30b55ce803e9bc0a060 to your computer and use it in GitHub Desktop.
#!/bin/bash
# This script was created by Richardson Lima ( www.richardsonlima.com.br )
# Run as zimbra user
# set -x
printf "\033[1;33m[✔] Enter domain to change disclaimer (e.g: yxz.com.br): \n \033[0m"
read mydomain
printf "\033[1;33m[✔] Seeing zimbra domain mandatory mail signature status \n \033[0m"
zmprov gcf zimbraDomainMandatoryMailSignatureEnabled
printf "\033[1;33m[✔] Enabling zimbra domain mandatory signature \n \033[0m"
zmprov mcf zimbraDomainMandatoryMailSignatureEnabled TRUE
printf "\033[1;33m[✔] Seeing zimbra domain mandatory mail signature status \n \033[0m"
zmprov gcf zimbraDomainMandatoryMailSignatureEnabled
printf "\033[1;33m[+] Creating HTML disclaimer \n \033[0m"
zmprov md $mydomain zimbraAmavisDomainDisclaimerHTML "<html lang="pt-br"><head></head><body><p>Este e-mail contém informação que pode ser privilegiada e confidencial. Se você não é o destinatário da mensagem, por favor apague e comunique-nos o fato de imediato.</p><p>
This e-mail contains information that may be privileged and confidential. If you are not the intended recipient, please delete the e-mail and notify us immediately.</p>
<p>Este correo electrônico contiene información que puede ser privilegiada y confidencial. Si usted no es el destinatário del mesaje, por favor elimine el mensaje y de inmediato comunicarnos el hecho.</p></body></html>"
printf "\033[1;33m[+] Creating TXT disclaimer \n \033[0m"
zmprov md $mydomain zimbraAmavisDomainDisclaimerText "Este e-mail contém informação que pode ser privilegiada e confidencial. Se você não é o destinatário da mensagem, por favor apague e comunique-nos o fato de imediato.
This e-mail contains information that may be privileged and confidential. If you are not the intended recipient, please delete the e-mail and notify us immediately.
Este correo electrônico contiene información que puede ser privilegiada y confidencial. Si usted no es el destinatário del mesaje, por favor elimine el mensaje y de inmediato comunicarnos el hecho."
printf "\033[1;33m[✔] Runnijg zm alermime config \n \033[0m"
/opt/zimbra/libexec/zmaltermimeconfig -e $mydomain
printf "\033[1;33m[✔] Checking zm altermime config files \n \033[0m"
ls -la /opt/zimbra/data/altermime/
printf "\033[1;33m[✔] Restarting zm amavisd ctl \n \033[0m"
zmamavisdctl stop && sleep 30 && zmamavisdctl start
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment