Commit graph

1018 commits

Author SHA1 Message Date
NickOvt 5af8126e54
fix(api-domainaliases): Added DomainAliases API endpoints to API docs generation ZMS-132 (#641)
* added List registered Domain Aliases endpoint to API docs generation

* added Create new Domain Alias API endpoint to API docs generation

* added Resolve ID for a domain alias API endpoint to API docs generation

* added Delete an Alias API endpoint to API docs generation

* Added Request Alias information API endpoint to API docs generation
2024-03-07 10:25:14 +02:00
NickOvt 64c6b5e63c
fix(api-quota): Quota reset now also logs storage diff. Log now includes zero valued fields ZMS-128 (#640)
* Log storage diff for quota usage recalculation API endpoint. Also logs 0

* include _set as required key as well
2024-02-29 10:32:40 +02:00
NickOvt f6f5f5eb65
fix(api-autoreplies): Added logging to graylog. Autoreply docs have a created field now ZMS-127 (#633)
* Update Autoreply information api endpoint added to api docs generation

* Delete Autoreply information api endpoint added to api docs generation

* Request Autoreply information api endpoint added to api docs generation

* autoreply now contains the created field to check when it was created. Added logging to graylog

* make created timestamp second precision. Fix tests

* autoreply.js add optional chaining
2024-02-26 11:08:25 +02:00
NickOvt 0efae19f9e
fix(api-2fa): Added 2FA API endpoints to API docs generation ZMS-124 (#626)
* added Generate TOTP seed api endpoint to API generation

* added Enable TOTP api endpoint to API docs generation

* added Disable TOTP auth api endpoint to API docs generation

* added Validate TOTP token api endpoint to API docs generation

* added Disable 2FA api endpoint to API docs generation

* Added Enable custom 2FA for a user api endpoint for API docs generation

* Disable custom 2FA for a user endpoint added to API docs generation. Fix imports

* added Get WebAuthN credentials for a user api endpoint to api docs generation

* WebAuthN del and registration endpoints added to API docs generation

* webAuthN authentication challenge and attestation endpoints added to API docs generation

* fix rpId descriptions

* add response objects to endpoints
2024-02-26 09:57:39 +02:00
NickOvt 78a9e1b2a8
fix(api-dkim): Add all DKIM API endpoints to API docs generation ZMS-129 (#630)
* added List registered DKIM keys to API docs generation

* Added Resolve ID for a DKIM domain api endpoint to API docs generation

* Added Delete a DKIM key api endpoint to API docs generation

* Added Request DKIM information api endpoint to api docs generation. Fix typo

* added create or update dkim key for domain api endpoint to api docs generation
2024-02-26 09:34:36 +02:00
Andris Reinman f61111e3cc
fix(pop3-starttls): ensure default SNICallback option 2024-02-26 09:16:46 +02:00
NickOvt aa60ef93fe
fix(api-autoreply): Autoreply API endpoints added to API docs generation ZMS-130 (#632)
* Update Autoreply information api endpoint added to api docs generation

* Delete Autoreply information api endpoint added to api docs generation

* Request Autoreply information api endpoint added to api docs generation
2024-02-23 13:31:08 +02:00
NickOvt 7e9e62ea7a
fix(api-addresses): Fix tags typo in addresses.js (#627) 2024-02-23 13:28:39 +02:00
NickOvt 3d7d0a6d6a
fix(api-dkim): DKIM now supports ED25519 keys, both in PEM and raw format as input ZMS-125 (#617)
* dkim, add support for ed25519

* add support for raw ED25519 private key

* magic value make variable. Remove unnecessary variables. Refactor

* add new tests for ED25519
2024-02-19 09:46:46 +02:00
NickOvt 6f0e4b54be
fix(api-filters): Filter creation is now logged to graylog and authlog ZMS-34 (#616)
* log filter creation to logs

* api.js, filterroutes, remove unnecessary loggelf param

* instead of dumping all filter data, create a human readable description of it using getFilterStrings

* separate getFilterStrings data into _filter_query and _filter_action fields, make them human-readable by joining
2024-02-19 09:45:46 +02:00
NickOvt 95f829d16a
fix(api-filters): Add Filters API endpoints to API docs generation ZMS-121 (#611)
* added List all FIltes endpoint to api docs generation

* List Filters for a User endpoint added to API docs generation

* Request Filter information endpoint added to API docs generation. Add schemas

* fix description

* added Delete a Filter api endpoint to API docs generation

* New schemas for filter api endpoints. Added Create a mew Filter api endpoint to API docs generation

* fix schemas. Added Update Filter information endpoint to api docs generation
2024-02-05 10:30:02 +02:00
NickOvt c7a1ab4987
fix(api-generate): Move API generation code into separate package and use it ZMS-119 (#613)
* test initial design of API generation as a restify plugin. next extract it into separate npm package and add more checks/logs etc.

* remove API docs generation from the WILDDUCK specific tools.js file into a separate file. Do appropriate changes

* move api generation into separate npm package, currently local

* add restifyapigenerate package and use it, fix path

* separate API docs generation config into a separate file. Fix API docs generation package version
2024-02-05 10:29:24 +02:00
NickOvt 84ab0c09dc
feat(api-health): Added /health endpoint to check Wildduck API health during runtime ZMS-120 (#607)
* add health api endpoint to check health of API

* fixes and add graylog logging

* round timestamp, cast to string. Use mongodb ping instead of topology.isConnected check

* add timeout to redis commands so that the health api endpoint will return a value
2024-01-26 10:23:01 +02:00
Louis Laureys 816114f655
fix(message-threading): Take non-standard but conventional subject prefixes into account (#605) 2024-01-25 09:02:55 +02:00
NickOvt 85e09ecc77
feat(api-addresses): ZMS-115 (#608)
* List registered Addresses API endpoint added to API docs generation

* Create new Address API endpoint to API generation

* Create new Address API endpoint to API generation. List registered Addresses for a User api endpoint added to api generation

* Request Addresses information api endpoint added to api generation

* Update Address information api endpoint added to api endpoint generation

* Delete an Address endpoint added to api generation

* List addresses from communication register endpoint added to api docs generation. Add example to userId

* Create new forwarded Address api endpoint added to api docs generation

* Update forwarded Address information API endpoint added to API docs generation

* Delete a forwarded Address endpoint added to API docs generation

* Request forwarded Addresses information endpoint added to API docs generation

* Get Address info endpoint added to API docs generation

* Rename domain in addresses endpoint added to API docs generation
2024-01-24 10:07:30 +02:00
NickOvt 76d0e8f9e2
feat(api-mailboxes): Mailboxes API endpoints added to automatic API docs generation ZMS-114 (#602)
* added List Mailboxes for a User endpoint to API generation

* Request Mailbox information endpoint added to API generation

* Update Mailbox information endpoint added to API generation

* added Delete a Mailbox endpoint to API generation. Add example to Request Mailbox information API endpoint

* fix mailbox path param in Request Mailbox information

* GetMailboxesResult retention should be not required, fix accidental typo
2024-01-12 12:54:56 +02:00
NickOvt 5721047bc1
fix(journal-parse): Improve idle CPU performance ZMS-109 (#597)
* optimize CPU performance, reduce amount of calls to JSON.parse

* default to needFullParse, otherwise do not do full parse
2024-01-05 10:31:07 +02:00
NickOvt 8b7f6c923e
feat(api-upload): Allow to upload a draft message with incorrect (non-emal) to addresses ZMS-117 (#595)
* strip to adresses that are incorrect but still save the message

* toObj.to fix to toObj.address as per the model
2024-01-04 13:30:27 +02:00
NickOvt 6bdeeaa164
feat(upload): ZMS-111 (#584) 2024-01-04 13:22:04 +02:00
Andris Reinman eecb31ac9a
fix(pop3): if connection is closed during authentication, then do not process the response. Fixes #596 2024-01-04 10:38:33 +02:00
Louis Laureys a4ae3d7113
feat(api-search): Allow searching for messages by uid (#587) 2024-01-02 13:23:43 +02:00
NickOvt 5165f3e172
Merge branch 'master' into ZMS-118 2024-01-02 13:16:32 +02:00
Nikolai Ovtsinnikov b0d0e7b955
fix securitySchemes 2024-01-02 13:10:04 +02:00
NickOvt fae91d1484
fix(api-docs): Fixed requestBody in API docs ZMS-118 (#593)
* optimize CPU usage

* fix requestBody issues in API docs generation

* fix requestBody issues for API generation

* Revert "optimize CPU usage"

This reverts commit b4fde61884.
2024-01-02 12:50:06 +02:00
Nikolai Ovtsinnikov 3b6ba9ae03
Revert "optimize CPU usage"
This reverts commit b4fde61884.
2024-01-02 12:34:20 +02:00
Nikolai Ovtsinnikov 17232dd5e0
fix requestBody issues for API generation 2024-01-02 12:33:05 +02:00
Nikolai Ovtsinnikov 713a06c216
fix requestBody issues in API docs generation 2024-01-02 12:28:13 +02:00
Andris Reinman c886383d26
Merge branch 'master' of github.com:nodemailer/wildduck 2024-01-02 11:24:35 +02:00
Andris Reinman 43365542a3
fix(api-search): Fixed or query. Fixes #592 2024-01-02 11:24:28 +02:00
NickOvt a15878c7d7
fix(docs): /users API docs ZMS-110 (#575)
* /users GET endpoint added

* added /users POST to api generation

* added /users/resolve/:username GET endpoint for api generation

* fixes + request user info GET endpoint added

* Added Update User information api path to api docs generation

* added Log out User endpoint to api generation

* Added Recalculate User quota endpoint to API generation

* added Recalculate Quota for all users endpoint to api generation

* added Export data endpoint to API generation

* added Import user data endpoint to API generation

* Reset password for a User endpoint added to API generation

* Reset password for a User endpoint add param to res

* add missing response types

* added Delete a User, Return recovery info for a deleted User, Cancel user deletion task - endpoints to API generation

* fix typo in users.js
2023-12-21 10:42:09 +02:00
NickOvt 29cffe0d5f
fix(api): header.key and header.value not required ZMS-116 (#582)
* remove unnecessary required() that brakes the e-mail send

* fix Header object as well, remove unnecessary required
2023-12-19 11:12:15 +02:00
NickOvt d80ba77650
fix(api): Remove unnecessary required() that brakes the e-mail send (#580) 2023-12-19 10:41:51 +02:00
NickOvt c1e28db0f3
fix(upload): allow empty name field in the Upload message FROM: header ZMS-113 (#577)
* allow empty name field in the Upload message FROM: header

* allow empty name for reply-to also
2023-12-15 12:58:03 +02:00
Nikolai Ovtsinnikov b4fde61884
optimize CPU usage 2023-12-15 12:05:17 +02:00
Andris Reinman 9aab24267b
fix(defer): Added new setting const:sender:defer_times ZMS 63 (#574)
* Added new setting const:sender:defer_times

* Bumped deps
2023-12-14 14:00:31 +02:00
NickOvt 28bdc7621e
fix(docs): Added support for enums ZMS-104 (#565)
* query params add support for enums and example

* add general enum and example support for requestBody as well
2023-11-30 14:29:12 +02:00
NickOvt 3c9e17595c
fix(docs): Fixed descriptions ZMS-101 (#553)
* api.js added endpoint for generating openapi docs. added new info to one route in mailboxes.js and messages.js files so that the api docs generation can be done at all

* try to first generate json representation of the api docs

* add initial Joi Object parsing

* api.js make generation dynamic. messages.js add schemas from separate file. messages-schemas.js used for messages endpoint schemas

* add additions to schemas. Add new schemas to messages.js and also add response object there. Add response object parsing functionality to api.js

* add initial openapi doc yml file generation

* remove manual yaml parsing with js-yaml JSON -> YAML parsing

* fix replaceWithRefs and parseComponentsDecoupled functions, refactor, remove unnecessary comments and logs

* add support for another endpoint

* move big code from api.js to tools

* fix array type representation, fix response objects, add necessary data and changes to endpoints

* redo include logic into exclude login

* fix api generation in tools.js to accomodate new naming of objects

* fix messages.js, add structuredClone check in tools.js

* fix structured clone definition

* add one endpoint in messages.js to the api generation

* messages.js add one more endpoint to API generation

* add response to prev commit. Add new endpoint to API generation. Archive message and archive messages

* finish with post endpoints in messages.js

* added general request and response schemas. Also added req and res schemas for messages

* add multiple GET endpoints to API generation and changed them to new design. Use general schemas made earlier

* fix incorrect import of successRes

* fix mailboxes.js

* refactor general-schemas.js. Fix searchSchema in messages.js. Mailboxes.js fix response

* tools.js rename methodObj in API generation to operationObj

* tools.js api generation remove string fallbacks

* messages.js finish with GET endpoints, addition to API doc generation

* fix description on the object issue

* add descriptions to fields for the schemas in the messages-schemas.js file

* remove yarml import in tools.js
2023-11-30 14:27:00 +02:00
NickOvt be24af0d26
fix(addressregister): Do not add no-reply addresses to the addressregister ZMS-99 (#551)
* add check for noreply and no-reply in the email

* add check for disallowed headers

* use case insensitive regex instead of hardcoded values
2023-11-30 09:12:06 +02:00
titanism fd98244342
fix(imap-search): rename headerdate to date (closes #560) (#561) 2023-11-26 08:41:21 +02:00
NickOvt ea24b9328b
feat(apidocs): Autogenerate OpenAPI docs ZMS-100 (#552)
* api.js added endpoint for generating openapi docs. added new info to one route in mailboxes.js and messages.js files so that the api docs generation can be done at all

* try to first generate json representation of the api docs

* add initial Joi Object parsing

* api.js make generation dynamic. messages.js add schemas from separate file. messages-schemas.js used for messages endpoint schemas

* add additions to schemas. Add new schemas to messages.js and also add response object there. Add response object parsing functionality to api.js

* add initial openapi doc yml file generation

* remove manual yaml parsing with js-yaml JSON -> YAML parsing

* fix replaceWithRefs and parseComponentsDecoupled functions, refactor, remove unnecessary comments and logs

* add support for another endpoint

* move big code from api.js to tools

* fix array type representation, fix response objects, add necessary data and changes to endpoints

* redo include logic into exclude login

* fix api generation in tools.js to accomodate new naming of objects

* fix messages.js, add structuredClone check in tools.js

* fix structured clone definition

* add one endpoint in messages.js to the api generation

* messages.js add one more endpoint to API generation

* add response to prev commit. Add new endpoint to API generation. Archive message and archive messages

* finish with post endpoints in messages.js

* added general request and response schemas. Also added req and res schemas for messages

* add multiple GET endpoints to API generation and changed them to new design. Use general schemas made earlier

* fix incorrect import of successRes

* fix mailboxes.js

* refactor general-schemas.js. Fix searchSchema in messages.js. Mailboxes.js fix response

* tools.js rename methodObj in API generation to operationObj

* tools.js api generation remove string fallbacks

* messages.js finish with GET endpoints, addition to API doc generation

* for openApi doc generation use JSON now instead of YAML
2023-11-10 17:55:16 +02:00
Andris Reinman 4434cb5e1f
fix(mailbox-create): Use correct database for loading User data when creating mailboxes (#550) 2023-11-06 12:30:23 +02:00
Andris Reinman 48b9efb8ca
fix(audit): Fixed find() query for expired audits (#547) 2023-10-30 10:55:39 +02:00
NickOvt aae91bb6ac
Zms 91 (#545)
* added new file to test git repo setup

* add limit_allowed and limit_sent to loggelf in messages in API. Also if multiple recipients log each message separately

* typo fix

* messages.js refactor code. Make cleaner

* fix _limit_sent. Fix earlier issue too

* session -> sess. Session doesn't exist on request objs, sess exists

* return pback the general SUBMIT log message to track API endpoint usage
2023-10-26 13:11:45 +03:00
NickOvt 779bb11e83
feat(mailbox-count-limit): Set a limit for maximum number of mailbox folders ZMS-93 (#542)
* add max mailboxes to settings and consts

* rewrite mailbox handler create function, convert it to async as well as add check for max mailboxes

* mailboxes.js add support for new createAsync function, refactor. tools.js add support for new error code

* make userDate check the first check

* fix error message, make it clearer. Remove OVERQUOTA error code and replace with CANNOT. Remove OVERQUOTA error in the tools.js as well

* fix createAsync wrapper, strict ordering. Settings handler remove unnecessary second param
2023-10-24 11:07:12 +03:00
Andris Reinman c00cc02658
fix(api-filters): Return valid action.mailbox value for a filter object 2023-10-16 12:21:16 +03:00
Andris Reinman 292bbc2821
fix(attachments): Added contentDisposition property for attachments 2023-10-12 15:23:11 +03:00
Andris Reinman 1fee80eb30
fix(deps): Bumped nodemailer to force embedded images to content-disposition:inline 2023-10-09 14:40:18 +03:00
Andris Reinman 2de6c0bc12
fix(pop3): run socket.destroy() if pop3 socket is not closed in 1.5s 2023-10-05 11:27:07 +03:00
titanism be900691da
Update imap-notifier.js (fixed typo subscriber > subscriber) (#513) 2023-10-04 22:44:37 +03:00
Andris Reinman b9349f6e83
fix(sending): Do not count sending limits twice (#505) 2023-09-28 13:34:29 +03:00