[{"data":1,"prerenderedAt":203},["ShallowReactive",2],{"seo-verification":3,"blog-mailpit-self-hosted-smtp-testing-server-on-your-vps-ma-en":6,"promo-bar-likely":196},{"google":4,"bing":5},"EycwPY2XMyTkVzas3n1ygeNJFGAH513qrMjfDljzsMQ","",{"key":7,"data":8},"blog-mailpit-self-hosted-smtp-testing-server-on-your-vps-ma-en",{"id":9,"slug":10,"slugs":11,"title":15,"excerpt":16,"readTime":17,"views":18,"isPinned":19,"noindex":19,"publishedAt":20,"updatedAt":21,"category":22,"categories":28,"featuredImage":30,"bgImage":31,"posterImage":32,"relatedSolution":33,"intro":36,"sections":37,"ctaTitle":144,"ctaBody":145,"ctaButton":146,"ctaUrl":147,"relatedPosts":148},288,"mailpit-self-hosted-smtp-testing-server-on-your-vps",{"fr":12,"en":10,"ar":13,"es":14},"self-host-mailpit-vps","mailpit-بديل-mailhog-لاختبار-البريد-على-vps","mailpit-servidor-smtp-de-pruebas-vps","Mailpit: self-hosted test SMTP server on your VPS","Deploy Mailpit on your VPS to intercept and inspect test emails. Full guide: Docker Compose, reverse proxy, CI\u002FCD with Laravel, Django and n8n, and troubleshooting.",8,0,false,"2026-01-14T00:00:00+00:00","2026-10-14T23:33:30+00:00",{"id":23,"name":24,"slug":25,"color":26,"icon":27},7,"Self-hosting","self-hosting","bg-indigo-500\u002F10 text-indigo-400","cloud",[29],{"id":23,"name":24,"slug":25,"color":26,"icon":27},null,"\u002Fblog\u002Fcovers\u002Fbg.svg","\u002Fblog\u002Fcovers\u002Fself-host-mailpit-vps-poster.svg",{"categorySlug":34,"appSlug":35},"development","mailpit","Mailpit has replaced MailHog as the reference self-hosted test SMTP server: single binary, modern interface, MailHog-compatible API, and less than 50 MB of RAM at rest. This guide covers the full deployment on a VPS — Docker Compose, Nginx reverse proxy, CI\u002FCD integration and network access hardening.",[38,42,52,55,74,77,92,95,99,102,141],{"type":39,"title":40,"body":41},"h2","Why replace MailHog with Mailpit","MailHog has been unmaintained since late 2022. It accumulates outdated dependencies, its interface dates back to Bootstrap's early years, and its API has never evolved. Mailpit addresses each of these points: it is actively developed (latest release in 2024), offers a real-time reactive UI, and exposes a REST API that remains backward compatible with MailHog's to avoid breaking existing scripts.\n\nThe switch requires no data migration: Mailpit stores nothing by default. Every restart begins with an empty mailbox, which is exactly the intended behavior in a test pipeline.",{"type":43,"title":44,"items":45},"ul","What Mailpit delivers in practice",[46,47,48,49,50,51],"Modern interface with full-text search, HTML\u002Ftext rendering, mobile preview and header inspection","Single statically compiled Go binary — no system dependencies, runs in a 20 MB container","Memory footprint below 50 MB at rest, stable even with thousands of messages in a session","REST API backward compatible with MailHog (`\u002Fapi\u002Fv1\u002Fmessages`, `\u002Fapi\u002Fv1\u002Fsearch`) for existing scripts","Authenticated SMTP support, optional TLS, and network-based access control","Configurable webhook to notify an external endpoint on each received email",{"type":39,"title":53,"body":54},"Prerequisites","A VPS running Debian 12 or Ubuntu 22.04\u002F24.04 with **Docker and Docker Compose v2** installed is sufficient. Mailpit is among the lightest tools in the catalog: plan for 1 shared vCPU and 256 MB of RAM for developer or CI use. A dedicated subdomain (`mail.your-domain.com`) is recommended to access the interface from a browser over HTTPS — otherwise access is only possible locally via an SSH tunnel.\n\nPorts used: **1025** (SMTP) and **8025** (web interface). If a mail service is already running on port 1025, you will need to shift Mailpit (see the troubleshooting section).",{"type":56,"title":57,"steps":58},"steps","Deploy Mailpit in 5 steps",[59,62,65,68,71],{"title":60,"body":61},"Create the directory and Compose file","```bash\nmkdir -p \u002Fopt\u002Fmailpit && cd \u002Fopt\u002Fmailpit\n```\n\nCreate the following `docker-compose.yml` file:\n\n```yaml\nservices:\n  mailpit:\n    image: axllent\u002Fmailpit:latest\n    container_name: mailpit\n    restart: unless-stopped\n    ports:\n      - \"127.0.0.1:1025:1025\"\n      - \"127.0.0.1:8025:8025\"\n    environment:\n      MP_MAX_MESSAGES: 500\n      MP_SMTP_AUTH_ACCEPT_ANY: \"true\"\n      MP_SMTP_AUTH_ALLOW_INSECURE: \"true\"\n      MP_UI_AUTH: \"admin:changeme\"\n    volumes:\n      - mailpit_data:\u002Fdata\nvolumes:\n  mailpit_data:\n```\n\nPorts are bound to `127.0.0.1` only: Mailpit is never exposed directly on the public IP. The `MP_UI_AUTH` variable enables HTTP basic authentication on the web interface — change the password. `MP_MAX_MESSAGES` limits the number of emails kept in memory per session.",{"title":63,"body":64},"Start the container","```bash\ndocker compose up -d\ndocker compose logs -f mailpit\n```\n\nThe line `starting on [::]:1025` confirms the SMTP server is listening. Check that the ports are correctly bound to localhost:\n\n```bash\nss -tlnp | grep -E '1025|8025'\n```\n\nExpected: `127.0.0.1:1025` and `127.0.0.1:8025` only — never `0.0.0.0`.",{"title":66,"body":67},"Configure the Nginx reverse proxy","Create `\u002Fetc\u002Fnginx\u002Fsites-available\u002Fmailpit`:\n\n```nginx\nserver {\n    listen 443 ssl;\n    server_name mail.your-domain.com;\n\n    ssl_certificate     \u002Fetc\u002Fletsencrypt\u002Flive\u002Fmail.your-domain.com\u002Ffullchain.pem;\n    ssl_certificate_key \u002Fetc\u002Fletsencrypt\u002Flive\u002Fmail.your-domain.com\u002Fprivkey.pem;\n\n    location \u002F {\n        proxy_pass         http:\u002F\u002F127.0.0.1:8025;\n        proxy_http_version 1.1;\n        proxy_set_header   Upgrade $http_upgrade;\n        proxy_set_header   Connection \"upgrade\";\n        proxy_set_header   Host $host;\n        proxy_read_timeout 86400;\n    }\n}\n```\n\nThe `proxy_read_timeout 86400` is required for WebSocket connections used by the real-time interface. Enable the vhost and reload Nginx:\n\n```bash\nln -s \u002Fetc\u002Fnginx\u002Fsites-available\u002Fmailpit \u002Fetc\u002Fnginx\u002Fsites-enabled\u002F\nnginx -t && systemctl reload nginx\n```\n\nObtain a Let's Encrypt certificate if not already done:\n\n```bash\ncertbot --nginx -d mail.your-domain.com\n```",{"title":69,"body":70},"Test sending with curl","Verify the SMTP server receives a message:\n\n```bash\ncurl --url 'smtp:\u002F\u002F127.0.0.1:1025' \\\n  --mail-from 'test@example.com' \\\n  --mail-rcpt 'dest@example.com' \\\n  --upload-file - \u003C\u003CEOF\nFrom: test@example.com\nTo: dest@example.com\nSubject: Mailpit Test\n\nTest message body.\nEOF\n```\n\nThen open `https:\u002F\u002Fmail.your-domain.com` in your browser. The message should appear in the interface. If you configured `MP_UI_AUTH`, enter the credentials at the HTTP basic auth prompt.",{"title":72,"body":73},"Configure your application to point to Mailpit","In your `.env` file (Laravel, Symfony, n8n, Django…), replace the SMTP configuration with:\n\n```\nMAIL_HOST=127.0.0.1\nMAIL_PORT=1025\nMAIL_ENCRYPTION=null\nMAIL_USERNAME=null\nMAIL_PASSWORD=null\n```\n\nFor applications running in Docker on the same host, use the Docker network name or the gateway IP (`172.17.0.1` by default) instead of `127.0.0.1`.",{"type":39,"title":75,"body":76},"Mailpit in CI\u002FCD: testing emails in the pipeline","In CI environments, Mailpit integrates as a sidecar service. It starts in seconds and requires no external configuration.",{"type":56,"title":78,"steps":79},"CI\u002FCD integration by framework",[80,83,86,89],{"title":81,"body":82},"GitHub Actions — Mailpit service","```yaml\nservices:\n  mailpit:\n    image: axllent\u002Fmailpit:latest\n    ports:\n      - 1025:1025\n      - 8025:8025\n```\n\nIn your job environment variables, set `MAIL_HOST=127.0.0.1` and `MAIL_PORT=1025`. Mailpit accepts any email without authentication by default — no additional SMTP configuration is needed.",{"title":84,"body":85},"Laravel — PHPUnit","In `phpunit.xml`, replace the transport with SMTP:\n\n```xml\n\u003Cenv name=\"MAIL_MAILER\" value=\"smtp\"\u002F>\n\u003Cenv name=\"MAIL_HOST\" value=\"127.0.0.1\"\u002F>\n\u003Cenv name=\"MAIL_PORT\" value=\"1025\"\u002F>\n```\n\nIn your test, send the mail then query the Mailpit API to verify receipt:\n\n```php\n$response = Http::get('http:\u002F\u002F127.0.0.1:8025\u002Fapi\u002Fv1\u002Fmessages');\n$this->assertSame($response->json('total'), 1);\n$this->assertStringContainsString(\n    'Welcome',\n    $response->json('messages.0.Subject')\n);\n```",{"title":87,"body":88},"Django — pytest","In `settings.py` (or `settings_test.py`):\n\n```python\nEMAIL_BACKEND = 'django.core.mail.backends.smtp.EmailBackend'\nEMAIL_HOST = '127.0.0.1'\nEMAIL_PORT = 1025\n```\n\nIn your pytest test, verify via the Mailpit API:\n\n```python\nimport requests\n\ndef test_welcome_email_sent():\n    # trigger the send in your view\u002Fservice\n    r = requests.get('http:\u002F\u002F127.0.0.1:8025\u002Fapi\u002Fv1\u002Fmessages')\n    assert r.json()['total'] == 1\n    assert 'Welcome' in r.json()['messages'][0]['Subject']\n```",{"title":90,"body":91},"n8n — workflow testing","In n8n's **Send Email** node, configure the SMTP server to `127.0.0.1:1025` without authentication. To automatically verify that a workflow triggered a send, call `GET http:\u002F\u002F127.0.0.1:8025\u002Fapi\u002Fv1\u002Fmessages` from an HTTP Request node and validate the total in an IF node.",{"type":39,"title":93,"body":94},"Securing access to Mailpit","Mailpit stores emails **in memory only** — no files on disk, no database. This is an advantage for confidentiality (no persistent traces), but also a limitation: a restart empties the mailbox without warning.\n\n**Network restriction.** Ports 1025 and 8025 are bound to `127.0.0.1` in the Docker Compose configuration above. Never expose them on `0.0.0.0` in production or on a shared server: anyone could relay emails or read intercepted messages.\n\n**HTTP basic authentication on the interface.** The `MP_UI_AUTH=user:password` variable enables basic authentication on the web interface. Use a strong password — the interface exposes the full content of your test emails, often populated with confirmation links, tokens and temporary passwords.\n\n**Authenticated SMTP.** For multi-team environments, enable `MP_SMTP_AUTH` with an account file rather than `MP_SMTP_AUTH_ACCEPT_ANY`. This prevents a misconfigured service from sending emails to another project's test mailbox.",{"type":96,"title":97,"body":98},"tip","Tip: clear the mailbox between tests","The Mailpit API exposes a purge endpoint: `DELETE http:\u002F\u002F127.0.0.1:8025\u002Fapi\u002Fv1\u002Fmessages`. Call it in your PHPUnit `setUp()` or pytest fixture to start each test with an empty mailbox, without having to restart the container.",{"type":39,"title":100,"body":101},"Troubleshooting — 4 common cases","**Port 1025 already in use.** A local Postfix or Sendmail server may be listening on this port. Check with `ss -tlnp | grep 1025`. If so, change the host port in `docker-compose.yml` (e.g. `1026:1025`) and update `MAIL_PORT` in your applications.\n\n**Access denied from a CI container.** Docker containers in GitHub Actions can access the runner's `127.0.0.1`, but not other services via `localhost` if the network is not properly shared. Use the runner's `host` network or reference the service by its name (`mailpit:1025`) in the workflow file.\n\n**Interface inaccessible behind reverse proxy.** The real-time interface WebSocket connections can be cut by an aggressive Nginx timeout. Check that `proxy_read_timeout` is set to 86400 and that the `Upgrade` and `Connection` headers are forwarded.\n\n**Performance with thousands of emails.** Mailpit keeps everything in memory. If your pipeline generates hundreds of emails per run, set `MP_MAX_MESSAGES` to a reasonable value (100–500) to prevent container memory from growing unbounded over long sessions.",{"type":103,"title":104,"headers":105,"rows":112},"comparison","Mailpit vs MailHog vs Mailtrap vs Inbucket vs smtp4dev",[106,107,108,109,110,111],"Tool","Maintenance","RAM at rest","REST API","Persistence","SMTP auth",[113,120,126,133,137],[114,115,116,117,118,119],"**Mailpit**","Active (2024)","\u003C 50 MB","Yes (v1 + v2)","Memory only","Optional",[121,122,123,124,118,125],"MailHog","Abandoned (2022)","~30 MB","Yes (v1 only)","No",[127,128,129,130,131,132],"Mailtrap (SaaS)","Active","N\u002FA (cloud)","Yes","Cloud (30 days)","Yes (cloud)",[134,128,135,130,136,125],"Inbucket","~20 MB","Memory or disk",[138,128,139,130,140,125],"smtp4dev","~80 MB (.NET)","Optional SQLite",{"type":39,"title":142,"body":143},"Advanced use cases","**Multi-project interception.** A single Mailpit instance can receive emails from multiple projects simultaneously. Use full-text search or filter by recipient in the interface to isolate messages from each application.\n\n**Webhook to Slack or n8n.** The `MP_WEBHOOK_URL` variable triggers a JSON POST on each receipt. Connect it to an n8n workflow to route certain test emails to a team Slack channel — useful for shared integration tests.\n\n**Export and replay.** The API exposes emails in EML format (`GET \u002Fapi\u002Fv1\u002Fmessage\u002F\u003Cid>.eml`). Download an intercepted message to replay it in a real mail client or to keep it as a test fixture.\n\n**Mailpit in a complete development stack.** Add Mailpit as a service in your main project's `docker-compose.yml`. It integrates naturally with Laravel Sail, Symfony Docker or self-hosted n8n stacks — a single `docker compose up` starts the entire development environment with SMTP interception included.","Deploy Mailpit in one click on ServOrbit","With a ServOrbit Cloud VPS, Mailpit is available directly from the marketplace. Set up your SMTP test environment in two minutes, with no separate server to manage.","Launch my Cloud VPS","\u002Fvps-cloud",[149,169,186],{"id":150,"slug":151,"slugs":152,"title":156,"excerpt":157,"readTime":17,"views":158,"isPinned":19,"noindex":19,"publishedAt":159,"updatedAt":160,"category":161,"categories":166,"featuredImage":30,"bgImage":31,"posterImage":168,"relatedSolution":30},280,"postfix-smtp-relay-on-vps-client-transactional-emails",{"fr":153,"en":151,"ar":154,"es":155},"smtp-relay-vps-emails-transactionnels-clients","إعداد-postfix-smtp-relay-على-vps-لبريد-المواقع","relay-smtp-postfix-en-vps-emails-transaccionales","Postfix SMTP Relay on VPS: Client Transactional Emails","Set up Postfix as an SMTP relay on a ServOrbit VPS: dedicated IPv4, SPF, DKIM and DMARC aligned for your entire cPanel client portfolio in under an hour.",1,"2026-08-18T00:00:00+00:00","2026-11-09T20:55:12+00:00",{"id":162,"name":163,"slug":164,"color":165,"icon":164},11,"Business Email","emails","bg-cyan-500\u002F10 text-cyan-400",[167],{"id":162,"name":163,"slug":164,"color":165,"icon":164},"\u002Fblog\u002Fcovers\u002Fsmtp-relay-vps-emails-transactionnels-clients-poster.svg",{"id":170,"slug":171,"slugs":172,"title":176,"excerpt":177,"readTime":178,"views":179,"isPinned":19,"noindex":19,"publishedAt":180,"updatedAt":181,"category":182,"categories":183,"featuredImage":30,"bgImage":31,"posterImage":185,"relatedSolution":30},238,"hosting-your-own-email-server-on-a-vps-with-mailcow",{"fr":173,"en":171,"ar":174,"es":175},"heberger-serveur-email-vps-mailcow","استضافة-خادم-البريد-الإلكتروني-على-vps-باستخدام-mailcow","alojar-servidor-correo-vps-mailcow","Hosting Your Own Email Server on a VPS with Mailcow","Deploy Mailcow on a Linux VPS to run your own sovereign email server: installation, deliverability and migration from Google Workspace.",20,3,"2026-08-08T00:00:00+00:00","2026-10-29T03:10:23+00:00",{"id":162,"name":163,"slug":164,"color":165,"icon":164},[184],{"id":162,"name":163,"slug":164,"color":165,"icon":164},"\u002Fblog\u002Fcovers\u002Fheberger-serveur-email-vps-mailcow-poster.svg",{"id":187,"slug":188,"slugs":189,"title":193,"excerpt":194,"readTime":195,"views":18,"isPinned":19,"noindex":196,"publishedAt":197,"updatedAt":198,"category":199,"categories":200,"featuredImage":30,"bgImage":31,"posterImage":202,"relatedSolution":30},199,"spf-dkim-dmarc-passing-the-5000-email-threshold",{"fr":190,"en":188,"ar":191,"es":192},"spf-dkim-dmarc-delivrabilite-emails-pro","spf-وdkim-وdmarc-تجاوز-عتبة-5000-رسالة","spf-dkim-dmarc-superar-el-umbral-de-5000-correos","SPF, DKIM, DMARC: passing the 5,000-email threshold","Gmail and Outlook reject senders without aligned SPF, DKIM and DMARC with an SMTP 550 error. Here is how to configure all three records.",4,true,"2026-08-01T00:00:00+00:00","2026-09-07T11:26:10+00:00",{"id":162,"name":163,"slug":164,"color":165,"icon":164},[201],{"id":162,"name":163,"slug":164,"color":165,"icon":164},"\u002Fblog\u002Fcovers\u002Fspf-dkim-dmarc-delivrabilite-emails-pro-poster.svg",1794270441616]