title: Ubuntu sendmail only sends to localhost
body: <p>I have set up a LAMP server with sendmail on Ubuntu 14.04.
  When sending mail, either from terminal or PHP mail(), it won't work properly.</p>
  
  <p>When I use <code>mail("user@localhost","test","test");</code> it sends it correctly, and I can read the message with <code>mail</code> from terminal, but when sending to Gmail address, message won't go trough. 
  Same outcome when using <code>"test" | mail -s "test" xyz@gmail.com"</code> from server terminal.</p>
  
  <p>Any idea how to fix this?</p>
  
  <p>I have been Googling for several hours now, I have tried everything without finding working solution, and I'm starting to lose hope.</p>