Handling Bounces and Suppressions to Protect Sender Reputation
Master bounce handling and suppression lists to maintain a pristine sender reputation. Learn how Piisend's automatic suppression and webhook-driven feedback ensure optimal email deliverability and robust list hygiene.
Section 1
The Critical Role of Bounce and Suppression Handling
Effective bounce handling is paramount for maintaining high email deliverability and a strong sender reputation. When emails fail to reach their recipients, it signals to ISPs that your sending practices might be problematic. Piisend automatically manages a suppression list, preventing you from repeatedly sending to invalid or unresponsive addresses, which is a cornerstone of good list hygiene.
Section 2
Piisend's Automatic Suppression for Deliverability
Piisend automatically adds email addresses that result in hard bounces or spam complaints to your account's suppression list. This proactive measure ensures that future sends to these addresses are blocked, safeguarding your sender reputation and improving overall deliverability. This automatic bounce handling prevents wasted sends and helps you focus on engaged recipients.
1curl -sS -X POST https://api.piisend.com/api/v1/emails \2 -H "Authorization: Bearer YOUR_API_KEY" \3 -H "Content-Type: application/json" \4 -d '{5 "to": ["invalid@example.com"],6 "subject": "Test email for bounce handling",7 "html": "<p>This email is a test.</p>",8 "text": "This email is a test."9 }'Section 3
Real-time Bounce and Complaint Feedback with Webhooks
For advanced bounce handling and real-time updates, Piisend's webhooks are indispensable. By configuring webhook delivery events, you receive instant notifications for bounces, spam complaints, and other critical email statuses. This immediate complaint feedback allows you to update your internal systems, refine your list hygiene, and make informed decisions about when to stop sending to specific users, ensuring your transactional email API integration is robust.
1import crypto from 'crypto';2 3export function verifyWebhook(rawBody, signature, secret) {4 const expected = crypto5 .createHmac('sha256', secret)6 .update(rawBody)7 .digest('hex');8 9 const a = Buffer.from(signature);10 const b = Buffer.from(expected);11 if (a.length !== b.length) return false;12 return crypto.timingSafeEqual(a, b);13}14 15// Express: use express.raw({ type: 'application/json' }) so body is a Buffer16app.post('/webhooks/piisend', (req, res) => {17 const signature = req.get('X-Webhook-Signature') || '';18 const ok = verifyWebhook(req.body, signature, process.env.PIISEND_WEBHOOK_SECRET);19 if (!ok) return res.status(401).send('invalid signature');20 21 const event = JSON.parse(req.body.toString('utf8'));22 if (event.type === 'bounce' || event.type === 'complaint') {23 // stop sending to this address in your app24 }25 res.status(200).end();26});Section 4
When to Retry and When to Stop: Manual Review and Strategy
Understanding the difference between hard and soft bounces is key. Hard bounces indicate a permanent delivery failure (e.g., invalid address), prompting immediate removal from your active lists. Soft bounces are temporary (e.g., mailbox full) and might warrant a few retries. Regularly reviewing your suppression list in the Piisend dashboard, alongside webhook data, empowers you to make strategic decisions about when to retry a send or permanently cease attempts, optimizing your email deliverability and ensuring robust list hygiene.