SMTP

Giả lập phản hồi 550 Mailbox Not Found

The requested action was not taken because the mailbox does not exist or the recipient address is rejected by policy. This is a permanent failure indicating the address is invalid or blocked.

Xem tài liệu tham khảo đầy đủ →

1 Phản hồi HTTP

Phản hồi HTTP
HTTP/1.1 550 Mailbox Not Found
Content-Type: application/json
Date: Tue, 25 Feb 2026 12:00:00 GMT
Content-Length: 57

{
  "error": "server_error",
  "message": "Mailbox Not Found"
}

2 Kiểm tra với curl

terminal
curl -i https://httpbin.org/status/550

3 Trả về 550 Mailbox Not Found trong Framework của bạn

django
from django.http import JsonResponse


def my_view(request):
    return JsonResponse(
        {"error": "server_error", "message": "Mailbox Not Found"},
        status=550,
    )
flask
from flask import Flask, jsonify

app = Flask(__name__)


@app.route("/endpoint")
def my_endpoint():
    return jsonify({"error": "server_error", "message": "Mailbox Not Found"}), 550
fastapi
from fastapi import FastAPI
from fastapi.responses import JSONResponse

app = FastAPI()


@app.get("/endpoint")
def my_endpoint():
    return JSONResponse(
        content={"error": "server_error", "message": "Mailbox Not Found"},
        status_code=550,
    )
express.js
// Express.js
app.get('/endpoint', (req, res) => {
  res.status(550).json({"error": "server_error", "message": "Mailbox Not Found"});
});
spring boot
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;
import java.util.Map;

@RestController
public class MyController {

    @GetMapping("/endpoint")
    public ResponseEntity<Map<String, Object>> myEndpoint() {
        return ResponseEntity
            .status(550)
            .body(Map.of("error", "mailbox_not_found",
                         "message", "Mailbox Not Found"));
    }
}
go net/http
package main

import (
    "encoding/json"
    "net/http"
)

func myHandler(w http.ResponseWriter, r *http.Request) {
    w.Header().Set("Content-Type", "application/json")
    w.WriteHeader(550)
    json.NewEncoder(w).Encode(map[string]string{
        "error":   "mailbox_not_found",
        "message": "Mailbox Not Found",
    })
}
ruby on rails
class MyController < ApplicationController
  def my_action
    render json: {"error": "server_error", "message": "Mailbox Not Found"},
           status: :mailbox_not_found
  end
end
asp.net core
// ASP.NET Core Minimal API
app.MapGet("/endpoint", () =>
    Results.Json(
        new { error = "mailbox_not_found", message = "Mailbox Not Found" },
        statusCode: 550
    )
);

Thêm trang giả lập SMTP