{"id":13828468,"url":"https://github.com/zbateson/mail-mime-parser","last_synced_at":"2026-03-05T23:02:49.696Z","repository":{"id":37285678,"uuid":"45861814","full_name":"zbateson/mail-mime-parser","owner":"zbateson","description":"An email parser written in PHP","archived":false,"fork":false,"pushed_at":"2026-02-14T00:39:00.000Z","size":15015,"stargazers_count":532,"open_issues_count":16,"forks_count":59,"subscribers_count":22,"default_branch":"master","last_synced_at":"2026-02-14T02:56:45.425Z","etag":null,"topics":["email-parser","email-reader","mail-parser","mailmimeparser","mime-parser","php","php-imap"],"latest_commit_sha":null,"homepage":"https://mail-mime-parser.org/","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-2-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/zbateson.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null},"funding":{"github":"zbateson"}},"created_at":"2015-11-09T19:34:58.000Z","updated_at":"2026-02-14T00:45:53.000Z","dependencies_parsed_at":"2024-01-18T07:51:22.835Z","dependency_job_id":"a96cbd3a-14fe-4908-b763-6d2f0630ac0c","html_url":"https://github.com/zbateson/mail-mime-parser","commit_stats":{"total_commits":740,"total_committers":31,"mean_commits":"23.870967741935484","dds":0.5810810810810811,"last_synced_commit":"7ef980953a5adc71c3ece673174c4f2111a5ca43"},"previous_names":[],"tags_count":69,"template":false,"template_full_name":null,"purl":"pkg:github/zbateson/mail-mime-parser","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zbateson%2Fmail-mime-parser","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zbateson%2Fmail-mime-parser/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zbateson%2Fmail-mime-parser/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zbateson%2Fmail-mime-parser/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zbateson","download_url":"https://codeload.github.com/zbateson/mail-mime-parser/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zbateson%2Fmail-mime-parser/sbom","scorecard":{"id":1243349,"data":{"date":"2026-01-26","repo":{"name":"github.com/zbateson/mail-mime-parser","commit":"ff054c8e05310c445c2028c6128a4319cc9f6aa8"},"scorecard":{"version":"v5.4.1-0.20260130224013-ac18bf8aefea","commit":"ac18bf8aefea92d408c736bdd3d60fd8e59dc969"},"score":4.1,"checks":[{"name":"Dangerous-Workflow","score":10,"reason":"no dangerous workflow patterns detected","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/ac18bf8aefea92d408c736bdd3d60fd8e59dc969/docs/checks.md#dangerous-workflow"}},{"name":"Maintained","score":2,"reason":"3 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 2","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/ac18bf8aefea92d408c736bdd3d60fd8e59dc969/docs/checks.md#maintained"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/ac18bf8aefea92d408c736bdd3d60fd8e59dc969/docs/checks.md#packaging"}},{"name":"Code-Review","score":1,"reason":"Found 4/25 approved changesets -- score normalized to 1","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/ac18bf8aefea92d408c736bdd3d60fd8e59dc969/docs/checks.md#code-review"}},{"name":"Pinned-Dependencies","score":0,"reason":"dependency not pinned by hash detected -- score normalized to 0","details":["Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/tests.yml:19: update your workflow using https://app.stepsecurity.io/secureworkflow/zbateson/mail-mime-parser/tests.yml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/tests.yml:22: update your workflow using https://app.stepsecurity.io/secureworkflow/zbateson/mail-mime-parser/tests.yml/master?enable=pin","Info:   0 out of   1 GitHub-owned GitHubAction dependencies pinned","Info:   0 out of   1 third-party GitHubAction dependencies pinned"],"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/ac18bf8aefea92d408c736bdd3d60fd8e59dc969/docs/checks.md#pinned-dependencies"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/ac18bf8aefea92d408c736bdd3d60fd8e59dc969/docs/checks.md#cii-best-practices"}},{"name":"Token-Permissions","score":0,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Warn: no topLevel permission defined: .github/workflows/tests.yml:1","Info: no jobLevel write permissions found"],"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/ac18bf8aefea92d408c736bdd3d60fd8e59dc969/docs/checks.md#token-permissions"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/ac18bf8aefea92d408c736bdd3d60fd8e59dc969/docs/checks.md#binary-artifacts"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/ac18bf8aefea92d408c736bdd3d60fd8e59dc969/docs/checks.md#security-policy"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/ac18bf8aefea92d408c736bdd3d60fd8e59dc969/docs/checks.md#vulnerabilities"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/ac18bf8aefea92d408c736bdd3d60fd8e59dc969/docs/checks.md#fuzzing"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: BSD 2-Clause \"Simplified\" License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/ac18bf8aefea92d408c736bdd3d60fd8e59dc969/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/ac18bf8aefea92d408c736bdd3d60fd8e59dc969/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":-1,"reason":"internal error: error during branchesHandler.setup: internal error: some github tokens can't read classic branch protection rules: https://github.com/ossf/scorecard-action/blob/main/docs/authentication/fine-grained-auth-token.md","details":null,"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/ac18bf8aefea92d408c736bdd3d60fd8e59dc969/docs/checks.md#branch-protection"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 9 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/ac18bf8aefea92d408c736bdd3d60fd8e59dc969/docs/checks.md#sast"}}]},"last_synced_at":"2026-02-14T02:59:34.553Z","repository_id":37285678,"created_at":"2026-02-14T02:59:34.553Z","updated_at":"2026-02-14T02:59:34.553Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30154287,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-05T22:39:40.138Z","status":"ssl_error","status_checked_at":"2026-03-05T22:39:24.771Z","response_time":93,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["email-parser","email-reader","mail-parser","mailmimeparser","mime-parser","php","php-imap"],"created_at":"2024-08-04T09:02:48.241Z","updated_at":"2026-03-05T23:02:49.691Z","avatar_url":"https://github.com/zbateson.png","language":"PHP","funding_links":["https://github.com/sponsors/zbateson"],"categories":["PHP"],"sub_categories":[],"readme":"# zbateson/mail-mime-parser\n\nTestable and PSR-compliant mail mime parser alternative to PHP's imap* functions and Pear libraries for reading messages in _Internet Message Format_ [RFC 822](http://tools.ietf.org/html/rfc822) (and later revisions [RFC 2822](http://tools.ietf.org/html/rfc2822), [RFC 5322](http://tools.ietf.org/html/rfc5322)).\n\n[![Build Status](https://github.com/zbateson/mail-mime-parser/actions/workflows/tests.yml/badge.svg)](https://github.com/zbateson/mail-mime-parser/actions/workflows/tests.yml)\n[![Total Downloads](https://poser.pugx.org/zbateson/mail-mime-parser/downloads)](//packagist.org/packages/zbateson/mail-mime-parser)\n[![Latest Stable Version](https://poser.pugx.org/zbateson/mail-mime-parser/v)](//packagist.org/packages/zbateson/mail-mime-parser)\n\nThe goals of this project are to be:\n\n* Well written\n* Standards-compliant but forgiving\n* Tested where possible\n\nTo include it for use in your project, install it via composer:\n\n```\ncomposer require zbateson/mail-mime-parser\n```\n\n## Sponsors\n\n[![SecuMailer](https://mail-mime-parser.org/sponsors/logo-secumailer.png)](https://secumailer.com)\n\nA huge thank you to [all my sponsors](https://github.com/sponsors/zbateson). \u003c3\n\nIf this project's helped you, please consider [sponsoring me](https://github.com/sponsors/zbateson).\n\n## New in 4.0\n\nVersion 4.0 requires PHP 8.1+ and focuses on API cleanup and improved configurability.  For details, see the [4.0 Upgrade Guide](https://mail-mime-parser.org/upgrade-4.0).\n\n## Requirements\n\nMailMimeParser requires PHP 8.1 or newer.  Tested on PHP 8.1, 8.2, 8.3, 8.4 and 8.5.\n\n## Usage\n\n```php\nuse ZBateson\\MailMimeParser\\MailMimeParser;\nuse ZBateson\\MailMimeParser\\Message;\nuse ZBateson\\MailMimeParser\\Header\\HeaderConsts;\n\n// use an instance of MailMimeParser as a class dependency\n$mailParser = new MailMimeParser();\n\n// parse() accepts a string, resource or Psr7 StreamInterface\n// pass `true` as the second argument to attach the passed $handle and close\n// it when the returned IMessage is destroyed.\n$handle = fopen('file.mime', 'r');\n$message = $mailParser-\u003eparse($handle, false);         // returns `IMessage`\n\n// OR: use this procedurally (Message::from also accepts a string,\n// resource or Psr7 StreamInterface\n// true or false as second parameter doesn't matter if passing a string.\n$string = \"Content-Type: text/plain\\r\\nSubject: Test\\r\\n\\r\\nMessage\";\n$message = Message::from($string, false);\n\necho $message-\u003egetHeaderValue(HeaderConsts::FROM);     // user@example.com\necho $message\n    -\u003egetHeader(HeaderConsts::FROM)                    // AddressHeader\n    -\u003egetPersonName();                                 // Person Name\necho $message-\u003egetSubject();                           // The email's subject\necho $message\n    -\u003egetHeader(HeaderConsts::TO)                      // also AddressHeader\n    -\u003egetAddresses()[0]                                // AddressPart\n    -\u003egetPersonName();                                 // Person Name\necho $message\n    -\u003egetHeader(HeaderConsts::CC)                      // also AddressHeader\n    -\u003egetAddresses()[0]                                // AddressPart\n    -\u003egetEmail();                                      // user@example.com\n\necho $message-\u003egetTextContent();                       // or getHtmlContent()\n\necho $message-\u003egetHeader('X-Foo');                     // for custom or undocumented headers\n\n$att = $message-\u003egetAttachmentPart(0);                 // first attachment\necho $att-\u003egetHeaderValue(HeaderConsts::CONTENT_TYPE); // e.g. \"text/plain\"\necho $att-\u003egetHeaderParameter(                         // value of \"charset\" part\n    HeaderConsts::CONTENT_TYPE,\n    'charset'\n);\necho $att-\u003egetContent();                               // get the attached file's contents\n$stream = $att-\u003egetContentStream();                    // the file is decoded automatically\n$dest = \\GuzzleHttp\\Psr7\\stream_for(\n    fopen('my-file.ext')\n);\n\\GuzzleHttp\\Psr7\\copy_to_stream(\n    $stream, $dest\n);\n// OR: more simply if saving or copying to another stream\n$att-\u003esaveContent('my-file.ext');               // writes to my-file.ext\n$att-\u003esaveContent($stream);                     // copies to the stream\n\n// close only when $message is no longer being used.\nfclose($handle);\n\n```\n\n## Encryption and Signing Plugins\n\nOptional companion packages add S/MIME and PGP/MIME support for decrypting,\nencrypting, signing and verifying messages:\n\n* [zbateson/mmp-crypt-smime](https://github.com/zbateson/mmp-crypt-smime) -- S/MIME via PHP's OpenSSL extension\n* [zbateson/mmp-crypt-gpg](https://github.com/zbateson/mmp-crypt-gpg) -- PGP/MIME via PEAR's Crypt_GPG\n\nInstall either package and encrypted/signed messages are automatically detected\nand decrypted during parsing. See the [Usage Guide](https://mail-mime-parser.org/#encryption-and-signing)\nfor examples of reading encrypted messages and composing signed/encrypted ones.\n\n## Documentation\n\n* [Usage Guide](https://mail-mime-parser.org/)\n* [API Reference](https://mail-mime-parser.org/api/4.0)\n\n## Upgrade guides\n\n* [1.x Upgrade Guide](https://mail-mime-parser.org/upgrade-1.0)\n* [2.x Upgrade Guide](https://mail-mime-parser.org/upgrade-2.0)\n* [3.x Upgrade Guide](https://mail-mime-parser.org/upgrade-3.0)\n* [4.x Upgrade Guide](https://mail-mime-parser.org/upgrade-4.0)\n\n## License\n\nBSD licensed - please see [license agreement](https://github.com/zbateson/mail-mime-parser/blob/master/LICENSE).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzbateson%2Fmail-mime-parser","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzbateson%2Fmail-mime-parser","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzbateson%2Fmail-mime-parser/lists"}