
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
A robust TypeScript email service package with automatic failover and multiple provider support. Built for reliability and ease of use in modern Node.js applications.
npm install skymail
import { EmailService, SendGridProvider, MailgunProvider } from 'skymail';
// Initialize providers
const sendgrid = new SendGridProvider({
apiKey: 'YOUR_SENDGRID_API_KEY',
maxRetries: 3,
retryDelay: 1000
});
const mailgun = new MailgunProvider({
apiKey: 'YOUR_MAILGUN_API_KEY',
domain: 'YOUR_DOMAIN',
maxRetries: 3,
retryDelay: 1000
});
// Create service with failover
const emailService = new EmailService([
{ provider: sendgrid, priority: 1 }, // Primary
{ provider: mailgun, priority: 2 } // Backup
]);
// Send email
try {
const success = await emailService.sendEmail({
to: 'recipient@example.com',
from: 'sender@yourdomain.com',
subject: 'Hello!',
text: 'Message content',
html: '<p>Message content</p>'
});
console.log('Email sent:', success);
} catch (error) {
console.error('Failed to send:', error);
}
The package follows a modular design with three main components:

interface SendGridConfig {
apiKey: string; // Required
maxRetries?: number; // Optional (default: 3)
retryDelay?: number; // Optional (default: 1000ms)
}
interface MailgunConfig {
apiKey: string; // Required
domain: string; // Required
maxRetries?: number; // Optional (default: 3)
retryDelay?: number; // Optional (default: 1000ms)
}
interface EmailMessage {
to: string | string[];
from: string;
subject: string;
text: string;
html?: string;
cc?: string | string[];
bcc?: string | string[];
replyTo?: string;
attachments?: Array<{
filename: string;
content: Buffer | string;
contentType?: string;
}>;
}
import { AbstractEmailProvider, EmailMessage } from 'skymail';
export class CustomProvider extends AbstractEmailProvider {
constructor(config: YourConfig) {
super(config);
}
protected async sendEmailRequest(message: EmailMessage): Promise<boolean> {
// Implement provider-specific sending logic
return true;
}
public async isAvailable(): Promise<boolean> {
// Implement availability check
return true;
}
}
// Add new provider
emailService.addProvider(newProvider, 3);
// Remove provider
emailService.removeProvider(existingProvider);
// Update priority
emailService.updatePriority(existingProvider, 2);
// Check status
const status = await emailService.getProvidersStatus();
try {
const result = await emailService.sendEmail(message);
if (!result) {
// All providers failed
}
} catch (error) {
if (error instanceof InvalidEmailError) {
// Handle validation errors
} else {
// Handle other errors
}
}
git checkout -b feature/amazing-feature)git commit -m 'Add amazing feature')git push origin feature/amazing-feature)This project is licensed under the ISC License - see the LICENSE file for details.
FAQs
A robust email service with multiple provider support and automatic failover
We found that skymail demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.