Mail functionality on ubuntu VPS?

On a linux machine, PHP uses a command line program called sendmail to send mail (funnily enough). What sendmail does is put the mail in the outgoing queue of the server MTA (mail transfer agent).

Sidenote: the granddaddy of unix MTAs is called sendmail and that is where the name of the command line program comes from. But for backwards compatibility, all modern MTAs include a program of their own called sendmail for this purpose.

From memory Ubuntu uses Postfix as its default MTA (I don’t actually use Ubuntu myself). Your servers local MTA will generally be configured to pass outgoing mail onto a smarthost (usually your hosts mail server) for delivery to the final recipients. This generally won’t have anything to do with where you receive mail for your domain (eg google).

To begin with, look in the Postfix logs (/var/log/mail ?) for any clues about why mail isn’t being sent.

Chances are it will be one of these reasons:

a) your MTA isn’t configured to forward mail (from your websites email address) onto your VPS hosts SMTP smarthost (ie SMTP mail server). That’s something you’ll get better help from either your host or the Ubuntu and/or Postfix communities.

b) your messages are hitting a mail relay restriction somewhere. eg your hosts smarthost might not be configured to relay outgoing mail with the address you’ve configured your site with. Ask your host for help with this.

c) or if there is nothing in your postfix logs, your PHP install probably isn’t properly configured. Look in php.ini (or the output of <?php phpinfo(); ?>) to find out what path PHP is using for sendmail. Then find your sendmail location (eg /usr/sbin/sendmail) via the command line eg: which sendmail or locate sendmail. Make sure that the path PHP is using matches the location of the file.

1 Star2 Stars3 Stars4 Stars5 Stars (No Ratings Yet)
Loading ... Loading ...

Related Articles

Random Articles

Post a Comment