title: Joomla PHP Mail vs. SMTP
body: <p>I've been asked to change all of our current Joomla sites from using PHP Mail to SMTP.</p>
  
  <p>The background: we were recently compromised through a vulnerable component on one of our sites. We have a dedicated server, running CPanel. The hack involved a file being uploaded to one account, which had a file manager (with access to /home, ie. all other accounts). From there, another file was uploaded that began sending emails - not enough to catch with ease, but eventually enough to get our main server IP blacklisted. Because the main IP was blacklisted, many of our other sites (for which we also host email) were also blacklisted.</p>
  
  <p>My argument (your comments/ideas on this are much appreciated!)</p>
  
  <ol>
  <li>Changing to SMTP will not solve this instance
  <ul>
  <li>It would solve the issue of any vulnerable components where an email can be sent via a request spoof (ie. option=com_users?task=email&amp;..., or something similar to that)</li>
  </ul></li>
  <li>Because the hacker has access to the files in the account, they also have access to the configuration.php file, which holds the SMTP password in plain text. Access to this means they would also have access to the SMTP server.</li>
  <li>The SMTP that we would be using is localhost, which doesn't solve the issue of our IP being blacklisted.
  <ul>
  <li>My first idea was to provision/setup SMTP on a separate IP (or server), but that can still be blacklisted if a site gets hacked.</li>
  <li>The second idea was to provision each site a unique IP, so no one site can get the rest blacklisted.</li>
  </ul></li>
  </ol>
  
  <p>So I'm a bit lost. Before we tackle the task of setting the mailing function to SMTP, testing each site (there's roughly 70, with varying components to test) I'd like to have a better idea of what's the best route, if any.</p>
  
  <p>It seems that either setting in Joomla is insecure in the event of a compromised site, no?</p>