The Problem: Maintaining Out-of-Office Status in Two Systems
Sound familiar? An agent activates their automatic replies in Outlook - but forgets to also set OOO in Znuny. Tickets get assigned to absent agents, remain unprocessed, customers wait.
In many companies, manually maintaining absence status across multiple systems leads to:
- Orphaned tickets - Assignments to absent agents
- Double maintenance - Status must be set separately in Outlook and Znuny
- Forgotten updates - Agent returns, forgets to deactivate Znuny status
- Missing overview - Team leads can't see who's actually absent
- Inconsistent data - Outlook says "away", Znuny says "available"
The Solution: Automatic Synchronization from Exchange Online
The ExoOooSync addon for Znuny 7.2.x solves this problem fully automatically. It reads the Out-of-Office status of all agents from Microsoft Exchange Online via Graph API and transfers it to Znuny agent preferences - without any manual intervention.
The agent only sets their OOO in Outlook - Znuny takes care of the rest.
How It Works
Automatic Synchronization
The addon runs as a background job in the Znuny Daemon:
- Get token - OAuth2 Client Credentials against Azure AD
- Query status - Read automatic replies for each agent via Graph API
- Compare - Match current Znuny status against Exchange status
- Update - Set Znuny preferences only when changes are detected
- Log - Write each change individually to the system log
Three Exchange States Are Recognized
| Exchange Status | Znuny Result |
|---|---|
| Disabled | Out-of-Office in Znuny is deactivated |
| Scheduled (with time range) | Start/end date taken from Exchange, Znuny activates automatically at start date |
| Always enabled (no end date) | OOO active, synthetic end date +365 days |
Flexible User Mapping
Znuny and Exchange often use different identifiers for the same user. The addon supports three mapping modes:
| Mode | Znuny Field | Exchange Lookup |
|---|---|---|
| UserEmail_UPN | Email address | Directly as User Principal Name |
| UserLogin_SAM | UserLogin | Search via onPremisesSamAccountName in Entra ID |
| UserEmail_PrimarySMTP | Email address | Search via mail attribute in Entra ID |
Scheduled Execution
Synchronization runs on a schedule in the background:
| Time Period | Interval |
|---|---|
| Weekdays 06:00-18:00 | Every 15 minutes |
| Otherwise (evenings, nights, weekends) | Hourly |
Detailed Logging
Every change is individually documented in the Znuny system log:
[notice] ExoOooSync: Updated user 'jdoe' (ID: 5): OutOfOffice: '0' -> '1',
OutOfOfficeStartYear: '' -> '2026', OutOfOfficeStartMonth: '' -> '3', ...
[info] ExoOooSync: Synchronization completed. Synced: 45, Changed: 2,
Skipped: 1, NoMailbox: 0, Errors: 0.
Email Domain Filter
Not all agents have an Exchange Online mailbox. The configurable domain filter lets you restrict which agents are synchronized - e.g., only internal domains. External agents without an Exchange mailbox are automatically skipped.
Scalability
The addon uses the Graph API $batch endpoint, bundling up to 20 queries per HTTP request. When throttled by Microsoft (HTTP 429), it automatically waits and retries. Installations with several thousand agents are no problem.
Typical Scenarios
Scenario 1: Agent Goes on Vacation
- Agent sets up automatic replies in Outlook (e.g., Apr 1 - Apr 14)
- ExoOooSync detects the
scheduledstatus on the next sync run - Znuny automatically shows "Away until Apr 14" for the agent
- On Apr 14, Exchange automatically disables replies → next sync deactivates OOO in Znuny
Scenario 2: Agent Is Spontaneously Sick
- Agent (or team lead) activates automatic replies in Outlook without an end date
- ExoOooSync detects
alwaysEnabledand sets OOO in Znuny (end date: +365 days) - Agent returns, deactivates automatic replies in Outlook
- Next sync run deactivates OOO in Znuny
Technical Requirements
| Requirement | Details |
|---|---|
| Znuny | 7.2.x with running Daemon |
| Microsoft 365 | Exchange Online with Azure AD (Entra ID) |
| Azure AD | App registration with MailboxSettings.Read permission |
| Network | Outbound HTTPS to login.microsoftonline.com and graph.microsoft.com |
Installation
Installation works like any Znuny package:
Option A: Package Repository (recommended)
- Admin → System Configuration →
Package::RepositoryList - Add repository: Name
wolkig.it, URLhttps://wolkig.it/packages - Admin → Package Manager → Install "ExoOooSync"
Option B: Manual
- Download OPM package
- Admin → Package Manager → Install package
After installation:
- Enter Azure AD credentials in System Configuration
- Select mapping mode
- Optional: Set email domain filter (e.g. only sync
company.com) - Enable feature (
ExoOooSync::Enabled) - Test manually:
bin/znuny.Console.pl Maint::ExoOooSync::Run --force
The addon automatically disables the manual Out-of-Office widget in agent preferences, as the status is now centrally managed from Exchange.
Open Source
ExoOooSync is Open Source under the AGPL v3 license:
- Free to use
- Source code viewable
- Modifications allowed
- Community contributions welcome
Repository: codeberg.org/wolkig-it/znuny_exo_ooo_sync
Conclusion
With ExoOooSync, maintaining Out-of-Office status in two systems is a thing of the past. Agent sets OOO in Outlook - Znuny knows.
Benefits at a glance:
- Fully automatic synchronization from Exchange Online
- No more double maintenance
- Three mapping modes for any environment
- Scheduled background execution
- Detailed change logging
- CLI command for manual execution and testing
- Free and Open Source
Try it out!
Download and documentation: codeberg.org/wolkig-it/znuny_exo_ooo_sync