zm-ruby-client

Library to interface with Zimbra simply.

Author: Maxime Désécot [email protected]

Installation

OS: Linux distribution LTS

Language: Ruby3.2+

gem install zm-ruby-client

Examples of uses:

Connection:

cluster = Zm::Client::Cluster.new(Zm::Client::ClusterConfig.new('config.json'))
cluster.

or

config = Zm::Client::ClusterConfig.new do |cc|
  cc.zimbra_admin_url = 'https://mail.domain.tld:7071'
  cc. = '[email protected]'
  cc.zimbra_admin_password = 'secret'
end
cluster = Zm::Client::Cluster.new(config)
cluster.

List all accounts

filter = '(&(mail=*@domain.tld)(zimbraLastLogonTimestamp<=20190225000000Z))'
accounts = cluster.accounts.where(filter).all

Find an account

 = cluster.accounts.find_by name: '[email protected]'

Create an account

 = Zm::Client::.new(cluster) do |acc|
  acc.name = '[email protected]'
end
.zimbraMailQuota = 0
.save