Skip to content

RaoH37/zm-ruby-client

Repository files navigation

zm-ruby-client

Library to interface with Zimbra simply.

Author: Maxime Désécot maxime.desecot@gmail.com

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.login

or

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.login

List all accounts

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

Find an account

account = cluster.accounts.find_by name: 'maxime@domain.tld'

Create an account

account = Zm::Client::Account.new(cluster) do |acc|
  acc.name = 'maxime@domain.tld'
end
account.zimbraMailQuota = 0
account.save

About

No description, website, or topics provided.

Resources

License

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages