[pull] master from SchemaStore:master#396
Merged
pull[bot] merged 3 commits intoUncodedtech:masterfrom Feb 12, 2026
Merged
Conversation
# Add Mail Servers Configuration JSON Schema
## Description
Adds a JSON schema for storing mail server configurations for different domains. The schema supports flexible configuration of POP3, IMAP, and SMTP servers with strict validation rules.
## Changes
### New Schema
- `src/schemas/json/mail-servers-config.json` - Main configuration schema for mail servers
### Tests
- **Positive Tests** (`src/test/mail-servers-config/`):
- `valid-complete.json` - Full configuration with POP3, IMAP, and SMTP
- `valid-minimal-imap-smtp.json` - IMAP and SMTP only
- `valid-pop-only.json` - POP3 only
- `valid-multiple-protocols.json` - Various protocol combinations for different domains
- `valid-default-ports.json` - Validation with default port values
- **Negative Tests** (`src/negative_test/mail-servers-config/`):
- `invalid-port-range.json` - Ports outside 1-65535 range
- `extra-property-domain.json` - Additional properties at domain level
- `extra-property-protocol.json` - Additional properties in protocol objects
- `empty-object.json` - Empty object (violates minProperties: 1)
- `invalid-hostname.json` - Invalid hostname format
- `missing-host.json` - Missing required host field
- `missing-port.json` - Missing required port field
- `wrong-type.json` - Incorrect data types
### Catalog Entry
Added to `src/api/json/catalog.json`:
```json
{
"name": "Mail Servers Configuration",
"description": "Schema for storing mail server configurations",
"fileMatch": [
"mail-servers-config.json",
"mail-servers-config.jsonc",
"mail-servers-config.json5",
"*.mail-servers-config.json",
"*.mail-servers-config.jsonc",
"*.mail-servers-config.json5",
"**/mail-servers-config.json",
"**/mail-servers-config.jsonc",
"**/mail-servers-config.json5"
],
"url": "https://www.schemastore.org/mail-servers-config.json"
}
```
## Schema Features
### Configuration Flexibility
1. **Optional Protocols:** Each domain can contain any combination of POP3, IMAP, and SMTP protocols
2. **Strict Protocol Validation:** Each protocol requires both host and port fields
3. **No Additional Properties:** Extra properties are disallowed at both domain and protocol levels
### Data Validation
- **Ports:** Restricted to valid range 1-65535
- **Hostname:** Validated against hostname format
- **Default Values:** Standard ports are suggested:
- POP3: 995
- IMAP: 993
- SMTP: 587
- **Minimum One Domain:** At least one domain configuration is required (`minProperties: 1`)
## Typical Usage Example
```json
{
"gmail.com": {
"imap": {"host": "imap.gmail.com", "port": 993},
"smtp": {"host": "smtp.gmail.com", "port": 587}
},
"outlook.com": {
"imap": {"host": "outlook.office365.com", "port": 993},
"smtp": {"host": "smtp.office365.com", "port": 587}
}
}
```
## Validation
- ✅ All tests pass validation with Ajv
- ✅ Schema conforms to draft-07 specification
- ✅ Compatible with strict mode
- ✅ Comprehensive edge case coverage
## Potential Use Cases
1. **Email Client Configuration:** Storing settings for different email providers
2. **Mailbox Migration:** Describing source and destination mail servers
3. **Infrastructure Documentation:** Centralized storage of company mail server configurations
4. **Automation Scripts:** Use in scripts for automatic email client configuration
## Compatibility
- Compatible with all JSON Schema validators supporting draft-07
- Supported in VS Code, IntelliJ IDEA, and other IDEs through SchemaStore
- Can be used with `yaml-language-server` for YAML files
## Checklist
- Schema follows draft-07 specification
- Added both positive and negative test cases
- All tests pass validation
- Added catalog entry with appropriate fileMatch patterns
- No breaking changes to existing schemas
- Schema is compatible with strict mode
for more information, see https://pre-commit.ci
Mail Servers Configuration
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
See Commits and Changes for more details.
Created by
pull[bot] (v2.0.0-alpha.4)
Can you help keep this open source service alive? 💖 Please sponsor : )