<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Mohammed AlShannaq</title>
    <description>The latest articles on DEV Community by Mohammed AlShannaq (@mshannaq).</description>
    <link>https://dev.to/mshannaq</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3530287%2F056ecf1a-2eb4-4948-98ef-77318c8ffc67.png</url>
      <title>DEV Community: Mohammed AlShannaq</title>
      <link>https://dev.to/mshannaq</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/mshannaq"/>
    <language>en</language>
    <item>
      <title>Understanding cPanel SMTP Restrictions: Security, External SMTP, and the Trade-Offs</title>
      <dc:creator>Mohammed AlShannaq</dc:creator>
      <pubDate>Thu, 09 Jul 2026 19:31:52 +0000</pubDate>
      <link>https://dev.to/mshannaq/understanding-cpanel-smtp-restrictions-security-external-smtp-and-the-trade-offs-2n29</link>
      <guid>https://dev.to/mshannaq/understanding-cpanel-smtp-restrictions-security-external-smtp-and-the-trade-offs-2n29</guid>
      <description>&lt;p&gt;A cPanel setting called:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Restrict outgoing SMTP to root, exim, and mailman (FKA SMTP Tweak)&lt;/strong&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;looks simple.&lt;/p&gt;

&lt;p&gt;You either enable it or disable it.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F4lcouufs73u1naggtye5.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F4lcouufs73u1naggtye5.png" alt=" " width="800" height="533"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;In practice, however, the decision can affect application compatibility, email abuse controls, troubleshooting, and the way hosted applications connect to external email services such as Microsoft 365, Gmail or any other External SMTP.&lt;/p&gt;

&lt;p&gt;I am not arguing in this article that the setting should always be enabled or always be disabled.&lt;/p&gt;

&lt;p&gt;The aim is simpler:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;explain what the setting actually does;&lt;/li&gt;
&lt;li&gt;show a legitimate application scenario that can fail because of it;&lt;/li&gt;
&lt;li&gt;explain why the failure can be confusing;&lt;/li&gt;
&lt;li&gt;present the security argument for enabling it;&lt;/li&gt;
&lt;li&gt;present the compatibility argument for disabling it;&lt;/li&gt;
&lt;li&gt;and provide a practical troubleshooting method.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The correct decision depends on the hosting environment, the operator's security model, and the needs of hosted applications.&lt;/p&gt;




&lt;h2&gt;
  
  
  What does the setting do?
&lt;/h2&gt;

&lt;p&gt;According to cPanel's official documentation, SMTP Restrictions can configure the server so that only:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;the mail transport agent (MTA);&lt;/li&gt;
&lt;li&gt;Mailman;&lt;/li&gt;
&lt;li&gt;and the root user&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;can connect to remote SMTP servers.&lt;/p&gt;

&lt;p&gt;Other users and services are denied the ability to bypass the local mail server and send mail directly through remote SMTP systems.&lt;/p&gt;

&lt;p&gt;cPanel describes this bypass behaviour as something commonly used by spammers.&lt;/p&gt;

&lt;p&gt;Official documentation:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://docs.cpanel.net/whm/security-center/smtp-restrictions/" rel="noopener noreferrer"&gt;https://docs.cpanel.net/whm/security-center/smtp-restrictions/&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;In simplified form, with the restriction enabled, an application running under a normal hosting user may not be allowed to connect directly to a remote SMTP endpoint on a restricted SMTP path.&lt;/p&gt;

&lt;p&gt;The intended security model is roughly:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Hosted application
       |
       | SMTP connection
       v
Local Exim server
       |
       v
Remote destination
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;rather than:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Hosted application
       |
       | direct SMTP connection
       v
External SMTP server
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;That distinction is the centre of the whole discussion.&lt;/p&gt;




&lt;h2&gt;
  
  
  The legitimate application case
&lt;/h2&gt;

&lt;p&gt;Consider a PHP application that uses PHPMailer:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight php"&gt;&lt;code&gt;&lt;span class="nv"&gt;$mail&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="nf"&gt;isSMTP&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
&lt;span class="nv"&gt;$mail&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="nc"&gt;Host&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s1"&gt;'smtp.office365.com'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="nv"&gt;$mail&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="nc"&gt;SMTPAuth&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="nv"&gt;$mail&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="nc"&gt;Port&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;587&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="nv"&gt;$mail&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="nc"&gt;SMTPSecure&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;PHPMailer&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="no"&gt;ENCRYPTION_STARTTLS&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;There is nothing inherently suspicious about this configuration.&lt;/p&gt;

&lt;p&gt;The application may belong to a company whose email service is hosted on Microsoft 365. The developer may intentionally want the application to submit mail through Microsoft rather than through the hosting server's local Exim service.&lt;/p&gt;

&lt;p&gt;The expected path is:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;PHP application
      |
      | STARTTLS + SMTP AUTH
      v
smtp.office365.com:587
      |
      v
Microsoft 365
      |
      v
Recipient
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This pattern is common in modern applications.&lt;/p&gt;

&lt;p&gt;Similar designs can exist with:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;PHPMailer;&lt;/li&gt;
&lt;li&gt;Laravel mail;&lt;/li&gt;
&lt;li&gt;Symfony Mailer;&lt;/li&gt;
&lt;li&gt;WordPress SMTP plugins;&lt;/li&gt;
&lt;li&gt;Nodemailer;&lt;/li&gt;
&lt;li&gt;Google Workspace;&lt;/li&gt;
&lt;li&gt;transactional email providers;&lt;/li&gt;
&lt;li&gt;and other authenticated SMTP services.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;So the important distinction is this:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Direct external SMTP is not automatically malicious. It can be a deliberate application architecture.&lt;/p&gt;
&lt;/blockquote&gt;




&lt;h2&gt;
  
  
  The surprising failure mode
&lt;/h2&gt;

&lt;p&gt;When administrators think about a blocked outbound connection, they often expect:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Connection timed out
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;or:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Connection refused
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;But SMTP restrictions can produce a much more confusing symptom.&lt;/p&gt;

