{"id":16473297,"url":"https://github.com/amalfra/maildir","last_synced_at":"2025-03-23T11:32:50.325Z","repository":{"id":57697192,"uuid":"111984094","full_name":"amalfra/maildir","owner":"amalfra","description":"A Go package for reading \u0026 writing messages in maildir format","archived":false,"fork":false,"pushed_at":"2024-04-09T11:19:39.000Z","size":29,"stargazers_count":17,"open_issues_count":1,"forks_count":1,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-03-02T00:23:58.347Z","etag":null,"topics":["go","golang","maildir","maildir-format","reader","writer"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/amalfra.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"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}},"created_at":"2017-11-25T07:07:21.000Z","updated_at":"2024-05-01T23:53:10.000Z","dependencies_parsed_at":"2024-04-09T12:35:37.790Z","dependency_job_id":"827d8148-fad7-4fe5-a775-ebb8ef05f85d","html_url":"https://github.com/amalfra/maildir","commit_stats":null,"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/amalfra%2Fmaildir","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/amalfra%2Fmaildir/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/amalfra%2Fmaildir/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/amalfra%2Fmaildir/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/amalfra","download_url":"https://codeload.github.com/amalfra/maildir/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244297857,"owners_count":20430347,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["go","golang","maildir","maildir-format","reader","writer"],"created_at":"2024-10-11T12:26:11.406Z","updated_at":"2025-03-23T11:32:49.952Z","avatar_url":"https://github.com/amalfra.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"maildir\n=======\n[![GitHub release](https://img.shields.io/github/release/amalfra/maildir.svg)](https://github.com/amalfra/maildir/releases)\n![Build Status](https://github.com/amalfra/maildir/actions/workflows/test.yml/badge.svg?branch=main)\n[![GoDoc](https://godoc.org/github.com/amalfra/maildir/v3?status.svg)](https://godoc.org/github.com/amalfra/maildir/v3)\n[![Go Report Card](https://goreportcard.com/badge/github.com/amalfra/maildir/v3)](https://goreportcard.com/report/github.com/amalfra/maildir/v3)\n[![Coverage Status](https://coveralls.io/repos/github/amalfra/maildir/badge.svg?branch=main)](https://coveralls.io/github/amalfra/maildir?branch=main)\n\nA go package for reading and writing messages in the maildir format.\n\n\u003e The Maildir e-mail format is a common way of storing e-mail messages, where each message is kept in a separate file with a unique name, and each folder is a directory. The local filesystem handles file locking as messages are added, moved and deleted. A major design goal of Maildir is to eliminate program code having to handle locking, which is often difficult.\n\nRefer http://cr.yp.to/proto/maildir.html and http://en.wikipedia.org/wiki/Maildir\n\n## Installation\n\nYou can download the package using\n\n``` go\ngo get github.com/amalfra/maildir/v3\n```\n\n## Usage\n\nNext, import the package\n\n``` go\nimport (\n  \"github.com/amalfra/maildir/v3\"\n)\n```\n\n#### Create a maildir in /home/amal/mail\n``` go\nmyMaildir := maildir.NewMaildir(\"/home/amal/mail\")\n```\n\nThis command automatically creates the standard Maildir directories - `cur`,\n`new`, and `tmp` - if they do not exist.\n\n#### Add a new message\nThis creates a new file with the contents \"foo\"; returns the Message struct reference. Messages are written to the tmp dir then moved to new.\n``` go\nmessage, err := myMaildir.Add(\"foo\")\n```\n\n#### List new messages\n``` go\nmailList, err := myMaildir.List(\"new\")\n```\nThis will return a map of messages by key, sorted by key\n\n#### List current messages\n``` go\nmailList, err := myMaildir.List(\"cur\")\n```\nThis will return a map of messages by key, sorted by key\n\n#### Find the message using key\n``` go\nmessage := maildir.Get(key)\n```\n\n#### Delete the message from disk by key\n``` go\nerr := maildir.Delete(key)\n```\n\n**Below are the methods that are available on Message instance**\n\n#### Get the key used to uniquely identify the message\n``` go\nkey := message.Key()\n```\n\n#### Load the message content from file\n``` go\ndata, err := message.GetData()\n```\n\n#### Process message - move the message from \"new\" to \"cur\"\nThis is usaully done to indicate that some process has retrieved the message.\n``` go\nkey, err := message.Process(\"new\")\n```\n\n## Development\n\nQuestions, problems or suggestions? Please post them on the [issue tracker](https://github.com/amalfra/maildir/issues).\n\nYou can contribute changes by forking the project and submitting a pull request. You can ensure the tests are passing by running ```make test```. Feel free to contribute :heart_eyes:\n\n## UNDER MIT LICENSE\n\nThe MIT License (MIT)\n\nCopyright (c) 2017 Amal Francis\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Famalfra%2Fmaildir","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Famalfra%2Fmaildir","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Famalfra%2Fmaildir/lists"}