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:

  1. Get token - OAuth2 Client Credentials against Azure AD
  2. Query status - Read automatic replies for each agent via Graph API
  3. Compare - Match current Znuny status against Exchange status
  4. Update - Set Znuny preferences only when changes are detected
  5. Log - Write each change individually to the system log

Three Exchange States Are Recognized

Exchange StatusZnuny Result
DisabledOut-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:

ModeZnuny FieldExchange Lookup
UserEmail_UPNEmail addressDirectly as User Principal Name
UserLogin_SAMUserLoginSearch via onPremisesSamAccountName in Entra ID
UserEmail_PrimarySMTPEmail addressSearch via mail attribute in Entra ID
The right mode depends on your environment and is configured in System Configuration.

Scheduled Execution

Synchronization runs on a schedule in the background:

Time PeriodInterval
Weekdays 06:00-18:00Every 15 minutes
Otherwise (evenings, nights, weekends)Hourly
Schedules are freely adjustable via Znuny System Configuration.

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

  1. Agent sets up automatic replies in Outlook (e.g., Apr 1 - Apr 14)
  2. ExoOooSync detects the scheduled status on the next sync run
  3. Znuny automatically shows "Away until Apr 14" for the agent
  4. On Apr 14, Exchange automatically disables replies → next sync deactivates OOO in Znuny

Scenario 2: Agent Is Spontaneously Sick

  1. Agent (or team lead) activates automatic replies in Outlook without an end date
  2. ExoOooSync detects alwaysEnabled and sets OOO in Znuny (end date: +365 days)
  3. Agent returns, deactivates automatic replies in Outlook
  4. Next sync run deactivates OOO in Znuny

Technical Requirements

RequirementDetails
Znuny7.2.x with running Daemon
Microsoft 365Exchange Online with Azure AD (Entra ID)
Azure ADApp registration with MailboxSettings.Read permission
NetworkOutbound HTTPS to login.microsoftonline.com and graph.microsoft.com
Authentication uses the OAuth2 Client Credentials flow - a pure application authentication without user interaction, ideal for background processes.

Installation

Installation works like any Znuny package:

Option A: Package Repository (recommended)

  1. Admin → System Configuration → Package::RepositoryList
  2. Add repository: Name wolkig.it, URL https://wolkig.it/packages
  3. Admin → Package Manager → Install "ExoOooSync"

Option B: Manual

  1. Download OPM package
  2. Admin → Package Manager → Install package

After installation:

  1. Enter Azure AD credentials in System Configuration
  2. Select mapping mode
  3. Optional: Set email domain filter (e.g. only sync company.com)
  4. Enable feature (ExoOooSync::Enabled)
  5. 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