Sendmail: nothing gets sent to the outside world
Q I am in the process of setting up a server to host our laboratory management software. I've gone for a Kubuntu server install with Sendmail - this is where the problem starts. I've run through the basic Sendmail configuration, leaving things alone as I understand almost nothing about Sendmail's config! It will send mail to people on the local network (eg firstname.lastname@example.org) but nothing gets to the outside world (eg email@example.com). I'd love some advice - or maybe a tutorial on setting up a mail server?
A Sendmail is not the ideal choice for you. While it is undoubtedly a powerful mail server, it is also difficult to configure. Postfix or Exim would be a better choice; both of these are available as packages through the Ubuntu repositories (Postfix is the default mail server and is on the Ubuntu installation CDs). These servers have heavily commented, plain-text configuration files that make learning to configure them much simpler than battling your way through Sendmail's dense configuration options. Whichever server you choose, you should consider using Webmin to configure it. As well as presenting you the options through a friendly web front-end, it makes it more difficult to misconfigure the server with the potential loss of mail or security. You can still read or fine-tune the config files by hand if you wish, so Webmin helps you learn the configuration options rather than hiding them. Whichever server you end up running, the logfiles should provide a reason for the failure. Run
tail -f /path/to/logfile
and try to send a mail to the outside world. You should see an error message relating to the failure. This could be anything from a DNS failure (although that would be unlikely if other internet activities work) to your ISP blocking outgoing SMTP traffic. Many ISPs do this as an anti-spam measure, either redirecting all SMTP traffic to their own mail server or blocking it entirely. If this is the case, you need to set up your mail server to use your ISP's server as a 'smarthost'. This means that all mail not for your local network is sent via that server. To do this with Sendmail, put the following in sendmail.cf:
replacing mail.isp.com with your ISP's SMTP server. In Postfix, the line is
relayhost = mail.isp.com
If you use Webmin, this is the first option in the Sendmail module and the fourth in the Postfix module.
Follow us on Identi.ca or Twitter