&lt;p&gt;An application may attempt to connect to:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;smtp.office365.com:587
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;and then fail with an error similar to:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Peer certificate CN=local-server.example.com
did not match expected CN=smtp.office365.com
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;At first sight, this looks like:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;a Microsoft 365 problem;&lt;/li&gt;
&lt;li&gt;a STARTTLS problem;&lt;/li&gt;
&lt;li&gt;a broken certificate chain;&lt;/li&gt;
&lt;li&gt;a DNS problem;&lt;/li&gt;
&lt;li&gt;a firewall problem;&lt;/li&gt;
&lt;li&gt;a WAF problem;&lt;/li&gt;
&lt;li&gt;or an application library bug.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;But another possibility is that the connection is not reaching the expected external SMTP endpoint.&lt;/p&gt;

&lt;p&gt;Instead, the SMTP connection may be handled by the local mail service.&lt;/p&gt;

&lt;p&gt;The effective path can become:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Application
    |
    | tries smtp.office365.com:587
    v
Local SMTP restriction behaviour
    |
    v
Local Exim service
    |
    v
Local server certificate
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The application expects the identity of &lt;code&gt;smtp.office365.com&lt;/code&gt;, but receives the identity of the local server.&lt;/p&gt;

&lt;p&gt;The TLS hostname check then fails correctly.&lt;/p&gt;




&lt;h2&gt;
  
  
  A controlled troubleshooting method
&lt;/h2&gt;

&lt;p&gt;The following method can help distinguish:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;provider-level network blocking;&lt;/li&gt;
&lt;li&gt;a general server connectivity problem;&lt;/li&gt;
&lt;li&gt;and user-level SMTP restriction behaviour.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Do not send any email during these tests.&lt;/p&gt;

&lt;p&gt;The goal is only to inspect connectivity, SMTP banners, and TLS identity.&lt;/p&gt;

&lt;h3&gt;
  
  
  Test 1: connect as root
&lt;/h3&gt;

&lt;p&gt;Run:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;openssl s_client &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;-starttls&lt;/span&gt; smtp &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;-connect&lt;/span&gt; smtp.office365.com:587 &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;-servername&lt;/span&gt; smtp.office365.com &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;-crlf&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If the connection reaches Microsoft, the output should show a certificate chain and SMTP service associated with Microsoft rather than the local hosting server.&lt;/p&gt;

&lt;p&gt;This proves that the server itself has a route to the external SMTP service.&lt;/p&gt;

&lt;p&gt;However, this test alone is not enough.&lt;/p&gt;

&lt;p&gt;A restriction may treat &lt;code&gt;root&lt;/code&gt; differently from normal hosting users.&lt;/p&gt;




&lt;h3&gt;
  
  
  Test 2: connect as the hosting user
&lt;/h3&gt;

&lt;p&gt;Run the same test under the relevant Linux or cPanel user:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;sudo&lt;/span&gt; &lt;span class="nt"&gt;-u&lt;/span&gt; exampleuser openssl s_client &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;-starttls&lt;/span&gt; smtp &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;-connect&lt;/span&gt; smtp.office365.com:587 &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;-servername&lt;/span&gt; smtp.office365.com &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;-crlf&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now compare the result.&lt;/p&gt;

&lt;p&gt;A useful diagnostic pattern is:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;As root:
→ Microsoft certificate

As hosting user:
→ local server certificate
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;That strongly suggests that the behaviour depends on the user context rather than on general network reachability.&lt;/p&gt;




&lt;h3&gt;
  
  
  Test 3: test from PHP under the same user
&lt;/h3&gt;

&lt;p&gt;A minimal PHP script can test the actual application context without authentication and without sending a message:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight php"&gt;&lt;code&gt;&lt;span class="cp"&gt;&amp;lt;?php&lt;/span&gt;

&lt;span class="k"&gt;declare&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;strict_types&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

&lt;span class="nv"&gt;$host&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s1"&gt;'smtp.office365.com'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="nv"&gt;$port&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;587&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="nv"&gt;$timeout&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;10&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="nv"&gt;$errno&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="nv"&gt;$errstr&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s1"&gt;''&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="nv"&gt;$socket&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;stream_socket_client&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="s2"&gt;"tcp://&lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="nv"&gt;$host&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;:&lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="nv"&gt;$port&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="nv"&gt;$errno&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="nv"&gt;$errstr&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="nv"&gt;$timeout&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="no"&gt;STREAM_CLIENT_CONNECT&lt;/span&gt;
&lt;span class="p"&gt;);&lt;/span&gt;

&lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;$socket&lt;/span&gt; &lt;span class="o"&gt;===&lt;/span&gt; &lt;span class="kc"&gt;false&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nb"&gt;fwrite&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="no"&gt;STDERR&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"TCP connection failed&lt;/span&gt;&lt;span class="se"&gt;\n&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
    &lt;span class="nb"&gt;fwrite&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="no"&gt;STDERR&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"Error &lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="nv"&gt;$errno&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;: &lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="nv"&gt;$errstr&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="se"&gt;\n&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
    &lt;span class="k"&gt;exit&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="nb"&gt;stream_set_timeout&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;$socket&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nv"&gt;$timeout&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

&lt;span class="k"&gt;echo&lt;/span&gt; &lt;span class="s2"&gt;"TCP connection established&lt;/span&gt;&lt;span class="se"&gt;\n&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="nv"&gt;$banner&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;fgets&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;$socket&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

&lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;$banner&lt;/span&gt; &lt;span class="o"&gt;===&lt;/span&gt; &lt;span class="kc"&gt;false&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nb"&gt;fwrite&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="no"&gt;STDERR&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"Connected, but no SMTP banner was received&lt;/span&gt;&lt;span class="se"&gt;\n&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
    &lt;span class="nb"&gt;fclose&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;$socket&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
    &lt;span class="k"&gt;exit&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="k"&gt;echo&lt;/span&gt; &lt;span class="s2"&gt;"SMTP banner:&lt;/span&gt;&lt;span class="se"&gt;\n&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;echo&lt;/span&gt; &lt;span class="nb"&gt;trim&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;$banner&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="mf"&gt;.&lt;/span&gt; &lt;span class="kc"&gt;PHP_EOL&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="nb"&gt;fwrite&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;$socket&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"EHLO test.local&lt;/span&gt;&lt;span class="se"&gt;\r\n&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

