{"id":18483016,"url":"https://github.com/rodyherrera/node-mailu","last_synced_at":"2025-05-13T20:25:21.786Z","repository":{"id":225016505,"uuid":"764459766","full_name":"rodyherrera/node-mailu","owner":"rodyherrera","description":"💌 A library designed to facilitate interaction with the Mailu API. This library provides methods and functions that allow developers to programmatically manage various operations related to the configuration and administration of email servers through the Mailu API.","archived":false,"fork":false,"pushed_at":"2024-02-28T22:15:34.000Z","size":16,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-29T02:43:49.414Z","etag":null,"topics":["api-rest","dkim","dmarc","fetchmail","mail","mailserver","mailu","nodejs","pop3","rest-client","smtp","webmail"],"latest_commit_sha":null,"homepage":"https://test.mailu.io/api/v1/","language":"JavaScript","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/rodyherrera.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}},"created_at":"2024-02-28T05:37:02.000Z","updated_at":"2024-05-23T18:25:59.000Z","dependencies_parsed_at":"2024-02-28T22:26:00.726Z","dependency_job_id":null,"html_url":"https://github.com/rodyherrera/node-mailu","commit_stats":null,"previous_names":["rodyherrera/node-mailu"],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rodyherrera%2Fnode-mailu","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rodyherrera%2Fnode-mailu/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rodyherrera%2Fnode-mailu/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rodyherrera%2Fnode-mailu/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rodyherrera","download_url":"https://codeload.github.com/rodyherrera/node-mailu/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239200176,"owners_count":19598945,"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":["api-rest","dkim","dmarc","fetchmail","mail","mailserver","mailu","nodejs","pop3","rest-client","smtp","webmail"],"created_at":"2024-11-06T12:33:09.649Z","updated_at":"2025-02-16T21:28:48.810Z","avatar_url":"https://github.com/rodyherrera.png","language":"JavaScript","readme":"## node-mailu\nThis client library provides a convenient way to interact with a Mailu API instance. It encapsulates the necessary details for authentication and interaction with various Mailu services.\n\n**Reference:**  Mailu's official RestAPI documentation.: [https://mailu.io/master/api.html](https://mailu.io/master/api.html)\n\n### Installation\nYou can install node-mailu via npm:\n```bash\nnpm install node-mailu\n```\n\n### Usage\n```javascript\nconst axios = require('axios');\nconst MailuClient = require('node-mailu');\n\n// Replace with your Mailu instance's endpoint and API key\nconst endpoint = 'https://mailu.yourdomain.com/api/v1';\nconst apiKey = 'YOUR_API_KEY'; \n\nconst mailuClient = new MailuClient(endpoint, apiKey);\n\n// Example: Creating a new user\n(async () =\u003e {\n    try{\n        const user = await mailuClient.userService.createUser({\n            email: 'newuser@example.com',\n            raw_password: 'yourpassword',\n            comment: 'New user account'\n        });\n        console.log('User created:', user.data);\n    }catch(error){\n        console.error('Error creating user:', error);\n    }\n})();\n\n```\n##### Important Note\nYour API key is stored within the `mailu` directory on your system, contained within the `.env` environment file. Reference the Mailu documentation for specifics.\n\n## Sections\n* **MailuClient**\n    * **Constructor** \n    * **useAxios**\n* **Services**\n    * **AliasService**\n    * **AlternativeService**\n    * **DomainService**\n    * **RelayService**\n    * **UserService** \n\n## MailuClient\nThe core client for interacting with the Mailu API.\n### Constructor\n```javascript\nconstructor(endpoint, apiKey)\n```\n* **endpoint** (string): The base URL of your Mailu API instance.\n* **apiKey** (string): An authorization key to access the Mailu API.\n\n### useAxios\nA utility method to handle API requests using Axios.\n```javascript\nuseAxios(method, path, data)\n```\n* **method** (string): The HTTP method to use ('get', 'post', etc.).\n* **path** (string): The endpoint path relative to the base URL.\n* **data** (object, optional):  Data to send in the request body.\n\n**Returns:** A Promise resolving with the API response data, or rejecting with an error.\n\n## Services\nEach service represents a domain of functionality within the Mailu API.\n\n### AliasService\nMethods for managing email aliases in Mailu.\n\n* **getAliases()** - Retrieves all aliases.\n* **createAlias(body)** - Creates a new alias.\n* **getAliasesFromDomain(domain)** - Retrieves aliases for a specific domain.\n* **updateAlias(alias, body)** - Updates an existing alias.\n* **getAlias(alias)** - Retrieves a single alias.\n* **deleteAlias(alias)** - Deletes an alias.\n\n### AlternativeService\nMethods for managing alternative addresses (additional emails for receiving to a user's inbox).\n\n* **getAlternatives()** - Retrieves all alternative addresses.\n* **createAlternative(body)** - Creates a new alternative address.\n* **getAlternative(alt)** - Retrieves details of an alternative address.\n* **deleteAlternative(alt)** - Deletes an alternative address.\n\n### DomainService\nMethods for managing domains in Mailu.\n\n* **getDomains()** - Lists all domains.\n* **createDomain(body)** - Creates a new domain.\n* **updateDomain(domain, body)** - Updates a domain.\n* **getDomain(domain)** - Retrieves details of a domain.\n* **deleteDomain(domain)** - Deletes a domain.\n* **generateDomainKeys(domain)** - Generates DKIM keys for a domain.\n* **getDomainManagers(domain)** - Lists managers for a domain.\n* **createDomainManager(domain, body)** - Adds a new domain manager.\n* **deleteDomainManager(domain, email)** - Removes a domain manager.\n* **getDomainManager(domain, email)** - Retrieves details of a domain manager.\n* **getUsersFromDomain(domain)** - Lists users of a domain.\n\n### RelayService\n\nMethods for managing email relays.\n\n* **getRelays()** - Lists all relays.\n* **createRelay(body)** - Creates a new relay.\n* **updateRelay(name, body)** - Updates a relay.\n* **getRelay(name)** - Gets details of a relay.\n* **deleteRelay(name)** - Deletes a relay.\n\n### UserService\n\nMethods for managing Mailu users.\n\n* **getUsers()** - Lists all users.\n* **createUser(body)** -  Creates a new user.\n* **updateUser(email, body)** - Updates a user.\n* **getUser(email)** - Retrieves details of a user.\n* **deleteUser(email)** - Deletes a user. ","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frodyherrera%2Fnode-mailu","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frodyherrera%2Fnode-mailu","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frodyherrera%2Fnode-mailu/lists"}