mapi-headers-php is the central repository for PHP-based MAPI applications. These header files are used by grommunio Web, grommunio Sync and grommunio DAV, eliminating the bundling of headers.
- MS-OX* Protocol Compliance: Full compliance with Microsoft Exchange protocols (MS-OXOCAL, MS-OXOTASK, MS-OXOMSG, MS-OXCICAL, etc.)
- Meeting Request Handling: Complete lifecycle management for meeting requests, responses, updates, and cancellations
- Recurrence Support: Comprehensive recurrence pattern parsing and generation for appointments and tasks (daily, weekly, monthly, yearly)
- Task Management: Full task request and delegation support with multi-assignee capabilities
- Exception Handling: Robust error handling with detailed MAPI exception mapping
- Authentication: KeyCloak SSO integration and JWT token management
- Free/Busy: Calendar free/busy message and folder utilities
- PHP 8.2+ (Version 2.0+)
- Requires PHP MAPI extension
Support is available through grommunio GmbH and its partners. See https://grommunio.com/ for details. A community forum is at https://community.grommunio.com/.
For direct contact and supplying information about a security-related responsible disclosure, contact [email protected].
- https://docs.github.com/en/get-started/quickstart/contributing-to-projects
- Alternatively, upload commits to a git store of your choosing, or export the series as a patchset using git format-patch, then convey the git link/patches through our direct contact address (above).
This repository follows a custom coding style, which can be validated anytime using the repository's provided configuration file.
composer require grommunio/mapi-header-phpgit clone https://github.com/grommunio/mapi-header-php.git
cd mapi-header-php
make installThis installs the PHP files to /usr/share/php-mapi/.
Definition Files
mapidefs.php- Core MAPI constants, property types, object typesmapiguid.php- MAPI GUID constants for property sets (PSETID_*)mapitags.php- Custom property tag definitionsmapi.util.php- Utility functions for MAPI operationsbootstrap.php- Bootstrap loader for all headers
Class Files
class.meetingrequest.php- Meeting request lifecycle managementclass.recurrence.php- Appointment recurrence handlingclass.taskrecurrence.php- Task-specific recurrenceclass.taskrequest.php- Task delegation and request handlingclass.baserecurrence.php- Abstract recurrence base classclass.baseexception.php- Base exception with display messagesclass.mapiexception.php- MAPI-specific exception handlingclass.freebusy.php- Free/busy utilitiesclass.keycloak.php- KeyCloak SSO integrationclass.token.php- JWT token parsing and validation
Handles the complete lifecycle of meeting requests:
- Sending: Create and send meeting requests to attendees
- Receiving: Process incoming meeting requests, responses, cancellations
- Updating: Update existing meetings with counter-proposals
- Tracking: Monitor attendee responses and track status
- Resources: Automatic resource booking and conflict detection
Example:
<?php
require_once '/usr/share/php-mapi/bootstrap.php';
$mr = new Meetingrequest($store, $message, $session);
// Check if it's a meeting request
if ($mr->isMeetingRequest()) {
// Accept the meeting
$mr->doAccept(false, true, true);
}Parse and generate recurrence patterns according to MS-OXOCAL:
- Daily, weekly, monthly, yearly patterns
- Exception handling (modified and deleted occurrences)
- Timezone support
- Occurrence expansion within date ranges
Example:
<?php
$recurrence = new Recurrence($store, $message);
// Get occurrences in a date range
$items = $recurrence->getCalendarItems(
$store,
$calendarFolder,
$startDate,
$endDate
);Manage task assignments and delegation:
- Task assignment to multiple recipients
- Task acceptance/declination workflow
- Task history tracking
- Status updates and completion tracking
Structured error handling:
- User-friendly display messages
- Technical details for debugging
- MAPI error code mapping
- Exception handling state tracking
This library includes a comprehensive PHPUnit test suite. See tests/README.md for details.
Run tests:
composer install
vendor/bin/phpunitRun with coverage:
vendor/bin/phpunit --coverage-html coverageThe codebase maintains high quality standards:
- PHP-CS-Fixer: Automated code style enforcement
- PHPUnit: Comprehensive unit test coverage
- Type Safety: Extensive use of PHP 7.4+/8.x type hints
- PHPstan*: Static code analysis
Check code style:
vendor/bin/php-cs-fixer fix --dry-run --diffApply fixes:
vendor/bin/php-cs-fixer fixStatic code analysis:
vendor/bin/php-cs-fixer analyzeThis library follows Microsoft Exchange protocol specifications:
- MS-OXOCAL: Calendar and Appointment Objects
- MS-OXOTASK: Task Objects
- MS-OXOMSG: Message Objects
- MS-OXCICAL: iCalendar to Appointment Object Conversion
- MS-OXPROPS: Property Set Definitions
All named properties use the PidLid naming convention and are resolved via
getPropIdsFromStrings() to ensure compatibility.
See doc/changelog.rst for version history and release notes.
AGPL-3.0-only. See LICENSE.txt for details.
Copyright 2020-2025 grommunio GmbH