Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I installed sendmail on ubuntu 9.04 on my laptop computer. My php mail() function still doesn't work from localhost, so I want to disable the auto start up of mail transport agent during system boot.

How do I disable the auto start up of the mail transport agent?


share|improve this question
up vote 9 down vote accepted

sudo update-rc.d sendmail disable

But I don't see how this is going to help your non-working mail() function.

share|improve this answer
Perhaps he found an alternative like a SMTP server somewhere else he could use and he is just trying to clean up? – Zoredache Nov 6 '09 at 1:53
thanks, that worked. Actually, I'll ask about the mail function another time. I couldn't get sendmail working on my localhost, so i figured I'll get rid of it for now because it was slowing down my system boot up. – John Nov 6 '09 at 4:55

To make sendmail work with php, edit your php.ini file:

sudo nano /etc/php5/cli/php.ini

Use ctrl+W to search for "sendmail_". Remove the comment (#) before "sendmail_from" and "sendmail_path" and modify them like so:

sendmail_from = php@hostname
sendmail_path = /usr/sbin/sendmail -i -t

You can replace "php@hostname" with your own.

To make sendmail boot faster, check your hostname with (or just look in /etc/hostname):


Then edit /etc/hosts:

sudo nano /etc/hosts

Make sure it contains the following lines (you might have additional info like localhost.localdomain, if you have a domain): localhost hostname
share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.