{"id":1448,"date":"2017-10-08T16:48:09","date_gmt":"2017-10-08T13:48:09","guid":{"rendered":"https:\/\/computingforgeeks.com\/?p=1448"},"modified":"2023-08-19T03:08:56","modified_gmt":"2023-08-19T00:08:56","slug":"installing-postfix3-on-centos-7","status":"publish","type":"post","link":"https:\/\/computingforgeeks.com\/installing-postfix3-on-centos-7\/","title":{"rendered":"How To Install Postfix 3 on CentOS 7 \/ RHEL 7"},"content":{"rendered":"\n<p>This guide will take you through the steps of Installing postfix3 on CentOS 7 \/ RHEL 7. Before diving to installation of postfix 3 on\u00a0<a href=\"https:\/\/computingforgeeks.com\/category\/centos\/\" target=\"_blank\" rel=\"noreferrer noopener\">CentOS 7,<\/a>\u00a0let\u2019s first define what\u2019s postfix.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"what-is-postfix\">What is Postfix?<\/h2>\n\n\n\n<p>Postfix, designed by Wietse Venema, is a mail server built with security in mind and specifically designed to replace Sendmail. Postfix is a free and open-source mail transfer agent (MTA) that routes and delivers electronic mail.<\/p>\n\n\n\n<p>There are several different components to the email system which work together to move, deliver or retrieve your email. These includes but not limited to:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Mail&nbsp;Transfer&nbsp;Agent&nbsp;(MTA)<\/li>\n\n\n\n<li>Mail&nbsp;Delivery&nbsp;Agent&nbsp;(MDA)<\/li>\n\n\n\n<li>Mail&nbsp;User&nbsp;Agent&nbsp;(MUA)<\/li>\n<\/ul>\n\n\n\n<p>Postfix has several hundred configuration parameters that are controlled via the&nbsp;<strong>main.cf&nbsp;&nbsp;<\/strong>file.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"adding-postfix-3-repository-to-centos-7\">Adding Postfix 3 repository to CentOS 7 \/ RHEL 7<\/h2>\n\n\n\n<p>Enable EPEL repository<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo yum -y install epel-release yum-utils<\/code><\/pre>\n\n\n\n<p>Add Ghettoforge repository to your CentOS 7 system:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo yum --nogpg install https:\/\/mirror.ghettoforge.org\/distributions\/gf\/gf-release-latest.gf.el7.noarch.rpm<\/code><\/pre>\n\n\n\n<p>Hit the <strong>Y <\/strong>key in your keyboard to proceed with repository addition:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>Examining \/var\/tmp\/yum-root-ybrf7D\/gf-release-latest.gf.el7.noarch.rpm: gf-release-7-12.gf.el7.noarch\nMarking \/var\/tmp\/yum-root-ybrf7D\/gf-release-latest.gf.el7.noarch.rpm to be installed\nResolving Dependencies\n--&gt; Running transaction check\n---&gt; Package gf-release.noarch 0:7-12.gf.el7 will be installed\n--&gt; Finished Dependency Resolution\n\nDependencies Resolved\n\n======================================================================================================================================================================================================\n Package                                    Arch                                   Version                                     Repository                                                        Size\n======================================================================================================================================================================================================\nInstalling:\n gf-release                                 noarch                                 7-12.gf.el7                                 \/gf-release-latest.gf.el7.noarch                                 4.5 k\n\nTransaction Summary\n======================================================================================================================================================================================================\nInstall  1 Package\n\nTotal size: 4.5 k\nInstalled size: 4.5 k\nIs this ok &#91;y\/d\/N]: <mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-vivid-red-color\">y<\/mark><\/code><\/pre>\n\n\n\n<p>Confirm repository is added successfully:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>$ <em><mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-pale-pink-color\">sudo yum repolist<\/mark><\/em>\nFailed to set locale, defaulting to C\nLoaded plugins: fastestmirror\nLoading mirror speeds from cached hostfile\nepel\/x86_64\/metalink                                                                                                                                                           |  15 kB  00:00:00\n * base: nyc.mirrors.clouvider.net\n * epel: d2lzkl7pfhq30w.cloudfront.net\n * extras: us.mirror.nsec.pt\n * updates: mirror.umd.edu\nepel                                                                                                                                                                           | 4.7 kB  00:00:00\ngf                                                                                                                                                                             | 2.9 kB  00:00:00\n(1\/4): epel\/x86_64\/updateinfo                                                                                                                                                  | 1.0 MB  00:00:00\n(2\/4): epel\/x86_64\/group_gz                                                                                                                                                    |  96 kB  00:00:00\n(3\/4): epel\/x86_64\/primary_db                                                                                                                                                  | 7.0 MB  00:00:00\n(4\/4): gf\/x86_64\/primary_db                                                                                                                                                    |  52 kB  00:00:00\nrepo id                                                                   repo name                                                                                                             status\nbase\/7\/x86_64                                                             CentOS-7 - Base                                                                                                       10072\ndroplet-agent\/x86_64                                                      DigitalOcean Droplet Agent                                                                                                5\nepel\/x86_64                                                               Extra Packages for Enterprise Linux 7 - x86_64                                                                        13667\nextras\/7\/x86_64                                                           CentOS-7 - Extras                                                                                                       500\n<mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-vivid-purple-color\">gf\/x86_64                                                                 Ghettoforge packages that won't overwrite core distro packages.                                                          86\n<\/mark>updates\/7\/x86_64                                                          CentOS-7 - Updates                                                                                                     2747\nrepolist: 27077<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"install-postfix-3-repository-to-centos-7\">Install Postfix 3 repository to CentOS 7 \/ RHEL 7<\/h2>\n\n\n\n<p>Enable <em><strong>gf-plus<\/strong><\/em> repository:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo yum-config-manager --enable gf-plus<\/code><\/pre>\n\n\n\n<p>Test by searching postfix3 packages:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>$<strong> <\/strong><mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-pale-pink-color\">sudo yum search postfix3<\/mark>\nFailed to set locale, defaulting to C\nLoaded plugins: fastestmirror\nLoading mirror speeds from cached hostfile\n * base: nyc.mirrors.clouvider.net\n * epel: d2lzkl7pfhq30w.cloudfront.net\n * extras: us.mirror.nsec.pt\n * updates: mirror.umd.edu\n======================================================================================= N\/S matched: postfix3 ========================================================================================\npostfix3.x86_64 : Postfix Mail Transport Agent\npostfix3-cdb.x86_64 : CDB Database Support for Postfix\npostfix3-ldap.x86_64 : LDAP Database Support for Postfix\npostfix3-lmdb.x86_64 : LMDBtabase Support for Postfix\npostfix3-mysql.x86_64 : MySQL Database Support for Postfix\npostfix3-pcre.x86_64 : PCRE Database Support for Postfix\npostfix3-pgsql.x86_64 : PostgreSQL Database Support for Postfix\npostfix3-sqlite.x86_64 : SQLite Database Support for Postfix\npostfix3-utils.x86_64 : Postfix utilities\n\n  Name and summary matches only, use \"search all\" for everything<\/code><\/pre>\n\n\n\n<p>Remove current postfix 2.x version if installed:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo yum -y remove postfix*<\/code><\/pre>\n\n\n\n<p>Proceed to Installing postfix3 on CentOS 7. Add any additional packages you want.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo yum clean all\nsudo yum makecache\nsudo yum install postfix3 postfix3-ldap postfix3-mysql postfix3-utils<\/code><\/pre>\n\n\n\n<p>Continue with the installation:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>....\nDependencies Resolved\n....\nTransaction Summary\n======================================================================================================================================================================================================\nInstall  4 Packages (+32 Dependent packages)\n\nTotal download size: 23 M\nInstalled size: 75 M\nIs this ok &#91;y\/d\/N]: <mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-vivid-red-color\"><strong>y<\/strong><\/mark><\/code><\/pre>\n\n\n\n<p>Ensure you import GPG keys when asked so:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------\nTotal                                                                                                                                                                 8.0 MB\/s |  23 MB  00:00:02\nRetrieving key from file:\/\/\/etc\/pki\/rpm-gpg\/RPM-GPG-KEY-gf.el7\nImporting GPG key 0xDA8B7718:\n Userid     : \"Ghettoforge (el7) &lt;gf@ghettoforge.org&gt;\"\n Fingerprint: b43e a892 86f4 b6fd ff83 fed1 d005 ae31 da8b 7718\n Package    : gf-release-7-12.gf.el7.noarch (@\/gf-release-latest.gf.el7.noarch)\n From       : \/etc\/pki\/rpm-gpg\/RPM-GPG-KEY-gf.el7\nIs this ok &#91;y\/N]: <strong><mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-vivid-red-color\">y<\/mark><\/strong>\n\nRetrieving key from file:\/\/\/etc\/pki\/rpm-gpg\/RPM-GPG-KEY-EPEL-7\nImporting GPG key 0x352C64E5:\n Userid     : \"Fedora EPEL (7) &lt;epel@fedoraproject.org&gt;\"\n Fingerprint: 91e9 7d7c 4a5e 96f1 7f3e 888f 6a2f aea2 352c 64e5\n Package    : epel-release-7-11.noarch (@extras)\n From       : \/etc\/pki\/rpm-gpg\/RPM-GPG-KEY-EPEL-7\nIs this ok &#91;y\/N]: <strong><mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-vivid-red-color\">y<\/mark><\/strong><\/code><\/pre>\n\n\n\n<p>Check installed postfix3 version:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code><em>$ <mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-luminous-vivid-amber-color\">rpm -qi postfix3<\/mark><\/em>\nName        : postfix3\nEpoch       : 2\nVersion     : 3.8.0\nRelease     : 1.gf.el7\nArchitecture: x86_64\nInstall Date: Tue 06 Jun 2023 01:45:57 AM UTC\nGroup       : System Environment\/Daemons\nSize        : 10293012\nLicense     : IBM\nSignature   : RSA\/SHA1, Tue 18 Apr 2023 09:20:05 AM UTC, Key ID d005ae31da8b7718\nSource RPM  : postfix3-3.8.0-1.gf.el7.src.rpm\nBuild Date  : Tue 18 Apr 2023 09:16:19 AM UTC\nBuild Host  : giants.ghettoforge.org\nRelocations : (not relocatable)\nPackager    : builder@ghettoforge.org\nVendor      : GhettoForge\n....<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"managing-postfix3-service\">Managing postfix3 service<\/h2>\n\n\n\n<p>To start postfix3 on CentOS 7, do:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo systemctl start postfix.service<\/code><\/pre>\n\n\n\n<p>Enable postfix to start on boot up:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo systemctl enable postfix<\/code><\/pre>\n\n\n\n<p>Check postfix status:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>$ <mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-pale-pink-color\">systemctl status postfix<\/mark>\n<mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-light-green-cyan-color\">\u25cf<\/mark> postfix.service - Postfix Mail Transport Agent\n   Loaded: loaded (\/usr\/lib\/systemd\/system\/postfix.service; enabled; vendor preset: disabled)\n   Active:<mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-vivid-green-cyan-color\"> active (running) <\/mark>since Tue 2023-06-06 01:46:54 UTC; 7s ago\n Main PID: 2615 (master)\n   CGroup: \/system.slice\/postfix.service\n           \u251c\u25002615 \/usr\/libexec\/postfix\/master -w\n           \u251c\u25002616 pickup -l -t unix -u\n           \u2514\u25002617 qmgr -l -t unix -u\n\nJun 06 01:46:53 cent7.mylab.io systemd&#91;1]: Starting Postfix Mail Transport Agent...\nJun 06 01:46:54 cent7.mylab.io postfix&#91;2541]: postfix\/postlog: starting the Postfix mail system\nJun 06 01:46:54 cent7.mylab.io postfix\/master&#91;2615]: daemon started -- version 3.8.0, configuration \/etc\/postfix\nJun 06 01:46:54 cent7.mylab.io systemd&#91;1]: Started Postfix Mail Transport Agent.<\/code><\/pre>\n\n\n\n<p>Open postfix smtp and smtps ports on firewall if SMTP service is consumed outside the server<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo firewall-cmd --add-service={smtp,smtps} --permanent<\/code><\/pre>\n\n\n\n<p>Confirm firewall configurations:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>$ <em><mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-pale-pink-color\">sudo firewall-cmd --list-services <\/mark><\/em>\nhttp smtp dhcpv6-client snmp smtps ssh https<\/code><\/pre>\n\n\n\n<p>Now you are rolling with Postfix3 on your CentOS 7 server. In our next tutorial, I\u2019ll cover how to integrate LDAP and postfix for relay access restrictions. Until then, keep checking for new articles and subscribe to our email alerts.<\/p>\n\n\n\n<p>After installing Postfix, you can look at my cheat sheet on Postfix administration:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><a href=\"https:\/\/computingforgeeks.com\/postfix-administration-commands-cheat-sheet\/\" target=\"_blank\" rel=\"noreferrer noopener\">Postfix Commands Administration Cheat Sheet<\/a><\/li>\n<\/ul>\n\n\n\n<p>More guides on mail services:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><a href=\"https:\/\/computingforgeeks.com\/install-and-configure-iredmail-server-on-freebsd\/\" target=\"_blank\" rel=\"noreferrer noopener\">Install and Configure iRedMail Server on FreeBSD<\/a><\/li>\n\n\n\n<li><a href=\"https:\/\/computingforgeeks.com\/install-mailu-mail-server-on-ubuntu\/\" target=\"_blank\" rel=\"noreferrer noopener\">How To Install Mailu mail server on Ubuntu<\/a><\/li>\n\n\n\n<li><a href=\"https:\/\/computingforgeeks.com\/how-to-install-iredmail-mail-server-on-centos-linux\/\" target=\"_blank\" rel=\"noreferrer noopener\">How To Install iRedMail Server on CentOS 8<\/a><\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>This guide will take you through the steps of Installing postfix3 on CentOS 7 \/ RHEL 7. Before diving to installation of postfix 3 on\u00a0CentOS 7,\u00a0let\u2019s first define what\u2019s postfix. What is Postfix? Postfix, designed by Wietse Venema, is a mail server built with security in mind and specifically designed to replace Sendmail. Postfix is &#8230; <a title=\"How To Install Postfix 3 on CentOS 7 \/ RHEL 7\" class=\"read-more\" href=\"https:\/\/computingforgeeks.com\/installing-postfix3-on-centos-7\/\" aria-label=\"Read more about How To Install Postfix 3 on CentOS 7 \/ RHEL 7\">Read more<\/a><\/p>\n","protected":false},"author":3,"featured_media":1464,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[328,17,29,50],"tags":[285,36034,173,286],"class_list":["post-1448","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-email","category-centos","category-fedora","category-linux-tutorials","tag-email-relay","tag-install-postfix-3-on-centos-7","tag-postfix","tag-postfix3"],"_links":{"self":[{"href":"https:\/\/computingforgeeks.com\/wp-json\/wp\/v2\/posts\/1448","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/computingforgeeks.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/computingforgeeks.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/computingforgeeks.com\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/computingforgeeks.com\/wp-json\/wp\/v2\/comments?post=1448"}],"version-history":[{"count":0,"href":"https:\/\/computingforgeeks.com\/wp-json\/wp\/v2\/posts\/1448\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/computingforgeeks.com\/wp-json\/wp\/v2\/media\/1464"}],"wp:attachment":[{"href":"https:\/\/computingforgeeks.com\/wp-json\/wp\/v2\/media?parent=1448"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/computingforgeeks.com\/wp-json\/wp\/v2\/categories?post=1448"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/computingforgeeks.com\/wp-json\/wp\/v2\/tags?post=1448"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}