You're using Ubuntu, right? Then your MTA is Postfix.
The default MTA settings for most distributions is to deliver mail using DNS. This means that for every mail, Postfix performs a DNS lookup to find the MX record for the recipient's domain, which points to the responsible mail server(s) for that domain.
Unfortunately, mail from a mail server behind a dynamic IP address on a residential DSL or cable modem connection is likely to be rejected as spam. You need to tell Postfix to send all outgoing mail via your ISP's "smart host", a SMTP relay server that will perform the final delivery on your behalf.
You will need to find the name of your ISP's mail relay. Then you'll have to edit /etc/postfix/main.cf and find the line
and change it to
relayhost = [smtp.relay.host]
And yes, the name is supposed to be inside square brackets. You can edit the file with any text editor, but you'll probebly have to start it as root, with sudo
. Alternatively, you can use postconf
sudo postconf -e 'relayhost = [smtp.relayhost]'
Once you've done this, restart Postfix with
sudo /etc/init.d/postfix restart
Should you find that postconf
isn't a recognized command and there's no sign of /etc/postfix/main.cf
, you'll have to install postfix with
sudo apt-get install postfix
I believe this will start a configuration wizard where, amongst other things, you can enter the name of the relay host.