Ubuntu – Sendmail not working on ubuntu guest – unqualified host name

12.04hostnamesendmailvirtualbox

I have a win7 host running ubuntu guest through vbox. it is configured with a bridged network adapter and I am using DHCP to assign an ip of 192.168.0.5 to the guest which is mapped to smartstart.dev in my windows hosts file. I havent done anything to hosts on the ubuntu side.

I am testing a website and need sendmail working. I have installed sendmail, but the mails aren't being sent. When i look through the mail error logs I can see lots of lines like this:

Jan 14 17:00:01 djw-ss sm-msp-queue[2771]: My unqualified host name (djw-ss) unknown; sleeping for retry
Jan 14 17:01:02 djw-ss sm-msp-queue[2771]: unable to qualify my own domain name (djw-ss) -- using short name

Can anyone tell me how to get this working? Strange thing is I have a similar setup on another vb – I dont think I've done anything different and it works just fine out of the box.

Best Answer

Edit your /etc/hosts exactly as below:

127.0.0.1   localhost.localdomain localhost
127.0.1.1   djw-ss.localdomain    djw-ss

Check in your /var/log/mail.err file for the time of the last errors you had.

Reboot the system.

In your /var/log/mail.err you should not have anymore errors in this logfile.

Related Question