This repository is a collection of Zimbra scripts created in the past years of email server administration. While Zimbra is the main focus, you will also find cyrus, postfix, sendmail and others.
Disclaimer: this README.md file is generated by AI.
- README.md: This documentation file.
- zmb-domain-summary.py: script used for retrieving Zimbra account summaries.
- test-connection.py: script to test connectivity to the Zimbra server.
The zmb-domain-summary.py
script generates a summary report of Zimbra accounts, categorized by domain. The report includes counts of active, closed, locked, maintenance, total, admin, delegated admin, system, and pending accounts. This tool can be particularly useful for administrators looking to manage and audit user accounts effectively.
- Establish LDAP Connection: The script connects to the Zimbra LDAP server using specified credentials.
- Retrieve User Accounts: It fetches all Zimbra user accounts and their relevant attributes, filtering out non-user accounts.
- Create Domain Database: Constructs a database indexed by domain, categorizing users based on their email addresses.
- Generate Summary: Compiles a summary of user accounts, counting active, closed, locked, and other account status types.
- Print and Send Results: Formats the summary for display and can optionally send it via email.
Key Functions:
createLdapConn()
: Establishes a connection to the LDAP server.zmbGetAllAccounts()
: Retrieves all user accounts from the Zimbra server.createDomainDatabase()
: Constructs a database indexed by email domains.createSummaryArray()
: Generates a summary of accounts by status.printTable()
: Formats and prints the summary as a table.sendMail()
: Sends the summary report via email if requested.
The test-connection.py
script is intended to verify connectivity to the Zimbra server. Although the exact implementation details are not available, it typically performs the following tasks:
- Establish Connection: The script attempts to connect to the Zimbra server using provided credentials and server details.
- Check Response: It checks whether the server responds appropriately, indicating whether the connection is successful.
- Output Result: Outputs the result of the connection test, providing feedback to the user on the connection status.