PHPackages                             dcorreah/postmark-inbound - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [API Development](/categories/api)
4. /
5. dcorreah/postmark-inbound

ActiveLibrary[API Development](/categories/api)

dcorreah/postmark-inbound
=========================

API to process Postmark Inbound Webhooks.

08PHP

Since May 27Pushed 1y agoCompare

[ Source](https://github.com/Ryunosukee/postmark-inbound)[ Packagist](https://packagist.org/packages/dcorreah/postmark-inbound)[ RSS](/packages/dcorreah-postmark-inbound/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

[![Postmark Inbound](https://camo.githubusercontent.com/bc1bd67d420c959e59946436cc159be4443e56c4620a1287d9b1c49748a982d6/68747470733a2f2f706f73746d61726b6170702e636f6d2f696d616765732f6c6f676f2e737667)](https://postmarkapp.com)

postmark-inbound
================

[](#postmark-inbound)

[![Latest Version on Packagist](https://camo.githubusercontent.com/26185e07a07849cdd7b73b373b717c0dbaae5eb838a0807ad9fff38f84bce382/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f64636f72726561682f706f73746d61726b2d696e626f756e642e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/dcorreah/postmark-inbound)[![Software License](https://camo.githubusercontent.com/55c0218c8f8009f06ad4ddae837ddd05301481fcf0dff8e0ed9dadda8780713e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e2e7376673f7374796c653d666c61742d737175617265)](LICENSE.md)[![Tests](https://camo.githubusercontent.com/edeb862dbfa7ebbf7a6f6e50e4094bb0047530b1be5b2fd5cb0867482911ba94/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f776f726b666c6f772f7374617475732f64636f72726561682f706f73746d61726b2d696e626f756e642f74657374732f6d61696e3f6c6162656c3d7465737473267374796c653d666c61742d737175617265)](https://github.com/dcorreah/postmark-inbound/actions?query=workflow%3Atests)[![StyleCI](https://camo.githubusercontent.com/136322f16c17ce27a0aaf3d3f0b6c4b90c4dd4767cb101462caf05459ca99038/68747470733a2f2f6769746875622e7374796c6563692e696f2f7265706f732f3130323734343834382f736869656c643f7374796c653d666c61742d737175617265266272616e63683d6d61696e)](https://github.styleci.io/repos/102744848)[![Total Downloads](https://camo.githubusercontent.com/6c0f9eb33871cb5687edde079b19e56f0af49f1981c90c4f522799b8a90c4ce7/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f64636f72726561682f706f73746d61726b2d696e626f756e642e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/dcorreah/postmark-inbound)

Simple API to process Postmark Inbound Webhooks.

Installation
------------

[](#installation)

You can install the package via composer:

```
composer require dcorreah/postmark-inbound
```

Usage
-----

[](#usage)

```
$inbound = new \dcorreah\Postmark\InboundMessage(file_get_contents('php://input'));

$inbound->from->name;                   // John Doe
$inbound->from->email;                  // john@example.com
$inbound->from->full;                   // John Doe

$inbound->tag;
$inbound->replyTo;
$inbound->textBody;
$inbound->htmlBody;
$inbound->messageId;                    // MessageID assigned by Postmark.
$inbound->messageIdFromHeaders;         // Message-ID value from headers.
$inbound->strippedTextReply;
$inbound->originalRecipient;

$inbound->originalDate;                 // Wed, 6 Sep 2017 12:00:00 +0200
$inbound->date;                         // PostmarkDate::class which is an extension of the DateTime::class
$inbound->date->format('Y-m-d H:i:s')   // 2017-09-06 12:00:00
$inbound->date->isUtc                   // boolean, is the date in the UTC timezone?
$inbound->date->timezone;               // +02:00
$inbound->date->inUtcTimezone()         // Sets the timezone to UTC.
$inbound->subject;                      // Subject of the message.

$inbound->isSpam;                       // boolean, is the message to be considered as spam?
$inbound->spamStatus;                   // Spam status, defaults to 'No' when not present.
$inbound->spamScore;                    // float, defaults to 0.0 when not present.

$inbound->to->count()                   // Recipient count.
$inbound->cc->count()
$inbound->bcc->count()

$inbound->attachments->count()          // Attachment count.

$inbound->headers->count()              // Header count.
```

### Recipients

[](#recipients)

```
$inbound->to->each(function($contact) {
    $contact->name;
    $contact->email;
    $contact->full;
    $contact->mailboxHash;
});

$inbound->cc->each(function($contact) {
    $contact->name;
    ...
});

$inbound->bcc->each(function($contact) {
    $contact->name;
    ...
});
```

Get the first recipient:

```
$inbound->to->first();

```

### Attachments

[](#attachments)

```
$inbound->attachments->each(function($attachment) {
    $attachment->name;
    $attachment->contentType;
    $attachment->contentLength;
    $attachment->content();         // Base64 decoded data
});
```

Get the first attachment:

```
$inbound->attachments->first();
```

Get the last attachment:

```
$inbound->attachments->last();
```

### Headers

[](#headers)

The Message-ID in the headers are sometimes keyed with upper `ID` and sometimes they are in the format of `Id`. So if you want to get the Message-ID from a message you can simply use the `$inbound->messageIdFromHeaders` helper attribute. Please note that `$inbound->messageId` will give you the id of the message that was assigned by Postmark.

```
$inbound->headers->each(function($value, $key) {
    ...
});

$inbound->headers->get('Message-ID');
$inbound->headers->get('MIME-Version');
$inbound->headers->get('Received-SPF');
$inbound->headers->get('X-Spam-Score');
$inbound->headers->get('X-Spam-Status');
...
```

Change log
----------

[](#change-log)

Please see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently.

Contributing
------------

[](#contributing)

Please see [CONTRIBUTING](.github/CONTRIBUTING.md) for details.

Security Vulnerabilities
------------------------

[](#security-vulnerabilities)

Please review [our security policy](../../security/policy) on how to report security vulnerabilities.

Credits
-------

[](#credits)

- [Mark van den Broek](https://github.com/dcorreah)
- [All Contributors](../../contributors)

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

14

—

LowBetter than 2% of packages

Maintenance26

Infrequent updates — may be unmaintained

Popularity4

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity18

Early-stage or recently created project

 Bus Factor1

Top contributor holds 98.3% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

### Community

Maintainers

![](https://www.gravatar.com/avatar/d58a7c860e99693983bc611917d48d74c48b6b3158e7aa34b950af7980b63678?d=identicon)[strike970124](/maintainers/strike970124)

---

Top Contributors

[![mvdnbrk](https://avatars.githubusercontent.com/u/802681?v=4)](https://github.com/mvdnbrk "mvdnbrk (172 commits)")[![Ryunosukee](https://avatars.githubusercontent.com/u/54317215?v=4)](https://github.com/Ryunosukee "Ryunosukee (3 commits)")

### Embed Badge

![Health badge](/badges/dcorreah-postmark-inbound/health.svg)

```
[![Health](https://phpackages.com/badges/dcorreah-postmark-inbound/health.svg)](https://phpackages.com/packages/dcorreah-postmark-inbound)
```

###  Alternatives

[stripe/stripe-php

Stripe PHP Library

4.0k143.3M475](/packages/stripe-stripe-php)[twilio/sdk

A PHP wrapper for Twilio's API

1.6k92.9M270](/packages/twilio-sdk)[knplabs/github-api

GitHub API v3 client

2.2k15.8M187](/packages/knplabs-github-api)[facebook/php-business-sdk

PHP SDK for Facebook Business

90121.9M34](/packages/facebook-php-business-sdk)[meilisearch/meilisearch-php

PHP wrapper for the Meilisearch API

73813.7M114](/packages/meilisearch-meilisearch-php)[google/gax

Google API Core for PHP

263103.1M452](/packages/google-gax)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