&lt;span class="k"&gt;echo&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="se"&gt;\n&lt;/span&gt;&lt;span class="s2"&gt;EHLO response:&lt;/span&gt;&lt;span class="se"&gt;\n&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="k"&gt;while&lt;/span&gt; &lt;span class="p"&gt;((&lt;/span&gt;&lt;span class="nv"&gt;$line&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;fgets&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;$socket&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt; &lt;span class="o"&gt;!==&lt;/span&gt; &lt;span class="kc"&gt;false&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;echo&lt;/span&gt; &lt;span class="nb"&gt;trim&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;$line&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="mf"&gt;.&lt;/span&gt; &lt;span class="kc"&gt;PHP_EOL&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

    &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;preg_match&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'/^250\s/'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nv"&gt;$line&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;===&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="k"&gt;break&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="nb"&gt;fwrite&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;$socket&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"QUIT&lt;/span&gt;&lt;span class="se"&gt;\r\n&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="nb"&gt;fclose&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;$socket&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

&lt;span class="k"&gt;echo&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="se"&gt;\n&lt;/span&gt;&lt;span class="s2"&gt;Connection closed without authentication or sending email&lt;/span&gt;&lt;span class="se"&gt;\n&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Run it under the hosting user:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;sudo&lt;/span&gt; &lt;span class="nt"&gt;-u&lt;/span&gt; exampleuser php /tmp/test-smtp-587.php
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;No SMTP authentication is performed.&lt;/p&gt;

&lt;p&gt;No &lt;code&gt;MAIL FROM&lt;/code&gt; command is sent.&lt;/p&gt;

&lt;p&gt;No &lt;code&gt;RCPT TO&lt;/code&gt; command is sent.&lt;/p&gt;

&lt;p&gt;No message body is transmitted.&lt;/p&gt;

&lt;p&gt;The script only:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;opens a TCP connection;&lt;/li&gt;
&lt;li&gt;reads the SMTP banner;&lt;/li&gt;
&lt;li&gt;sends &lt;code&gt;EHLO&lt;/code&gt;;&lt;/li&gt;
&lt;li&gt;reads the capabilities;&lt;/li&gt;
&lt;li&gt;sends &lt;code&gt;QUIT&lt;/code&gt;.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;If the application asks for &lt;code&gt;smtp.office365.com:587&lt;/code&gt; but receives a banner from the local Exim server, the behaviour becomes much easier to understand.&lt;/p&gt;




&lt;h2&gt;
  
  
  The value of an A/B test
&lt;/h2&gt;

&lt;p&gt;Where operationally safe and authorised, an administrator can compare behaviour before and after changing the SMTP Restrictions setting.&lt;/p&gt;

&lt;p&gt;A simplified result may look like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Restrictions ON
→ hosting-user PHP process
→ local Exim banner
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Restrictions OFF
→ same hosting-user PHP process
→ Microsoft 365 SMTP banner
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This is much stronger evidence than guessing from an application error message.&lt;/p&gt;

&lt;p&gt;The important point is not that every cPanel server will behave identically.&lt;/p&gt;

&lt;p&gt;The important point is that testing should be done:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;from the same server;&lt;/li&gt;
&lt;li&gt;under the same user;&lt;/li&gt;
&lt;li&gt;using the same destination;&lt;/li&gt;
&lt;li&gt;and ideally from the same application runtime.&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  The argument for keeping SMTP Restrictions enabled
&lt;/h2&gt;

&lt;p&gt;There is a strong and legitimate security argument for enabling the feature.&lt;/p&gt;

&lt;h3&gt;
  
  
  1. Centralised control
&lt;/h3&gt;

&lt;p&gt;If applications cannot bypass the local MTA on the restricted SMTP paths, the hosting operator has a more centralised mail architecture.&lt;/p&gt;

&lt;p&gt;Mail that passes through Exim can be subject to local controls such as:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;logging;&lt;/li&gt;
&lt;li&gt;queue inspection;&lt;/li&gt;
&lt;li&gt;delivery reporting;&lt;/li&gt;
&lt;li&gt;local policy;&lt;/li&gt;
&lt;li&gt;rate limits;&lt;/li&gt;
&lt;li&gt;and abuse investigation.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  2. Reduced ability to bypass the local MTA
&lt;/h3&gt;

&lt;p&gt;A compromised script may otherwise attempt to connect to an external SMTP system.&lt;/p&gt;

&lt;p&gt;With the restriction enabled, the operator reduces the ability of ordinary user processes to bypass the local mail server on the restricted paths.&lt;/p&gt;

&lt;p&gt;This is the core rationale described by cPanel.&lt;/p&gt;

&lt;h3&gt;
  
  
  3. Easier investigation when mail uses Exim
&lt;/h3&gt;

&lt;p&gt;When mail passes through the local MTA, the operator may have better evidence in:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Exim logs;&lt;/li&gt;
&lt;li&gt;queue data;&lt;/li&gt;
&lt;li&gt;delivery reports;&lt;/li&gt;
&lt;li&gt;and local sending statistics.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;A 2022 cPanel Community discussion presents exactly this concern. A moderator points back to cPanel's security rationale, while another community participant argues that keeping all outgoing mail through Exim makes spam activity easier to notice and trace.&lt;/p&gt;

&lt;p&gt;Community discussion:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://support.cpanel.net/hc/en-us/community/posts/19161442634903-Restrict-outgoing-SMTP-why-is-bad-to-allow" rel="noopener noreferrer"&gt;https://support.cpanel.net/hc/en-us/community/posts/19161442634903-Restrict-outgoing-SMTP-why-is-bad-to-allow&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;These are valid operational concerns.&lt;/p&gt;




&lt;h2&gt;
  
  
  The argument for disabling SMTP Restrictions
&lt;/h2&gt;

&lt;p&gt;There is also a legitimate compatibility and application-design argument for disabling the feature.&lt;/p&gt;

&lt;h3&gt;
  
  
  1. Modern applications often use external email services
&lt;/h3&gt;

&lt;p&gt;A hosted application may intentionally use:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;smtp.office365.com
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;rather than:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;localhost
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The organisation may have already chosen Microsoft 365, Google Workspace, or another provider for its email architecture.&lt;/p&gt;

&lt;p&gt;Forcing the application through the hosting server's local Exim service may not match the intended design.&lt;/p&gt;

&lt;h3&gt;
  
  
  2. Legitimate application SMTP can fail
&lt;/h3&gt;

&lt;p&gt;The restriction can interfere with applications that expect a direct external SMTP submission path.&lt;/p&gt;

&lt;p&gt;The resulting problem may be especially confusing when the application receives the local server's TLS certificate instead of the external provider's certificate.&lt;/p&gt;

&lt;h3&gt;
  
  
  3. The setting is not an absolute ban on every possible external SMTP design
&lt;/h3&gt;

&lt;p&gt;A 2025 cPanel Community discussion examined PHPMailer using SMTP2Go on port 2525.&lt;/p&gt;

&lt;p&gt;Participants discussed that SMTP Restrictions affect standard SMTP ports such as 25, 465, and 587, while a custom port such as 2525 may continue to work if allowed by the firewall.&lt;/p&gt;

&lt;p&gt;A cPanel moderator noted that a custom port may mean the SMTP Restrictions do not apply in that case.&lt;/p&gt;

&lt;p&gt;Community discussion:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://support.cpanel.net/hc/en-us/community/posts/34506598182295-SMTP-Restrictions-and-External-SMTP-providers" rel="noopener noreferrer"&gt;https://support.cpanel.net/hc/en-us/community/posts/34506598182295-SMTP-Restrictions-and-External-SMTP-providers&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This is an important nuance.&lt;/p&gt;

&lt;p&gt;It suggests that the setting should not be described as a complete boundary against every possible external SMTP connection.&lt;/p&gt;

&lt;h3&gt;
  
  
  4. cPanel officially documents disabling the feature for scripts that need to bypass Exim
&lt;/h3&gt;

&lt;p&gt;This is one of the most important points in the discussion.&lt;/p&gt;

&lt;p&gt;A cPanel support article updated on 22 May 2026 states that SMTP Restrictions help reduce outbound spam by forcing SMTP connections through local Exim.&lt;/p&gt;

&lt;p&gt;It then explains that if a script needs to bypass Exim when sending messages, the feature may need to be disabled.&lt;/p&gt;

&lt;p&gt;Official cPanel support article:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://support.cpanel.net/hc/en-us/articles/1500009931961-How-to-disable-SMTP-Restrictions" rel="noopener noreferrer"&gt;https://support.cpanel.net/hc/en-us/articles/1500009931961-How-to-disable-SMTP-Restrictions&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This does not mean cPanel recommends disabling the setting everywhere.&lt;/p&gt;

&lt;p&gt;It does show that bypassing Exim can be a recognised operational requirement rather than an inherently invalid configuration.&lt;/p&gt;




&lt;h2&gt;
  
  
  Does disabling the setting break Exim logging?
&lt;/h2&gt;

&lt;p&gt;This question deserves a direct answer.&lt;/p&gt;

&lt;p&gt;Disabling SMTP Restrictions does not, by itself, mean that Exim stops logging mail that actually passes through Exim.&lt;/p&gt;

&lt;p&gt;Consider two paths.&lt;/p&gt;

&lt;h3&gt;
  
  
  Path A: the application still uses local Exim
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Application
    |
    v
Local Exim
    |
    v
Remote recipient
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This mail still passes through the local MTA.&lt;/p&gt;

&lt;p&gt;The normal Exim logging, queueing, and reporting model continues to apply to that mail.&lt;/p&gt;

&lt;h3&gt;
  
  
  Path B: the application intentionally uses an external SMTP provider
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Application
    |
    v
smtp.office365.com
    |
    v
Microsoft 365
    |
    v
Recipient
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This mail does not pass through local Exim.&lt;/p&gt;

&lt;p&gt;Therefore, it is not expected to appear in local Exim logs.&lt;/p&gt;

&lt;p&gt;That is not the same as "Exim logging has stopped working".&lt;/p&gt;

&lt;p&gt;It means the application selected another SMTP provider.&lt;/p&gt;

&lt;p&gt;The operational question is therefore:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Does the hosting operator require visibility and control over all application SMTP traffic, or only over mail that uses the operator's own mail infrastructure?&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Different hosting providers may answer that question differently.&lt;/p&gt;




&lt;h2&gt;
  
  
  Direct-to-MX delivery and authenticated submission are not the same thing
&lt;/h2&gt;

&lt;p&gt;A useful security discussion should distinguish different SMTP patterns.&lt;/p&gt;

&lt;h3&gt;
  
  
  Direct-to-MX delivery
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Compromised process
      |
      v
Recipient MX on port 25
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In this case, the hosting server's IP may be the direct SMTP source seen by the recipient's mail infrastructure.&lt;/p&gt;

&lt;p&gt;This can create a clear IP reputation risk.&lt;/p&gt;

&lt;h3&gt;
  
  
  Authenticated SMTP submission
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Application
      |
      v
External provider on port 587
      |
      | SMTP AUTH
      v
Provider infrastructure
      |
      v
Recipient
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Here, the hosting server is the source of the submission connection, but the external provider normally performs final delivery.&lt;/p&gt;

&lt;p&gt;The provider may apply:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;authentication;&lt;/li&gt;
&lt;li&gt;tenant policy;&lt;/li&gt;
&lt;li&gt;rate limits;&lt;/li&gt;
&lt;li&gt;anti-abuse controls;&lt;/li&gt;
&lt;li&gt;reputation controls;&lt;/li&gt;
&lt;li&gt;and account suspension.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This does not make abuse impossible.&lt;/p&gt;

&lt;p&gt;It does mean that the risk model is different from a process directly delivering spam to recipient MX servers.&lt;/p&gt;

&lt;h3&gt;
  
  
  External provider on a custom port
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Application
      |
      v
External relay on port 2525
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This is yet another model, and the 2025 cPanel Community discussion shows why port-specific behaviour matters.&lt;/p&gt;

&lt;p&gt;Treating every form of "external SMTP" as identical can hide important technical differences.&lt;/p&gt;




&lt;h2&gt;
  
  
  What are the real risks of disabling the restriction?
&lt;/h2&gt;

&lt;p&gt;A neutral assessment should acknowledge the risks clearly.&lt;/p&gt;

&lt;h3&gt;
  
  
  1. User processes can bypass local Exim
&lt;/h3&gt;

&lt;p&gt;This is the central and intended effect.&lt;/p&gt;

&lt;p&gt;An application can use another SMTP provider instead of the local MTA.&lt;/p&gt;

&lt;h3&gt;
  
  
  2. External SMTP traffic is not visible in Exim logs
&lt;/h3&gt;

&lt;p&gt;If a message never passes through Exim, Exim cannot log its message transaction.&lt;/p&gt;

&lt;p&gt;Investigation may require:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;network telemetry;&lt;/li&gt;
&lt;li&gt;process information;&lt;/li&gt;
&lt;li&gt;firewall logs;&lt;/li&gt;
&lt;li&gt;endpoint security data;&lt;/li&gt;
&lt;li&gt;or evidence from the external provider.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  3. A compromised site may use external SMTP credentials
&lt;/h3&gt;

&lt;p&gt;Applications often store service credentials in configuration files or environment variables.&lt;/p&gt;

&lt;p&gt;If a site is compromised, an attacker may try to misuse those credentials.&lt;/p&gt;

&lt;p&gt;This is not unique to SMTP, but direct external SMTP connectivity can make such misuse possible from the compromised environment.&lt;/p&gt;

&lt;h3&gt;
  
  
  4. The server IP is still visible as the connection source
&lt;/h3&gt;

&lt;p&gt;Even when the external provider performs final delivery, it can see the IP address that initiated the SMTP submission connection.&lt;/p&gt;

&lt;p&gt;Abusive activity may therefore lead to:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;provider-side blocking;&lt;/li&gt;
&lt;li&gt;investigation;&lt;/li&gt;
&lt;li&gt;or abuse complaints.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  5. Local Exim limits do not control third-party SMTP traffic
&lt;/h3&gt;

&lt;p&gt;If the application bypasses Exim, local Exim limits are not the enforcement point for that external SMTP transaction.&lt;/p&gt;

&lt;p&gt;The external provider's controls become relevant instead.&lt;/p&gt;




&lt;h2&gt;
  
  
  What disabling the restriction does not automatically mean
&lt;/h2&gt;

&lt;p&gt;It is equally important not to exaggerate.&lt;/p&gt;

&lt;p&gt;Disabling SMTP Restrictions does not automatically mean:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Exim logging stops working;&lt;/li&gt;
&lt;li&gt;local mail becomes untraceable;&lt;/li&gt;
&lt;li&gt;the server becomes an open relay;&lt;/li&gt;
&lt;li&gt;every user can send through Microsoft 365 without credentials;&lt;/li&gt;
&lt;li&gt;every external SMTP message is delivered from the hosting server's IP;&lt;/li&gt;
&lt;li&gt;or the server will automatically be blacklisted.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Those are separate questions.&lt;/p&gt;

&lt;p&gt;The actual outcome depends on:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;the destination SMTP service;&lt;/li&gt;
&lt;li&gt;whether authentication is required;&lt;/li&gt;
&lt;li&gt;whether the application uses local Exim or a third-party provider;&lt;/li&gt;
&lt;li&gt;the provider's policies;&lt;/li&gt;
&lt;li&gt;the firewall configuration;&lt;/li&gt;
&lt;li&gt;and the behaviour of the hosted process.&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  A practical decision framework
&lt;/h2&gt;

&lt;p&gt;Instead of asking:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Is SMTP Restrictions good or bad?&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;a better set of questions may be:&lt;/p&gt;

&lt;h3&gt;
  
  
  1. What type of hosting environment is this?
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;traditional shared hosting;&lt;/li&gt;
&lt;li&gt;managed application hosting;&lt;/li&gt;
&lt;li&gt;a single-tenant server;&lt;/li&gt;
&lt;li&gt;a developer-focused platform;&lt;/li&gt;
&lt;li&gt;or a mixed environment?&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  2. Do customers legitimately need external SMTP?
&lt;/h3&gt;

&lt;p&gt;For example:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Microsoft 365;&lt;/li&gt;
&lt;li&gt;Google Workspace;&lt;/li&gt;
&lt;li&gt;external transactional mail;&lt;/li&gt;
&lt;li&gt;application-specific mail providers.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  3. Is the operator's policy to force all SMTP through local Exim?
&lt;/h3&gt;

&lt;p&gt;That can be a valid policy.&lt;/p&gt;

&lt;p&gt;But it should be an intentional architecture decision.&lt;/p&gt;

&lt;h3&gt;
  
  
  4. What visibility exists outside Exim?
&lt;/h3&gt;

&lt;p&gt;If external SMTP is allowed, can the operator investigate unusual outbound connections through:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;firewall telemetry;&lt;/li&gt;
&lt;li&gt;process monitoring;&lt;/li&gt;
&lt;li&gt;endpoint protection;&lt;/li&gt;
&lt;li&gt;network monitoring;&lt;/li&gt;
&lt;li&gt;or other security controls?&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  5. What happens when a legitimate application fails?
&lt;/h3&gt;

&lt;p&gt;Can support staff recognise:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;expected external SMTP certificate
received local server certificate
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;as a possible SMTP restriction symptom?&lt;/p&gt;

&lt;h3&gt;
  
  
  6. Has the decision been tested under a normal hosting user?
&lt;/h3&gt;

&lt;p&gt;A root-level network test may not reproduce user-level restrictions.&lt;/p&gt;




&lt;h2&gt;
  
  
  A balanced operational approach
&lt;/h2&gt;

&lt;p&gt;Some operators may reasonably choose:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;SMTP Restrictions = Enabled
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;because they prioritise:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;centralised mail control;&lt;/li&gt;
&lt;li&gt;Exim visibility;&lt;/li&gt;
&lt;li&gt;and reducing direct SMTP access from user processes.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Others may reasonably choose:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;SMTP Restrictions = Disabled
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;because they prioritise:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;compatibility with modern applications;&lt;/li&gt;
&lt;li&gt;customer-managed external email services;&lt;/li&gt;
&lt;li&gt;and direct authenticated SMTP submission.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;A third group may keep restrictions enabled while using:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;external relays on supported custom ports;&lt;/li&gt;
&lt;li&gt;smarthost designs;&lt;/li&gt;
&lt;li&gt;or other controlled architectures.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;There is no useful universal answer without understanding the environment.&lt;/p&gt;




&lt;h2&gt;
  
  
  Final thoughts
&lt;/h2&gt;

&lt;p&gt;cPanel SMTP Restrictions solve a real problem.&lt;/p&gt;

&lt;p&gt;They can reduce the ability of ordinary user processes to bypass the local mail server, which can be valuable in shared hosting environments.&lt;/p&gt;

&lt;p&gt;But the same control can also interfere with legitimate applications that intentionally use external SMTP providers.&lt;/p&gt;

&lt;p&gt;The most important lesson is not "always enable it" or "always disable it".&lt;/p&gt;

&lt;p&gt;It is this:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Understand the actual traffic path before making the decision.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;When troubleshooting, test:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;as root;&lt;/li&gt;
&lt;li&gt;as the hosting user;&lt;/li&gt;
&lt;li&gt;and from the actual application runtime.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Inspect:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;the SMTP banner;&lt;/li&gt;
&lt;li&gt;the TLS certificate;&lt;/li&gt;
&lt;li&gt;the destination;&lt;/li&gt;
&lt;li&gt;and the user context.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;And when deciding whether the restriction belongs in your environment, separate:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;direct-to-MX delivery;&lt;/li&gt;
&lt;li&gt;authenticated SMTP submission;&lt;/li&gt;
&lt;li&gt;external relays;&lt;/li&gt;
&lt;li&gt;local Exim traffic;&lt;/li&gt;
&lt;li&gt;and custom-port designs.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;They are not the same problem.&lt;/p&gt;

&lt;p&gt;A simple ON/OFF switch can represent a much larger architectural trade-off.&lt;/p&gt;




&lt;h2&gt;
  
  
  References
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;cPanel &amp;amp; WHM Documentation — SMTP Restrictions&lt;br&gt;&lt;br&gt;
&lt;a href="https://docs.cpanel.net/whm/security-center/smtp-restrictions/" rel="noopener noreferrer"&gt;https://docs.cpanel.net/whm/security-center/smtp-restrictions/&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;cPanel Support — How to disable SMTP Restrictions&lt;br&gt;&lt;br&gt;
&lt;a href="https://support.cpanel.net/hc/en-us/articles/1500009931961-How-to-disable-SMTP-Restrictions" rel="noopener noreferrer"&gt;https://support.cpanel.net/hc/en-us/articles/1500009931961-How-to-disable-SMTP-Restrictions&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;cPanel Community — Restrict outgoing SMTP, why is bad to allow?&lt;br&gt;&lt;br&gt;
&lt;a href="https://support.cpanel.net/hc/en-us/community/posts/19161442634903-Restrict-outgoing-SMTP-why-is-bad-to-allow" rel="noopener noreferrer"&gt;https://support.cpanel.net/hc/en-us/community/posts/19161442634903-Restrict-outgoing-SMTP-why-is-bad-to-allow&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;cPanel Community — SMTP Restrictions and External SMTP providers&lt;br&gt;&lt;br&gt;
&lt;a href="https://support.cpanel.net/hc/en-us/community/posts/34506598182295-SMTP-Restrictions-and-External-SMTP-providers" rel="noopener noreferrer"&gt;https://support.cpanel.net/hc/en-us/community/posts/34506598182295-SMTP-Restrictions-and-External-SMTP-providers&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;




&lt;p&gt;&lt;em&gt;This article is intended as a technical and operational analysis. It does not recommend one universal configuration for every cPanel server.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>cpanel</category>
      <category>linux</category>
    </item>
    <item>
      <title>[Boost]</title>
      <dc:creator>Mohammed AlShannaq</dc:creator>
      <pubDate>Thu, 13 Nov 2025 23:25:07 +0000</pubDate>
      <link>https://dev.to/mshannaq/-icl</link>
      <guid>https://dev.to/mshannaq/-icl</guid>
      <description>&lt;div class="ltag__link"&gt;
  &lt;a href="/devteam" class="ltag__link__link"&gt;
    &lt;div class="ltag__link__org__pic"&gt;
      &lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Forganization%2Fprofile_image%2F1%2Fd908a186-5651-4a5a-9f76-15200bc6801f.jpg" alt="The DEV Team" width="800" height="800"&gt;
      &lt;div class="ltag__link__user__pic"&gt;
        &lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F264%2Fb75f6edf-df7b-406e-a56b-43facafb352c.jpg" alt="" width="400" height="400"&gt;
      &lt;/div&gt;
    &lt;/div&gt;
  &lt;/a&gt;
  &lt;a href="https://dev.to/devteam/top-7-featured-dev-posts-of-the-week-2ah" class="ltag__link__link"&gt;
    &lt;div class="ltag__link__content"&gt;
      &lt;h2&gt;Top 7 Featured DEV Posts of the Week&lt;/h2&gt;
      &lt;h3&gt;Jess Lee for The DEV Team ・ Nov 11&lt;/h3&gt;
      &lt;div class="ltag__link__taglist"&gt;
        &lt;span class="ltag__link__tag"&gt;#top7&lt;/span&gt;
        &lt;span class="ltag__link__tag"&gt;#discuss&lt;/span&gt;
      &lt;/div&gt;
    &lt;/div&gt;
  &lt;/a&gt;
&lt;/div&gt;


</description>
      <category>top7</category>
      <category>discuss</category>
    </item>
    <item>
      <title>Run MkDocs on iPad with iSH and Browse It Locally 🎉</title>
      <dc:creator>Mohammed AlShannaq</dc:creator>
      <pubDate>Sat, 04 Oct 2025 01:49:01 +0000</pubDate>
      <link>https://dev.to/mshannaq/run-mkdocs-on-ipad-with-ish-and-browse-it-locally-2n7c</link>
      <guid>https://dev.to/mshannaq/run-mkdocs-on-ipad-with-ish-and-browse-it-locally-2n7c</guid>
      <description>&lt;p&gt;Have you ever thought about turning your iPad into a mini documentation server?&lt;br&gt;
With iSH (a Linux shell for iOS) and MkDocs, you can not only build documentation projects right on your iPad, but also serve and browse them locally in Chrome or Safari on the same device! 🚀&lt;/p&gt;

&lt;p&gt;Why do this?&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;📝 Write and preview your documentation on the go, without a laptop.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;💡 Turn your iPad into a self-contained dev and docs environment.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;🌍 Browse your MkDocs site locally as if it’s hosted online — but it’s all happening inside your iPad.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;
  
  
  Step 1: Install iSH
&lt;/h2&gt;

&lt;p&gt;Grab iSH Shell from the App Store. It runs Alpine Linux inside iOS — lightweight and perfect for experiments like this.&lt;/p&gt;
&lt;h2&gt;
  
  
  Step 2: Install Python &amp;amp; Build Tools
&lt;/h2&gt;

&lt;p&gt;Inside iSH, update and install the required packages:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;apk update
apk add python3 py3-pip build-base python3-dev libffi-dev openssl-dev
pip install --upgrade pip setuptools wheel
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Step 3: Install MkDocs
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;pip install mkdocs mkdocs-material

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Check if it works:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;mkdocs —version
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Step 4: Create a Project
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;mkdocs new mydocs
cd mydocs
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Step 5: Serve the Site
&lt;/h2&gt;

&lt;p&gt;Here’s the magic part — run the built-in dev server on 127.0.0.1:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;mkdocs serve -a 127.0.0.1:8000
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Step 6: Browse on Your iPad 🎉
&lt;/h2&gt;

&lt;p&gt;Now open Chrome or Safari on your iPad and go to:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;http://127.0.0.1:8000/
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Boom! You’re browsing your MkDocs site that’s being served locally inside iSH. No extra devices, no external servers — just your iPad.&lt;/p&gt;

&lt;p&gt;⚠️ &lt;strong&gt;Tip&lt;/strong&gt;: Keep the iSH app running in the foreground (or in split-screen with Chrome/Safari). If iSH is fully sent to the background, iOS will freeze the process and your local MkDocs server will stop responding.&lt;/p&gt;

&lt;h2&gt;
  
  
  Final Thoughts
&lt;/h2&gt;

&lt;p&gt;This little hack shows how powerful iSH can be. Pair it with MkDocs, and suddenly your iPad becomes a portable documentation lab. You can edit Markdown, rebuild instantly, and preview it live in your browser — all on one device.&lt;/p&gt;

&lt;p&gt;⸻&lt;/p&gt;

&lt;p&gt;👉 Would you try running MkDocs (or maybe even other Python-based tools) on your iPad?&lt;/p&gt;

</description>
      <category>ipad</category>
      <category>python</category>
      <category>documentation</category>
      <category>webdev</category>
    </item>
    <item>
      <title>Run MkDocs on iPad with iSH and Browse It Locally 🎉</title>
      <dc:creator>Mohammed AlShannaq</dc:creator>
      <pubDate>Sat, 04 Oct 2025 01:29:02 +0000</pubDate>
      <link>https://dev.to/mshannaq/run-mkdocs-on-ipad-with-ish-and-browse-it-locally-4anc</link>
      <guid>https://dev.to/mshannaq/run-mkdocs-on-ipad-with-ish-and-browse-it-locally-4anc</guid>
      <description></description>
      <category>python</category>
      <category>tutorial</category>
      <category>linux</category>
      <category>ios</category>
    </item>
    <item>
      <title>How I Exported and Re-Imported a netcup Server Snapshot (raw.zst qcow2)</title>
      <dc:creator>Mohammed AlShannaq</dc:creator>
      <pubDate>Thu, 25 Sep 2025 21:57:30 +0000</pubDate>
      <link>https://dev.to/mshannaq/how-i-exported-and-re-imported-a-netcup-server-snapshot-rawzst-qcow2-ol1</link>
      <guid>https://dev.to/mshannaq/how-i-exported-and-re-imported-a-netcup-server-snapshot-rawzst-qcow2-ol1</guid>
      <description>&lt;p&gt;When you run servers on &lt;strong&gt;netcup&lt;/strong&gt; (VPS or root Servers), one of the features you get is the ability to take snapshots of your VM. These snapshots can be downloaded as a file and stored locally or on object storage like S3, so you always have a backup you control.&lt;/p&gt;

&lt;p&gt;In fact, one of the neat features netcup provides is the option to export snapshots as downloadable files. For many plans, a limited number of exports are included for free, and if you need more, you can purchase additional exports as an add-on.&lt;/p&gt;

&lt;p&gt;This gives you the ability to keep offline or external copies of your VM state without relying solely on the built-in snapshot system — especially useful if you ever optimize storage or lose the snapshots stored within netcup’s platform.&lt;/p&gt;

&lt;p&gt;🐛 &lt;strong&gt;But here’s the catch:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;netcup&lt;/strong&gt; lets you download snapshots in a compressed format:
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;vda_snapshot.raw.zst
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;However, when you try to re-upload the same &lt;code&gt;.raw.zst&lt;/code&gt; back into netcup’s Server Control Panel (SCP), it fails. Why? Because netcup does not support &lt;code&gt;.zst&lt;/code&gt; uploads — only &lt;code&gt;raw&lt;/code&gt;, &lt;code&gt;qcow&lt;/code&gt;, and &lt;code&gt;qcow2&lt;/code&gt; formats are officially supported and accepted.&lt;/p&gt;

&lt;p&gt;In this article explains how I hit this problem, the dead ends I faced, and the working solution to restore my server successfully from a snapshot that I have created before for the server and downloaded it locally on my pc (or store it in AWS S3)&lt;/p&gt;

&lt;h2&gt;
  
  
  The Problem
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;I downloaded my snapshot from netcup: &lt;code&gt;vda_alma10readysam1.raw.zst&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;I wanted to re-import it via Upload Image → Generate Upload URL. (using netcup SCP) or even upload the image from my pc.&lt;/li&gt;
&lt;li&gt;But when I tried to use it directly, and start the server after I receive email says that image installed, the server wouldn’t boot: “&lt;strong&gt;no boot device found.&lt;/strong&gt;”&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Why? After couple of tries I see that it happens because &lt;code&gt;.raw.zst&lt;/code&gt; is only useful for downloading. netcup won’t accept it as an upload format.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 1: Decompress the Snapshot
&lt;/h2&gt;

&lt;p&gt;First, you need to decompress the .zst file into a raw image. Install zstd if it’s missing:&lt;/p&gt;

&lt;p&gt;💡 Note: The decompressed raw file will be the same size as your original VM disk (e.g. a 250 GB VM will produce a 250 GB raw file). Make sure you have enough free space on your system before starting the decompression.&lt;/p&gt;

&lt;p&gt;First of all make sure &lt;code&gt;zstd&lt;/code&gt; is insalled:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;# AlmaLinux / Rocky
dnf install -y zstd

# Ubuntu / Debian
apt install -y zstd
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then decompress the &lt;code&gt;.raw.zst&lt;/code&gt; file:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;unzstd vda_alma10readysam1.raw.zst -o vda_alma10readysam1.raw
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now you have a &lt;code&gt;.raw&lt;/code&gt; file.&lt;/p&gt;

&lt;p&gt;⚠️ &lt;strong&gt;Warning:&lt;/strong&gt; The raw file size always equals the full disk size of your VM. For example, if your VM had a 250 GB disk, the exported &lt;code&gt;.raw&lt;/code&gt; file will be 250 GB — even if you only used 5 GB of actual data.&lt;br&gt;
Trying to upload that 250 GB raw file would be a huge mistake: most of it is just empty space (zeros), so you’d be wasting time, bandwidth, and money moving around data that doesn’t really exist.&lt;/p&gt;

&lt;p&gt;That’s exactly why converting to qcow2 is the smarter approach&lt;/p&gt;
&lt;h2&gt;
  
  
  Step 2: Convert Raw → qcow2
&lt;/h2&gt;

&lt;p&gt;To save space and make uploads feasible, convert the raw image to qcow2. Install qemu-img if not already installed:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;# AlmaLinux / Rocky
dnf install -y qemu-img

# Ubuntu / Debian
apt install -y qemu-utils
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Convert the raw file:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;qemu-img convert -p -O qcow2 vda_alma10readysam1.raw vda_alma10readysam1.qcow2
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now check the result:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;qemu-img info vda_alma10readysam1.qcow2
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Example output:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;image: vda_alma10readysam1.qcow2
file format: qcow2
virtual size: 256 GiB (274877906944 bytes)
disk size: 7.01 GiB
cluster_size: 65536
Format specific information:
    compat: 1.1
    compression type: zlib
    lazy refcounts: false
    refcount bits: 16
    corrupt: false
    extended l2: false
Child node '/file':
    filename: vda_alma10readysam1.qcow2
    protocol type: file
    file length: 7.01 GiB (7531462656 bytes)
    disk size: 7.01 GiB
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;💡 &lt;strong&gt;Notice&lt;/strong&gt; how the virtual size is still 256 GB, but the actual file size is just 7 GB. That’s the power of qcow2.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 3: Upload to netcup
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Log into SCP → Media → Upload Image.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Click Generate Upload URL. (enter the file name for example vda_alma10readysam1.qcow2 ) and generate Upload Url, and the portal will give you Pre-signed URL to upload the file into using &lt;code&gt;curl&lt;/code&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Use curl or aws s3 cp to upload your qcow2 file:&lt;br&gt;
&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;url --progress-bar 'https://upload.url.from.netcup...fullurlofuploadurl...' --upload-file vda_alma10readysam1.qcow2 | cat

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;Once uploaded, select the image and deploy it to a new server.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;After this, my server booted normally again 🎉.&lt;/p&gt;

&lt;p&gt;👉 &lt;strong&gt;Note:&lt;/strong&gt; You don’t have to use the Generate Upload URL method if you don’t want to. netcup’s SCP also allows you to upload the image directly from your local machine — simply browse for the &lt;code&gt;.qcow2&lt;/code&gt; file and upload it through the web interface. This can be easier for smaller images, but for larger files I still recommend using the upload URL approach.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 4: Store Your Snapshots Safely
&lt;/h2&gt;

&lt;p&gt;Instead of keeping snapshots only in netcup, you can store them externally (after you export it)&lt;/p&gt;

&lt;p&gt;This way, you can always re-import the image later, or even run it on another virtualization platform that supports qcow2 (Proxmox, KVM, etc.).&lt;/p&gt;

&lt;h2&gt;
  
  
  Lessons Learned
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;code&gt;.raw.zst&lt;/code&gt; is &lt;strong&gt;download-only&lt;/strong&gt;. You can’t re-import it to netcup.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;You must convert it to &lt;strong&gt;raw, qcow, or qcow2&lt;/strong&gt; — with qcow2 being my most efficient choice.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Always verify your qcow2 image with qemu-img info before uploading.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Storing qcow2 snapshots externally (S3, local disk, NAS) makes disaster recovery much easier.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;What started as a frustrating “no boot device 🤯” error turned into a neat learning experience. By decompressing and converting the snapshot, I was able to restore my VM cleanly and keep smaller, portable backups for the future.&lt;/p&gt;

&lt;p&gt;To give you a sense of the savings:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;The original snapshot (.raw.zst) was 4.6 GB.&lt;/li&gt;
&lt;li&gt;After decompression to raw, it exploded to 256 GB (matching the full disk size).&lt;/li&gt;
&lt;li&gt;Once converted to qcow2, it shrank back down to just 7.4 GB — small enough to store and upload efficiently.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If you’re running servers on netcup, don’t just rely on downloading .raw.zst snapshots. Convert them, back them up properly, and make sure you can re-import them when needed. Your future self will thank you.&lt;/p&gt;

</description>
      <category>cloudcomputing</category>
      <category>devops</category>
      <category>virtualization</category>
      <category>virtualmachine</category>
    </item>
  </channel>
</rss>
