zm-ruby-client

Library to interface with Zimbra simply.

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

Installation

OS: Linux distribution LTS

Language: Ruby2.7+

gem install zm-ruby-client

Examples of uses:

Connection:

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

or

config = Zm::Client::ClusterConfig.new do |cc|
  cc.zimbra_admin_host = 'mail.domain.tld'
  cc.zimbra_admin_scheme = 'https'
  cc.zimbra_admin_port = 443
  cc. = '[email protected]'
  cc.zimbra_admin_password = 'secret'
end
admin = Zm::Client::Cluster.new(config)
admin.

List all accounts

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

Find an account

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

Create an account

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