Skip to content

RaoH37/zm-ruby-client

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

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: Ruby2.7+

sudo apt install make gcc curl libcurl4-openssl-dev
gem install zm-ruby-client

Examples of uses:

Connection:

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

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.zimbra_admin_login = 'admin@domain.tld'
  cc.zimbra_admin_password = 'secret'
end
admin = Zm::Client::Cluster.new(config)
admin.login

List all accounts

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

Find an account

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

Create an account

account = Zm::Client::Account.new(admin) 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

Packages

No packages published

Languages