{"id":14265,"date":"2026-07-15T00:08:58","date_gmt":"2026-07-15T06:08:58","guid":{"rendered":"https:\/\/www.supportpro.com\/blog\/?p=14265"},"modified":"2026-07-15T00:09:00","modified_gmt":"2026-07-15T06:09:00","slug":"setting-up-a-mail-server-on-your-runcloud-servers","status":"publish","type":"post","link":"https:\/\/www.supportpro.com\/blog\/setting-up-a-mail-server-on-your-runcloud-servers\/","title":{"rendered":"Setting Up a Mail Server on Your RunCloud Servers"},"content":{"rendered":"\n<p>By default, RunCloud does not come with email services. However, you can set up an email service on your RunCloud server yourself.<\/p>\n\n\n\n<p>Although RunCloud does not provide an email service out of the box, Postfix is already installed once you connect your server to RunCloud. Postfix is a popular, highly configurable mail transfer agent (MTA) that is free and open-source.<\/p>\n\n\n\n<p>Let\u2019s walk through the steps to set up a mail server on your RunCloud server:<\/p>\n\n\n\n<!--more-->\n\n\n\n<p><strong>Prerequisites :<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>1. <\/strong>&nbsp;Ensure your server is configured with a fully qualified domain name (FQDN). <\/li>\n\n\n\n<li><strong>2. <\/strong>You will need a non-root user with sudo privileges.<\/li>\n\n\n\n<li><strong>3. <\/strong>Make sure you have added MX and A records for the FQDN of your server.<\/li>\n<\/ul>\n\n\n\n<p><strong>Configuring Postfix :<\/strong><\/p>\n\n\n\n<p>Since Postfix is already installed on your server, you can begin configuring the mail server. To do this, log in as a sudo user and use the following command:<\/p>\n\n\n\n<p><strong>sudo dpkg-reconfigure postfix<\/strong><\/p>\n\n\n\n<figure class=\"wp-block-image\"><img src=\"https:\/\/lh7-rt.googleusercontent.com\/docsz\/AD_4nXdrzWZj9fmuEPuVb3Vfsoilw8HGMMgeyzAneFlkW1Yq-kKi3nDDCBLHw1zKJx-S2fi8xmZ_mPuJYsTD3yTWOpbWX4dB6VGAakSLUTYwfihYMiezdTrvSRmc4oWr9AY6LY-S7zVXkA?key=hVkF7aqWkwLZvlqHG3RwJjnc\" alt=\"\"\/><\/figure>\n\n\n\n<p><strong>Configuration Steps:<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>When prompted, choose &#8220;Internet Site&#8221; as the mail configuration type.<\/li>\n\n\n\n<li>Enter your domain name as the system mail name.<\/li>\n\n\n\n<li>On the next screen, specify the destinations to accept mail.<\/li>\n<\/ul>\n\n\n\n<p><strong>For the additional options, you can provide the following settings:<\/strong><\/p>\n\n\n\n<blockquote class=\"wp-block-quote\">\n<p>l Force synchronous updates on mail queue: No<\/p>\n\n\n\n<p>l Mailbox size limit (bytes): 0<\/p>\n\n\n\n<p>l Local address extension character: +<\/p>\n\n\n\n<p>l Internet protocol to use: All<\/p>\n\n\n\n<p><strong>Testing the Mail Server:<\/strong><\/p>\n<\/blockquote>\n\n\n\n<p>Once the mail server is set up, you can verify that the server is connected to port 25 by using the following command:<\/p>\n\n\n\n<p><strong>telnet gmail-smtp-in.l.google.com 25<\/strong><\/p>\n\n\n\n<p>&nbsp;To test the mail service, you can use applications such as mailutils. Run the following command to send a test email:<\/p>\n\n\n\n<p><strong>\/usr\/sbin\/sendmail youremailaddress<\/strong><\/p>\n\n\n\n<p>Check your email inbox\/spam to confirm if the email was received successfully.<\/p>\n\n\n\n<p><strong>Important Notes:&nbsp;<\/strong> Make sure to open ports 25, 465, and 587 in both your server and external firewalls for the mail service to function properly.<\/p>\n\n\n\n<p class=\"has-medium-font-size\"><strong>How to send mails through PHP files:<\/strong><\/p>\n\n\n\n<p>There are multiple ways to send emails from PHP. Here, we explore how to do this using the mail() function, which is a PHP function used for sending emails.<\/p>\n\n\n\n<p><strong>1. Install Dependencies for Sending Emails<\/strong><\/p>\n\n\n\n<p>sudo apt update &amp;&amp; sudo apt install mailutils sendmail-base<\/p>\n\n\n\n<p><strong>2. Update the sendmail_path in php.ini<\/strong><\/p>\n\n\n\n<p>update the php.ini file for the corresponding PHP version to specify the sendmail path. If your PHP version for the web app is 7.4, the php.ini file will be located at \/etc\/php74rc\/php.ini.<\/p>\n\n\n\n<p>Search for the sendmail_path option and update its value to:<\/p>\n\n\n\n<p>sendmail_path = \/usr\/sbin\/sendmail -t -i<\/p>\n\n\n\n<p>After making the change, restart the corresponding service:<\/p>\n\n\n\n<p>systemctl restart php74rc-fpm<\/p>\n\n\n\n<p><strong>3. Configure Sendmail :<\/strong><\/p>\n\n\n\n<p>To configure Sendmail, you can simply run the following command:<\/p>\n\n\n\n<p><strong>sendmailconfig<\/strong><\/p>\n\n\n\n<p>You can update the values by entering the necessary details. If you do not wish to make any changes, you can proceed with the default values.<\/p>\n\n\n\n<p><strong>4. Create a mail.php file<\/strong><\/p>\n\n\n\n<p>For testing purposes, create a mail.php file with the following code:<\/p>\n\n\n\n<blockquote class=\"wp-block-quote\">\n<p>&lt;?php<\/p>\n\n\n\n<p>$to = &#8216;recepientaddress@gmail.com&#8217;; \/\/ Recipient&#8217;s email address<\/p>\n\n\n\n<p>&nbsp;$subject = &#8216;Test Email from Postfix&#8217;;<\/p>\n\n\n\n<p>&nbsp;$message = &#8216;Hello, this is a test email sent using Postfix and PHP.&#8217;;<\/p>\n\n\n\n<p>&nbsp;$headers = &#8216;From: sender@yourdomain.com&#8217;;<\/p>\n\n\n\n<p>&nbsp;if(mail($to, $subject, $message, $headers)) {<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;echo &#8220;Email sent successfully!&#8221;;<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;} else {<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;echo &#8220;Failed to send email.&#8221;;<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;?&gt;<\/p>\n<\/blockquote>\n\n\n\n<p>You can place this file under the public directory of any web application you wish to test.<\/p>\n\n\n\n<p><strong>5.Set Correct Permissions<\/strong><\/p>\n\n\n\n<p>Once the file is created, ensure that the correct permissions and ownership are set for the corresponding file.<\/p>\n\n\n\n<p>For testing purposes, you can access the file by visiting domainname\/email.php.Check your inbox or spam folder to verify if the email was received successfully.<\/p>\n\n\n\n<p class=\"has-medium-font-size\"><strong>How to send mails from wordpress through plugins :<\/strong><\/p>\n\n\n\n<p>You can easily send emails from your WordPress website by using plugins like WP Mail SMTP. Follow these steps to set it up:<\/p>\n\n\n\n<p><strong>1. Install the Plugin<\/strong><\/p>\n\n\n\n<p>Start by installing the WP Mail SMTP plugin from your WordPress dashboard.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img src=\"https:\/\/lh7-rt.googleusercontent.com\/docsz\/AD_4nXc5k-ubaApc-fE_etWulVJ7gMOObK2po_nmqZ9GGU7IM3B3V6-iXEia28ggzhmXXsP4vtGsCDUsX2R6rvymrkhrg64Nov1g_JWMnGhHyTWL9vmqGwfEbTTuq2GYIL51GalSCE5XSg?key=hVkF7aqWkwLZvlqHG3RwJjnc\" alt=\"\"\/><\/figure>\n\n\n\n<p><strong>2. Configure the Plugin<\/strong><\/p>\n\n\n\n<p>After the plugin is installed, head to the plugin\u2019s settings page by going to WP Mail SMTP \u00bb Settings, then click on the Launch Setup Wizard to begin the configuration.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img src=\"https:\/\/lh7-rt.googleusercontent.com\/docsz\/AD_4nXdSI7lkcD_srPQ1nLWhsfc8-ErdM7Z0fAOUuCQq_t_2VMPCemYConDOsXGoBctKzzMJSbEUnp54JRrSlTnOXfT5WvSEwTMtVhngF1xDO3BGlMAIg5KFfWj_IQMWCTHHbBPVkT9fog?key=hVkF7aqWkwLZvlqHG3RwJjnc\" alt=\"\"\/><\/figure>\n\n\n\n<p><strong>3. Complete the Setup Wizard<\/strong><\/p>\n\n\n\n<p>Follow the on-screen instructions in the Setup Wizard. Once you finish the setup, the plugin will verify the configuration. If everything is correctly set up, you&#8217;ll see a success message.<\/p>\n\n\n\n<p><strong>4. Test Email<\/strong><\/p>\n\n\n\n<p>To ensure that the plugin is working, go to WP Mail SMTP \u00bb Tools \u00bb Email Test and click the Send Email button to check if the emails are being sent successfully.<\/p>\n\n\n\n<p>Still having trouble or need some help? Don\u2019t hesitate to reach out \u2013 <a href=\"https:\/\/www.supportpro.com\/\" title=\"\">we\u2019re here to assist you<\/a> every step of the way!!!<\/p>\n\n\n\n<div class=\"wp-block-media-text alignwide has-media-on-the-right is-stacked-on-mobile is-vertically-aligned-center has-white-background-color has-background\"><div class=\"wp-block-media-text__content\">\n<p class=\"has-large-font-size\">Facing issues? <\/p>\n\n\n\n<p class=\"has-large-font-size\">Our technical support<br>engineers can solve it. <\/p>\n\n\n\n<!--HubSpot Call-to-Action Code --><span class=\"hs-cta-wrapper\" id=\"hs-cta-wrapper-3350a795-db50-482f-9911-301930d1b1be\"><span class=\"hs-cta-node hs-cta-3350a795-db50-482f-9911-301930d1b1be\" id=\"hs-cta-3350a795-db50-482f-9911-301930d1b1be\"><!--[if lte IE 8]><div id=\"hs-cta-ie-element\"><\/div><![endif]--><a href=\"https:\/\/cta-redirect.hubspot.com\/cta\/redirect\/2725694\/3350a795-db50-482f-9911-301930d1b1be\" ><img class=\"hs-cta-img\" id=\"hs-cta-img-3350a795-db50-482f-9911-301930d1b1be\" style=\"border-width:0px;\" src=\"https:\/\/no-cache.hubspot.com\/cta\/default\/2725694\/3350a795-db50-482f-9911-301930d1b1be.png\"  alt=\"Contact Us today!\"\/><\/a><\/span><script charset=\"utf-8\" src=\"https:\/\/js.hscta.net\/cta\/current.js\"><\/script><script type=\"text\/javascript\"> hbspt.cta.load(2725694, '3350a795-db50-482f-9911-301930d1b1be', {\"useNewLoader\":\"true\",\"region\":\"na1\"}); <\/script><\/span><!-- end HubSpot Call-to-Action Code -->\n<\/div><figure class=\"wp-block-media-text__media\"><img width=\"904\" height=\"931\" src=\"https:\/\/www.supportpro.com\/blog\/wp-content\/uploads\/2022\/09\/Free-server-checkup.png\" alt=\"guy server checkup\" class=\"wp-image-12943 size-full\" srcset=\"https:\/\/www.supportpro.com\/blog\/wp-content\/uploads\/2022\/09\/Free-server-checkup.png 904w, https:\/\/www.supportpro.com\/blog\/wp-content\/uploads\/2022\/09\/Free-server-checkup-291x300.png 291w, https:\/\/www.supportpro.com\/blog\/wp-content\/uploads\/2022\/09\/Free-server-checkup-768x791.png 768w, https:\/\/www.supportpro.com\/blog\/wp-content\/uploads\/2022\/09\/Free-server-checkup-585x602.png 585w\" sizes=\"(max-width: 904px) 100vw, 904px\" \/><\/figure><\/div>\n","protected":false},"excerpt":{"rendered":"<p>By default, RunCloud does not come with email services. However, you can set up an email service on your RunCloud server yourself. Although RunCloud does not provide an email service&hellip;<\/p>\n","protected":false},"author":4,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_lmt_disableupdate":"","_lmt_disable":""},"categories":[1],"tags":[],"_links":{"self":[{"href":"https:\/\/www.supportpro.com\/blog\/wp-json\/wp\/v2\/posts\/14265"}],"collection":[{"href":"https:\/\/www.supportpro.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.supportpro.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.supportpro.com\/blog\/wp-json\/wp\/v2\/users\/4"}],"replies":[{"embeddable":true,"href":"https:\/\/www.supportpro.com\/blog\/wp-json\/wp\/v2\/comments?post=14265"}],"version-history":[{"count":2,"href":"https:\/\/www.supportpro.com\/blog\/wp-json\/wp\/v2\/posts\/14265\/revisions"}],"predecessor-version":[{"id":17758,"href":"https:\/\/www.supportpro.com\/blog\/wp-json\/wp\/v2\/posts\/14265\/revisions\/17758"}],"wp:attachment":[{"href":"https:\/\/www.supportpro.com\/blog\/wp-json\/wp\/v2\/media?parent=14265"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.supportpro.com\/blog\/wp-json\/wp\/v2\/categories?post=14265"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.supportpro.com\/blog\/wp-json\/wp\/v2\/tags?post=14265"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}