<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0"
    xmlns:content="http://purl.org/rss/1.0/modules/content/"
    xmlns:dc="http://purl.org/dc/elements/1.1/"
    xmlns:atom="http://www.w3.org/2005/Atom">
    <channel>
        <title>mail-server — LowEndSpirit DEV</title>
        <link>https://dev.lowendspirit.com/index.php?p=/</link>
        <pubDate>Fri, 10 Apr 2026 00:03:35 +0000</pubDate>
        <language>en</language>
            <description>mail-server — LowEndSpirit DEV</description>
    <atom:link href="https://dev.lowendspirit.com/index.php?p=/discussions/tagged/mail-server/feed.rss" rel="self" type="application/rss+xml"/>
    <item>
        <title>Low memory usage SMTP Send-Only</title>
        <link>https://dev.lowendspirit.com/index.php?p=/discussion/3925/low-memory-usage-smtp-send-only</link>
        <pubDate>Mon, 21 Mar 2022 20:13:41 +0000</pubDate>
        <category>LES Talk</category>
        <dc:creator>mikho</dc:creator>
        <guid isPermaLink="false">3925@/index.php?p=/discussions</guid>
        <description><![CDATA[<p><em>Written by <a href="https://dev.lowendspirit.com/index.php?p=/profile/mikho" rel="nofollow">@mikho</a>, 1 May 2021</em><br /><small>Article was migrated from WordPress to Vanilla in March 2022</small></p>

<p>
  <img src="https://talk.lowendspirit.com/uploads/editor/kl/ovtru2uav7gg.png" alt="image" /></p>

<p>In the LowEndSpirit, we tend to look for resource-efficient alternatives. Here is an alternative to use instead of Postfix, Sendmail, or Exim.</p>

<p>Often when installing and running a web application or script you need an SMTP server to send an email, rarely there is the need to receive any email. It works equally well using <a rel="nofollow" href="https://linux.die.net/man/8/ssmtp">ssmtp</a>, which also is simple and fast to install. It takes two minutes to install and configure.</p>

<h3 data-id="redhat-centos7-fedora">RedHat, CentOS7, Fedora</h3>

<pre spellcheck="false" tabindex="0">yum install ssmtp
</pre>

<p>If you receive a <em>“Package ssmtp is not available”</em> error, you’ll need to install EPEL on your machine with the following command:</p>

<pre spellcheck="false" tabindex="0">yum --enablerepo=extras install epel-release
</pre>

<p>Once done, you’ll be able to install ssmtp using the above command.</p>

<h2 data-id="ubuntu-debian">Ubuntu, Debian</h2>

<pre spellcheck="false" tabindex="0">apt-get install ssmtp
</pre>

<p>The configuration is done in the <strong><em>/etc/ssmtp/ssmtp.conf</em></strong> and there is only a couple of settings to change:</p>

<p><em><strong>Mailhub</strong></em><br />
The mail server you must send mail through (relay). In this guide we will use GMail smtp Server.<br /><strong><em>From Line Override</em></strong><br />
Set to YES to allow the use of others choose from addresses other than the system itself.<br /><em><strong>AuthUser</strong></em><br />
The username or email adress on the account used to login to gmail.<br /><strong><em>AuthPass</em></strong><br />
The password for above account<br /><strong><em>UseSTARTTLS</em></strong><br />
Set to Yes to use TLS when connecting to the SMTP server.</p>

<pre spellcheck="false" tabindex="0">## Config file for sSMTP sendmail
## The person who gets all mail for userids &lt; 1000
# Make this empty to disable rewriting.
root=postmaster
# The place where the mail goes. The actual machine name is required no
# MX records are consulted. Commonly mailhosts are named mail.domain.com
mailhub=smtp.gmail.com:587
AuthUser=name@gmail.com
AuthPass=YourtopSecretPassw0rd!
UseSTARTTLS=YES 
# Where will the mail seem to come from?
#rewriteDomain= 
# The full hostname
hostname=debianVPS.local 
# Are users allowed to set their own From: address?
# YES - Allow the user to specify their own From: address
# NO - Use the system generated From: 
addressFromLineOverride=YES
</pre>

<p>No reboots required.</p>

<p>To use ssmtp with the PHP <em>mail()</em> function, you have to edit the <em><strong>sendmail_path</strong></em> parameter in <strong><em>php.ini</em></strong> to something like this:</p>

<pre spellcheck="false" tabindex="0">sendmail_path = /usr/sbin/ssmtp -t
</pre>

<p>You have no open ports, everything just works!</p>
]]>
        </description>
    </item>
   </channel>
</rss>
