Code Monkey home page Code Monkey logo

ozpy's Introduction

OZPY

Python (2.7+ including 3.X) library for accessing Zimbra SOAP (https://wiki.zimbra.com/wiki/SOAP_API_Reference_Material_Beginning_with_ZCS_8) by using builtin Python library (no dependency required). Currently this library split into 2 parts: Zmprov and Mailbox.

not all zmprov command(s) has been implemented, because i add them only based on customer/project needs

but you can add your own by extending OZSoap which is base of Zmprov and Mailbox for example creating new COS (Class Of Service)

from ozpy.base import OZSoap

class NewClass(OZSoap):

        def create_cos(self, name):
                body = {"name": [{
                  "_content": name
                }]}
                return self.send("CreateCos", body)

or directly call the soap method (by omitting Request suffix)

# zmsoap_obj is an instance from class OZSoap

zmsoap_obj.CreateCos(
        name=[{"_content": "barudong"}]
)

you can use zmsoap to get the parameters in soap body by using --verbose and --json

zmsoap -z CreateCosRequest/name=new_cos  --json --verbose

Examples

fetch all account

from ozpy.zmprov import Zmprov

zmprov = Zmprov(
        username="[email protected]",
        password="superpassword",
        soapurl="https://192.168.113.75:7071/service/admin/soap"
)
print( zmprov.gaa() )

Sending email

from ozpy.mailbox import Mailbox

mbx = Mailbox(
        username="[email protected]",
        password="superpassword",
        soapurl="https://192.168.113.75/service/soap"
)
mbx.sendMail('[email protected]', 'This is subject', 'Email content')

ozpy's People

Contributors

iomarmochtar avatar kacangitem avatar dhenandi avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.