Library to interface with Zimbra simply.
Author: Maxime Désécot maxime.desecot@gmail.com
OS: Linux distribution LTS
Language: Ruby3.2+
gem install zm-ruby-clientcluster = Zm::Client::Cluster.new(Zm::Client::ClusterConfig.new('config.json'))
cluster.loginor
config = Zm::Client::ClusterConfig.new do |cc|
cc.zimbra_admin_url = 'https://mail.domain.tld:7071'
cc.zimbra_admin_login = 'admin@domain.tld'
cc.zimbra_admin_password = 'secret'
end
cluster = Zm::Client::Cluster.new(config)
cluster.loginfilter = '(&(mail=*@domain.tld)(zimbraLastLogonTimestamp<=20190225000000Z))'
accounts = cluster.accounts.where(filter).allaccount = cluster.accounts.find_by name: 'maxime@domain.tld'account = Zm::Client::Account.new(cluster) do |acc|
acc.name = 'maxime@domain.tld'
end
account.zimbraMailQuota = 0
account.save