title: Find sendmail version (sSMTP or Postfix or other)
body: <p>I have a script which runs on multiple servers. Some servers are using <strong>sSMTP</strong> and some are using <strong>postfix</strong>. </p>
  
  <p>I want to find which version of <strong>sendmail</strong> my server is running in runtime, because <code>-t</code> is not supported in <strong>sSMTP</strong> but is mandatory in <strong>Postfix</strong></p>
  
  <p>Now the challenge begins. </p>
  
  <p><code>sendmail -V</code> on sSMTP variant outputs <code>sSMTP 2.64 (Not sendmail at all)</code>
  but
  the postfix variant doesn't have the <code>-V</code> option for displaying the version. </p>
  
  <p>I managed to accomplish it with the following snippet.</p>
  
  <pre><code>VER=$(sendmail -V 2&gt;/dev/null)
  if [[ "sSMTP" == $VER* ]]; then
          echo $BODY | sendmail $EMAIL #sSMTP
  else
          echo $BODY | sendmail -t $EMAIL #postfix
  fi
  </code></pre>
  
  <p>Is there a more efficient method to achieve this?</p>
  
  <p>I want to find what variant of sendmail is in my server. Not just postfix or sSMTP. </p>