{"id":4624,"date":"2023-06-09T12:41:07","date_gmt":"2023-06-09T11:41:07","guid":{"rendered":"https:\/\/www.utilewebsites.nl\/knowledgebase\/send-all-emails-to-one-recipient-using-postfix-fakemail-development-server\/"},"modified":"2023-06-09T12:52:11","modified_gmt":"2023-06-09T11:52:11","slug":"send-all-emails-to-one-recipient-using-postfix-fakemail-development-server","status":"publish","type":"wz_knowledgebase","link":"https:\/\/www.utilewebsites.nl\/en\/knowledgebase\/send-all-emails-to-one-recipient-using-postfix-fakemail-development-server\/","title":{"rendered":"Send all emails to one recipient using Postfix \/ fakemail \/ development server"},"content":{"rendered":"\n<p>As a developer on a test server, it is essential for you to have full control over the emails being sent during application testing. Imagine that you are working on a project and constantly need to send test messages to a specific email address, allowing you to easily monitor email flows and perform automated tests.<\/p>\n\n\n\n<p>To facilitate this, Postfix, a popular mail transfer agent, provides a convenient configuration option. By making some changes to the Postfix configuration files on your test server, you can ensure that all outgoing emails are delivered to a single recipient. This centralizes and simplifies the email flow, providing you with a better overview during the testing process.<\/p>\n\n\n\n<p>Add the following to the end of the configuration file \/etc\/postfix\/main.cf:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code># Aangepaste toevoeging - alleen verzenden naar \u00e9\u00e9n e-mailadres.\nrecipient_canonical_classes = envelope_recipient\nrecipient_canonical_maps = regexp:\/etc\/postfix\/recipient_canonical_map\n<\/code><\/pre>\n\n\n\n<p>In the file \/etc\/postfix\/master.cf:<\/p>\n\n\n\n<p>Find the line that looks something like this (without the \"#\" in front of it):<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>smtp unix - - n - - smtp\n<\/code><\/pre>\n\n\n\n<p>Immediately after that, add the following line:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>-o smtp_header_checks=regexp:\/etc\/postfix\/smtp_header_checks\n<\/code><\/pre>\n\n\n\n<p>Create a new file \/etc\/postfix\/recipient_canonical_map and add the following:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code># Voer het e-mailadres in waarnaar je alle e-mails wilt laten bezorgen.\n# Bijvoorbeeld, mijn configuratie leest \"\/.\/ geoff+dev@garbers.co.za\"\n\/.\/ jouw@email.hier\n<\/code><\/pre>\n\n\n\n<p>Also, create a new file \/etc\/postfix\/smtp_header_checks and add the following:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code># Dit zal de hele onderwerpregel nemen en er \"&#91;devmail]\" voor plaatsen, als een andere manier om het te filteren.\n\/Subject:(.*)\/ REPLACE Subject: &#91;devmail] $1\n<\/code><\/pre>\n\n\n\n<p>After you have updated and created these configuration files, reload Postfix by running the following:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>&#91;~]# service postfix reload\n<\/code><\/pre>\n\n\n\n<p>If you have the mail command installed, send a test message to a nonexistent e-mail address:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>&#91;~]# echo 'test' | mail -s 'test email' niemand@example.org\n<\/code><\/pre>\n\n\n\n<p>To deny and disable the connection, edit the file \/etc\/postfix\/main.cf:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>vi \/etc\/postfix\/main.cf\n<\/code><\/pre>\n\n\n\n<p>Comment out the following lines by placing \"#\" in front of them:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code># content_filter = amavis:&#91;127.0.0.1]:10024\n# receive_override_options = no_address_mappings\n<\/code><\/pre>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>As a developer on a test server, it is essential for you to have full control over the emails being sent during application testing. Imagine that you are working on a project and constantly need to send test messages to a specific email address, allowing you to easily monitor email flows and perform automated tests. To facilitate this, Postfix, a popular mail transfer agent, provides a convenient configuration option. By making some changes to the Postfix configuration files on your test server, you can ensure that all outgoing emails are delivered to a single recipient. This centralizes and simplifies the&nbsp;<a href=\"https:\/\/www.utilewebsites.nl\/en\/knowledgebase\/send-all-emails-to-one-recipient-using-postfix-fakemail-development-server\/\" class=\"read-more\">Continue Reading<\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"wzkb_category":[60],"wzkb_tag":[],"class_list":["post-4624","wz_knowledgebase","type-wz_knowledgebase","status-publish","hentry","wzkb_category-linux"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.4 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Send all emails to one recipient using Postfix \/ fakemail \/ development server - Utilewebsites<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.utilewebsites.nl\/en\/knowledgebase\/send-all-emails-to-one-recipient-using-postfix-fakemail-development-server\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Send all emails to one recipient using Postfix \/ fakemail \/ development server - Utilewebsites\" \/>\n<meta property=\"og:description\" content=\"As a developer on a test server, it is essential for you to have full control over the emails being sent during application testing. Imagine that you are working on a project and constantly need to send test messages to a specific email address, allowing you to easily monitor email flows and perform automated tests. To facilitate this, Postfix, a popular mail transfer agent, provides a convenient configuration option. By making some changes to the Postfix configuration files on your test server, you can ensure that all outgoing emails are delivered to a single recipient. This centralizes and simplifies the&nbsp;Continue Reading\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.utilewebsites.nl\/en\/knowledgebase\/send-all-emails-to-one-recipient-using-postfix-fakemail-development-server\/\" \/>\n<meta property=\"og:site_name\" content=\"Utilewebsites\" \/>\n<meta property=\"article:modified_time\" content=\"2023-06-09T11:52:11+00:00\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data1\" content=\"2 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.utilewebsites.nl\\\/en\\\/knowledgebase\\\/send-all-emails-to-one-recipient-using-postfix-fakemail-development-server\\\/\",\"url\":\"https:\\\/\\\/www.utilewebsites.nl\\\/en\\\/knowledgebase\\\/send-all-emails-to-one-recipient-using-postfix-fakemail-development-server\\\/\",\"name\":\"Send all emails to one recipient using Postfix \\\/ fakemail \\\/ development server - Utilewebsites\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.utilewebsites.nl\\\/en\\\/#website\"},\"datePublished\":\"2023-06-09T11:41:07+00:00\",\"dateModified\":\"2023-06-09T11:52:11+00:00\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.utilewebsites.nl\\\/en\\\/knowledgebase\\\/send-all-emails-to-one-recipient-using-postfix-fakemail-development-server\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.utilewebsites.nl\\\/en\\\/knowledgebase\\\/send-all-emails-to-one-recipient-using-postfix-fakemail-development-server\\\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.utilewebsites.nl\\\/en\\\/knowledgebase\\\/send-all-emails-to-one-recipient-using-postfix-fakemail-development-server\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.utilewebsites.nl\\\/en\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Knowledge Base\",\"item\":\"https:\\\/\\\/www.utilewebsites.nl\\\/en\\\/knowledgebase\\\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Send all emails to one recipient using Postfix \\\/ fakemail \\\/ development server\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.utilewebsites.nl\\\/en\\\/#website\",\"url\":\"https:\\\/\\\/www.utilewebsites.nl\\\/en\\\/\",\"name\":\"Utilewebsites\",\"description\":\"\",\"publisher\":{\"@id\":\"https:\\\/\\\/www.utilewebsites.nl\\\/en\\\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.utilewebsites.nl\\\/en\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/www.utilewebsites.nl\\\/en\\\/#organization\",\"name\":\"Utilewebsites\",\"url\":\"https:\\\/\\\/www.utilewebsites.nl\\\/en\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.utilewebsites.nl\\\/en\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/www.utilewebsites.nl\\\/wp-content\\\/uploads\\\/2019\\\/08\\\/logo-Utilewebsites-2017.png\",\"contentUrl\":\"https:\\\/\\\/www.utilewebsites.nl\\\/wp-content\\\/uploads\\\/2019\\\/08\\\/logo-Utilewebsites-2017.png\",\"width\":3000,\"height\":593,\"caption\":\"Utilewebsites\"},\"image\":{\"@id\":\"https:\\\/\\\/www.utilewebsites.nl\\\/en\\\/#\\\/schema\\\/logo\\\/image\\\/\"}}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Send all emails to one recipient using Postfix \/ fakemail \/ development server - Utilewebsites","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.utilewebsites.nl\/en\/knowledgebase\/send-all-emails-to-one-recipient-using-postfix-fakemail-development-server\/","og_locale":"en_US","og_type":"article","og_title":"Send all emails to one recipient using Postfix \/ fakemail \/ development server - Utilewebsites","og_description":"As a developer on a test server, it is essential for you to have full control over the emails being sent during application testing. Imagine that you are working on a project and constantly need to send test messages to a specific email address, allowing you to easily monitor email flows and perform automated tests. To facilitate this, Postfix, a popular mail transfer agent, provides a convenient configuration option. By making some changes to the Postfix configuration files on your test server, you can ensure that all outgoing emails are delivered to a single recipient. This centralizes and simplifies the&nbsp;Continue Reading","og_url":"https:\/\/www.utilewebsites.nl\/en\/knowledgebase\/send-all-emails-to-one-recipient-using-postfix-fakemail-development-server\/","og_site_name":"Utilewebsites","article_modified_time":"2023-06-09T11:52:11+00:00","twitter_card":"summary_large_image","twitter_misc":{"Est. reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.utilewebsites.nl\/en\/knowledgebase\/send-all-emails-to-one-recipient-using-postfix-fakemail-development-server\/","url":"https:\/\/www.utilewebsites.nl\/en\/knowledgebase\/send-all-emails-to-one-recipient-using-postfix-fakemail-development-server\/","name":"Send all emails to one recipient using Postfix \/ fakemail \/ development server - Utilewebsites","isPartOf":{"@id":"https:\/\/www.utilewebsites.nl\/en\/#website"},"datePublished":"2023-06-09T11:41:07+00:00","dateModified":"2023-06-09T11:52:11+00:00","breadcrumb":{"@id":"https:\/\/www.utilewebsites.nl\/en\/knowledgebase\/send-all-emails-to-one-recipient-using-postfix-fakemail-development-server\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.utilewebsites.nl\/en\/knowledgebase\/send-all-emails-to-one-recipient-using-postfix-fakemail-development-server\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.utilewebsites.nl\/en\/knowledgebase\/send-all-emails-to-one-recipient-using-postfix-fakemail-development-server\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.utilewebsites.nl\/en\/"},{"@type":"ListItem","position":2,"name":"Knowledge Base","item":"https:\/\/www.utilewebsites.nl\/en\/knowledgebase\/"},{"@type":"ListItem","position":3,"name":"Send all emails to one recipient using Postfix \/ fakemail \/ development server"}]},{"@type":"WebSite","@id":"https:\/\/www.utilewebsites.nl\/en\/#website","url":"https:\/\/www.utilewebsites.nl\/en\/","name":"Utilewebsites","description":"","publisher":{"@id":"https:\/\/www.utilewebsites.nl\/en\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.utilewebsites.nl\/en\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.utilewebsites.nl\/en\/#organization","name":"Utilewebsites","url":"https:\/\/www.utilewebsites.nl\/en\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.utilewebsites.nl\/en\/#\/schema\/logo\/image\/","url":"https:\/\/www.utilewebsites.nl\/wp-content\/uploads\/2019\/08\/logo-Utilewebsites-2017.png","contentUrl":"https:\/\/www.utilewebsites.nl\/wp-content\/uploads\/2019\/08\/logo-Utilewebsites-2017.png","width":3000,"height":593,"caption":"Utilewebsites"},"image":{"@id":"https:\/\/www.utilewebsites.nl\/en\/#\/schema\/logo\/image\/"}}]}},"_links":{"self":[{"href":"https:\/\/www.utilewebsites.nl\/en\/wp-json\/wp\/v2\/wz_knowledgebase\/4624","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.utilewebsites.nl\/en\/wp-json\/wp\/v2\/wz_knowledgebase"}],"about":[{"href":"https:\/\/www.utilewebsites.nl\/en\/wp-json\/wp\/v2\/types\/wz_knowledgebase"}],"author":[{"embeddable":true,"href":"https:\/\/www.utilewebsites.nl\/en\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.utilewebsites.nl\/en\/wp-json\/wp\/v2\/comments?post=4624"}],"version-history":[{"count":4,"href":"https:\/\/www.utilewebsites.nl\/en\/wp-json\/wp\/v2\/wz_knowledgebase\/4624\/revisions"}],"predecessor-version":[{"id":4628,"href":"https:\/\/www.utilewebsites.nl\/en\/wp-json\/wp\/v2\/wz_knowledgebase\/4624\/revisions\/4628"}],"wp:attachment":[{"href":"https:\/\/www.utilewebsites.nl\/en\/wp-json\/wp\/v2\/media?parent=4624"}],"wp:term":[{"taxonomy":"wzkb_category","embeddable":true,"href":"https:\/\/www.utilewebsites.nl\/en\/wp-json\/wp\/v2\/wzkb_category?post=4624"},{"taxonomy":"wzkb_tag","embeddable":true,"href":"https:\/\/www.utilewebsites.nl\/en\/wp-json\/wp\/v2\/wzkb_tag?post=4624"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}