Bounce detection

Learn how to detect bounced emails using Unipile API.

Unipile allow you to be notified when a sent email bounces back with the reason using webhooks.


Setup

1. Configure a webhook

Configure a webhook to receive the wanted events email.new.bounce


2. Handle events

In your webhook handler, you should now receive events with the following payload as soon as a bounced email is received in the mailbox.

{
  "reason": "This is the mail system at host mailer.acme.email.\n\nI'm sorry to have to inform you that your message could not be delivered to one or more recipients. It's attached below.\n\nFor further assistance, please send mail to postmaster.\n\nIf you do so, please include this problem report. You can delete your own text from the attached returned message.\n\nThe mail system",
  "date": "2025-08-14T14:30:00Z",
  "type": "no_such_recipient",
  "code": 550,
  "email": {} // Original email
}

Error types

Here is all error types you can encounter:

codetypeRFC Explanation
421service_not_available / server_busy / ip_blocked_spamThe server is temporarily unavailable and closing the connection.
432password_neededTemporary authentication failure requiring a password update or reset (obsolete in modern RFCs but common).
450action_not_taken_mailbox_unavailable / rate_limitedRequested action not taken; mailbox busy, unavailable, or temporarily rate-limited.
451action_aborted_local_error / timeout / protocol_violationTemporary processing error; local problem or protocol issue.
452insufficient_system_storage / mailbox_over_quotaAction not taken due to insufficient storage or full mailbox.
454authentication_issue / protocol_violationTemporary authentication or TLS-related failure.
455server_unable_to_accommodate_parametersServer cannot accept provided parameters (unsupported or invalid).
500syntax_errorCommand unrecognized due to a syntax error.
501syntax_error_parameters / invalid_helo_ehloSyntax error in command parameters or invalid HELO/EHLO argument.
502command_not_implementedCommand recognized but not implemented by the server.
503bad_commands_sequence / no_identity_changes_permittedBad sequence of commands or forbidden authentication state transition.
504parameter_not_implemented / unknown_auth_typeCommand parameter not implemented; unsupported authentication type.
530authentication_requiredAuthentication required before sending mail.
550action_not_taken / no_such_recipient / spam_contentRequested action not taken—mailbox unavailable or rejected as spam.
551user_not_localUser not local; server suggests an alternate recipient/path.
552exceeded_storage_allocation / mailbox_over_quotaAction aborted—storage limit exceeded.
553mailbox_name_not_allowed / no_such_recipientInvalid mailbox name or nonexistent recipient.
554transaction_failed / spam_contentTransaction failed permanently; often spam or policy rejection.
555parameters_not_recognized / syntax_errorMAIL/RCPT parameter not recognized; syntax error.