feat(MTA): Update readme with detailed Mail Transfer Agent usage and examples

This commit is contained in:
Philipp Kunz 2025-03-15 16:09:18 +00:00
parent 018b499010
commit 87917f68fb
3 changed files with 83 additions and 3 deletions

View File

@ -1,5 +1,11 @@
# Changelog # Changelog
## 2025-03-15 - 2.1.0 - feat(MTA)
Update readme with detailed Mail Transfer Agent usage and examples
- Added a comprehensive MTA section with usage examples including SMTP server setup, DKIM signing/verification, SPF/DMARC support, and API integration
- Expanded the conclusion to highlight MTA capabilities alongside email, SMS, letter, and AI services
## 2025-03-15 - 2.0.0 - BREAKING CHANGE(platformservice) ## 2025-03-15 - 2.0.0 - BREAKING CHANGE(platformservice)
Remove deprecated AIBridge module and update email service to use the MTA connector; update dependency versions and adjust build scripts in package.json. Remove deprecated AIBridge module and update email service to use the MTA connector; update dependency versions and adjust build scripts in package.json.

View File

@ -103,6 +103,81 @@ async function sendLetter() {
sendLetter(); sendLetter();
``` ```
### Mail Transfer Agent (MTA)
The platform includes a robust Mail Transfer Agent (MTA) for enterprise-grade email handling with complete control over the email delivery process:
```mermaid
graph TD
API[API Clients] --> ApiManager
SMTP[External SMTP Servers] <--> SMTPServer
subgraph "MTA Service"
MtaService[MTA Service] --> SMTPServer[SMTP Server]
MtaService --> EmailSendJob[Email Send Job]
MtaService --> DnsManager[DNS Manager]
MtaService --> DkimCreator[DKIM Creator]
ApiManager[API Manager] --> MtaService
end
subgraph "External Services"
DnsManager <--> DNS[DNS Servers]
EmailSendJob <--> MXServers[MX Servers]
end
```
The MTA service provides:
- Complete SMTP server for receiving emails
- DKIM signing and verification
- SPF and DMARC support
- DNS record management
- Retry logic with queue processing
- TLS encryption
Here's how to use the MTA service:
```ts
import { MtaService, Email } from '@serve.zone/platformservice';
async function useMtaService() {
// Initialize MTA service
const mtaService = new MtaService(platformService);
await mtaService.start();
// Send an email
const email = new Email({
from: 'sender@yourdomain.com',
to: 'recipient@example.com',
subject: 'Hello World',
text: 'This is a test email',
html: '<p>This is a <b>test</b> email</p>',
attachments: [] // Optional attachments
});
const emailId = await mtaService.send(email);
console.log(`Email queued with ID: ${emailId}`);
// Check email status
const status = mtaService.getEmailStatus(emailId);
console.log(`Email status: ${status.status}`);
// Set up API for external access
const apiManager = new ApiManager(mtaService);
await apiManager.start(3000);
console.log('MTA API running on port 3000');
}
useMtaService();
```
The MTA provides key advantages for applications requiring:
- High-volume email sending
- Compliance with email authentication standards
- Detailed delivery tracking
- Custom email handling logic
- Multi-domain email management
- Complete control over email infrastructure
### Leveraging AI Services ### Leveraging AI Services
The platform also integrates AI functionalities, allowing for innovative use cases like generating content, analyzing text, or automating responses: The platform also integrates AI functionalities, allowing for innovative use cases like generating content, analyzing text, or automating responses:
@ -122,5 +197,4 @@ useAiService();
### Conclusion ### Conclusion
The `@serve.zone/platformservice` offers a robust set of features for modern application requirements, including but not limited to communication and AI services. By following the examples above, developers can integrate these services into their applications, harnessing the power of email, SMS, letters, and artificial intelligence seamlessly. The `@serve.zone/platformservice` offers a robust set of features for modern application requirements, including but not limited to communication and AI services. By following the examples above, developers can integrate these services into their applications, harnessing the power of email, SMS, letters, MTA capabilities, and artificial intelligence seamlessly.
undefined

View File

@ -3,6 +3,6 @@
*/ */
export const commitinfo = { export const commitinfo = {
name: '@serve.zone/platformservice', name: '@serve.zone/platformservice',
version: '2.0.0', version: '2.1.0',
description: 'A multifaceted platform service handling mail, SMS, letter delivery, and AI services.' description: 'A multifaceted platform service handling mail, SMS, letter delivery, and AI services.'
} }