Domains

Configure custom sending domains with SPF, DKIM, and DMARC records to maximize deliverability.

Adding a Domain

To send emails from your own domain (e.g. noreply@yourdomain.com), you must verify that you own the domain. PostaSend provides DNS records you add to your domain registrar. Verification typically takes a few minutes but can take up to 48 hours for DNS propagation.

typescript
// Add a domain programmatically
const domain = await client.domains.create({
  domain: 'yourdomain.com',
});

// PostaSend returns the DNS records to add
console.log(domain.dnsRecords);
// [
//   { type: 'TXT', host: '_postasend-verify.yourdomain.com', value: 'ms-verify=abc...' },
//   { type: 'TXT', host: 'yourdomain.com', value: 'v=spf1 include:spf.postasend.dev ~all' },
//   { type: 'CNAME', host: 'ms1._domainkey.yourdomain.com', value: 'ms1.dkim.postasend.dev' },
// ]

Verifying DNS Records

After adding the DNS records, trigger a verification check. PostaSend will attempt to resolve each record and return the current verification status. A domain must pass SPF and DKIM verification before emails can be sent from it.

typescript
const result = await client.domains.verify('yourdomain.com');

console.log(result.status); // 'verified' | 'pending' | 'failed'
console.log(result.records);
// [
//   { type: 'SPF',  status: 'verified' },
//   { type: 'DKIM', status: 'verified' },
//   { type: 'DMARC', status: 'pending' },
// ]

DMARC Policy

DMARC builds on SPF and DKIM to tell receiving mail servers what to do with messages that fail authentication. PostaSend recommends starting with a p=none policy to monitor, then progressively tightening to p=quarantine and finally p=reject.

bash
# Recommended DMARC record (start with monitoring)
# Type: TXT
# Host: _dmarc.yourdomain.com
# Value:
v=DMARC1; p=none; rua=mailto:dmarc-reports@yourdomain.com; ruf=mailto:dmarc-failures@yourdomain.com; fo=1

Dedicated IP Pools

Enterprise accounts can request dedicated IP pools for high-volume sending. Dedicated IPs give you complete control over your sender reputation. PostaSend manages IP warming automatically with configurable ramp-up schedules.

typescript
// Enterprise: create a dedicated IP pool
const pool = await client.ipPools.create({
  name: 'transactional-main',
  type: 'dedicated',
});

// Assign a domain to an IP pool
await client.domains.update('yourdomain.com', {
  ipPoolId: pool.id,
});